Skip to content
Snippets Groups Projects
Commit 9dfd4275 authored by Regis Houssin's avatar Regis Houssin
Browse files

New: add possibility to defined permissions in external tab

parent 0a376dc8
Branches
Tags
No related merge requests found
......@@ -102,8 +102,8 @@ class modMyModule extends DolibarrModules
$this->const = array();
// Array to add new pages in new tabs
// Example: $this->tabs = array('objecttype:+tabname1:Title1:@mymodule:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1
// 'objecttype:+tabname2:Title2:@mymodule:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2
// Example: $this->tabs = array('objecttype:+tabname1:Title1:@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1
// 'objecttype:+tabname2:Title2:@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2
// 'objecttype:-tabname'); // To remove an existing tab identified by code tabname
// where objecttype can be
// 'thirdparty' to add a tab in third party view
......
......@@ -3752,6 +3752,18 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode=
$values=explode(':',$value);
if ($mode == 'add')
{
if (sizeof($values) == 6) // new declaration with permissions
{
if ($values[0] != $type) continue;
if (verifCond($values[4]))
{
if ($values[3]) $langs->load($values[3]);
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[5]),1);
$head[$h][1] = $langs->trans($values[2]);
$head[$h][2] = str_replace('+','',$values[1]);
$h++;
}
}
if (sizeof($values) == 5) // new declaration
{
if ($values[0] != $type) continue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment