モジュール 開発: Difference between revisions

Jump to navigation Jump to search
m
Line 129: Line 129:
</syntaxhighlight>
</syntaxhighlight>


The table should contain a list of strings, each string representing a new tab.
テーブルには文字列のリストが含まれ、各文字列は新しいタブを表す.文字列の形式は ": " で区切られた5つの部分で構成される.
The format of the string consisting of 5 parts separated by ":"


*Part 1: The element type (object type) where the tab should appear is a value from the following:
*Part 1: タブを表示するエレメントタイプ(オブジェクトタイプ)で、以下の値:
{{TemplateModuleTabsJA}}
{{TemplateModuleTabsJA}}


*Part 2: A code to identify tab to add (start with +) or to remove (start with -)
*Part 2: タブのコードで、タブの追加(+で始まる)または削除(-で始まる)を識別する.
*Part 3: The title of the tab. This can be a hard read or better code translation in a file lang.
*Part 3: タブのタイトル.タイトルが読みずらいなら、コードにして言語ファイルで翻訳するとよい.
*Part 4: The name of the file "*.lang" which contains correspondence between the code translation and language to display. If this name is followed with @mymodule, Dolibarr will search translation file "*.lang" within the module, so htdocs/mymodule/langs/code_CODE/mylangfile.lang, otherwise Dolibarr will look for file htdocs/langs/code_CODE/mylangfile.lang
*Part 4: ファイル名 "*.lang" は、コード翻訳と表示する言語の対応を含む.この名前の後に@mymoduleが続く場合、 Dolibarrはモジュール内の翻訳ファイル "*.lang "を検索するので、htdocs/mymodule/langs/code_CODE/mylangfile.langとなり、そうでない場合はhtdocs/langs/code_CODE/mylangfile.langとなる.
*Part 5: A condition to test if tab must be visible. Put 1 to be always visible.
*Part 5: タブを常時表示すべきかのテスト条件.常時表示の場合は1を指定.
*Part 6: The URL of the page to display when you click on the tab. The __ID__ string will be replaced automatically by the Id of the element concerned.
*Part 6: タブをクリックしたときに表示されるページのURL。__ID__の文字列は自動的に当該要素のIdに置き換えられる.


To feed the contents of the tab with data from the database, see the next chapter.
タブの内容へデータベースからのデータを注入するには、次章を参照.


In order to get the names  'tabname' of existing tabs, you have to check the names used in the function 'product_prepare_head' of the file  'core/lib/module.lib.php' corresponding to section '$head[$h][2]'.
既存タブの名前 'tabname' を取得するには、ファイル 'core/lib/module.lib.php' の関数 'product_prepare_head' で使用されている名前で、セクション '$head[$h][2]' に対応するものをチェックする必要がある.


===Show tabs navigation into your own pages===
===自前ページにタブナビゲーションを表示===
'''When''': To show all standard tabs of an object (product, tiers, etc.) on your page.
'''使用場面''': 自前ページにオブジェクト(製品、階層、など)の標準タブを表示したい


You must follow these steps :
以下の手順に従う :


'''1. Include files you need into your file'''
'''1. Include files you need into your file'''
56

edits

Navigation menu