Tabs system: Difference between revisions

Jump to navigation Jump to search
m
Line 39: Line 39:


Where:
Where:
* objecttype is the name of the tabhook you will use.
* '''objecttype''' is the name of the tabhook you will use.
* +tabname is a name you choose to identify your tab, preceded by the action (either + to add, or - to remove, and you can remove other tabs as well including default ones).
* '''+tabname''' is a name you choose to identify your tab, preceded by the action (either + to add, or - to remove, and you can remove other tabs as well including default ones).
* TitleOfTab is a title you choose, it will be translated
* '''TitleOfTab''' is a title you choose, it will be translated
* @mymodule is the language file where your translation (of the title) resides (eg: mytitlelang@mymodule will look inside /htdocs/mymodule/langs/xx_XX/mytitlelang and where xx_XX is the current localization of Dolibarr, eg: en_US, fr_FR, etc.).
* '''@mymodule''' is the language file where your translation (of the title) resides (eg: mytitlelang@mymodule will look inside /htdocs/mymodule/langs/xx_XX/mytitlelang and where xx_XX is the current localization of Dolibarr, eg: en_US, fr_FR, etc.).
* $conditiontoshowtab is a variable that will be eval'd to get the value: if true then the tab is shown, if false then the tab won't be. Eg: you can use the Dolibarr rights system, eg: $user->rights->product->creer or $user->admin or any other variable you want. This is optional, you can just skip this and leave only 5 elements in this string and it will work (don't forget to remove the semicolon too).
* '''$conditiontoshowtab''' is a variable that will be eval'd to get the value: if true then the tab is shown, if false then the tab won't be. Eg: you can use the Dolibarr rights system, eg: $user->rights->product->creer or $user->admin or any other variable you want. This is optional, you can just skip this and leave only 5 elements in this string and it will work (don't forget to remove the semicolon too).
* urloftab?id=__ID__ is the URL where the tab will point to when clicked. You can use the placeholder __ID__ which will be replaced by the value of the id if one is defined. Eg: DOL_DOCUMENT_ROOT.'/mymodule/lib/mytab.php'
* '''urloftab?id=__ID__''' is the URL where the tab will point to when clicked. You can use the placeholder __ID__ which will be replaced by the value of the id if one is defined. Eg: DOL_DOCUMENT_ROOT.'/mymodule/lib/mytab.php'




Navigation menu