From: hickert Date: Wed, 26 Aug 2009 08:02:49 +0000 (+0000) Subject: Updated tabs - We are now able to disable references and acls in constructor. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=306fc4eb76b37c68d4dd3dd84b289e3813abaaf5;p=gosa.git Updated tabs - We are now able to disable references and acls in constructor. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14136 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_multi_plug.inc b/gosa-core/include/class_multi_plug.inc index c999641c1..af39e67d7 100644 --- a/gosa-core/include/class_multi_plug.inc +++ b/gosa-core/include/class_multi_plug.inc @@ -156,7 +156,7 @@ class multi_plug /* Initialize collector object * Used to display the ui and to collect the user input. */ - $this->o_tab = new $class($config,$tab,"new",$acl_category); + $this->o_tab = new $class($config,$tab,"new",$acl_category, TRUE, TRUE); $this->o_tab->set_acl_base($acl_base); $this->by_object = &$this->o_tab->by_object; $this->by_name = &$this->o_tab->by_name; @@ -173,7 +173,7 @@ class multi_plug /* Initialize the objects we want to edit at once */ foreach($dns as $dn){ - $obj = new $class($config,$tab,$dn,$acl_category); + $obj = new $class($config,$tab,$dn,$acl_category, TRUE, TRUE); $obj->set_acl_base($acl_base); $this->a_handles[] = $obj; } diff --git a/gosa-core/include/class_tabs.inc b/gosa-core/include/class_tabs.inc index feb50d164..f277f815b 100644 --- a/gosa-core/include/class_tabs.inc +++ b/gosa-core/include/class_tabs.inc @@ -38,12 +38,16 @@ class tabs var $multiple_support_active = FALSE; var $read_only = FALSE; // Used when the entry is opened as "readonly" due to locks. - - function tabs(&$config, $data, $dn, $acl_category= "") + var $hide_refs = FALSE; + var $hide_acls = FALSE; + + function tabs(&$config, $data, $dn, $acl_category= "", $hide_refs = FALSE, $hide_acls = FALSE) { /* Save dn */ $this->dn= $dn; $this->config= &$config; + $this->hide_refs = $hide_refs; + $this->hide_acls = $hide_acls; if(!count($data)) { $data[] = array("CLASS" => 'plugin',"NAME" => 'Error'); @@ -388,12 +392,16 @@ class tabs function addSpecialTabs() { - $this->by_name['acl']= _("ACL"); - $this->by_object['acl']= new acl($this->config, $this, $this->dn); - $this->by_object['acl']->parent= &$this; - $this->by_name['reference']= _("References"); - $this->by_object['reference']= new reference($this->config, $this->dn); - $this->by_object['reference']->parent= &$this; + if(!$this->hide_acls){ + $this->by_name['acl']= _("ACL"); + $this->by_object['acl']= new acl($this->config, $this, $this->dn); + $this->by_object['acl']->parent= &$this; + } + if(!$this->hide_refs){ + $this->by_name['reference']= _("References"); + $this->by_object['reference']= new reference($this->config, $this->dn); + $this->by_object['reference']->parent= &$this; + } } diff --git a/gosa-core/plugins/admin/departments/tabs_department.inc b/gosa-core/plugins/admin/departments/tabs_department.inc index 208fb40a0..5ec88b675 100644 --- a/gosa-core/plugins/admin/departments/tabs_department.inc +++ b/gosa-core/plugins/admin/departments/tabs_department.inc @@ -26,9 +26,9 @@ class deptabs extends tabs var $moved = FALSE; var $base_name = "department"; - function deptabs($config, $data, $dn,$category) + function deptabs($config, $data, $dn,$category,$hide_refs = FALSE, $hide_acls = FALSE) { - tabs::tabs($config, $data, $dn,$category); + tabs::tabs($config, $data, $dn,$category,$hide_refs, $hide_acls); /* Detect the base class (The classs which extends from department) */ diff --git a/gosa-core/plugins/admin/groups/tabs_group.inc b/gosa-core/plugins/admin/groups/tabs_group.inc index 310e84e30..444c85237 100644 --- a/gosa-core/plugins/admin/groups/tabs_group.inc +++ b/gosa-core/plugins/admin/groups/tabs_group.inc @@ -23,9 +23,9 @@ class grouptabs extends tabs { - function grouptabs($config, $data, $dn) + function grouptabs($config, $data, $dn, $cat = "", $hide_refs = FALSE, $hide_acls = FALSE) { - tabs::tabs($config, $data, $dn,"groups"); + tabs::tabs($config, $data, $dn,"groups", $hide_refs, $hide_acls); $this->addSpecialTabs(); } diff --git a/gosa-core/plugins/admin/ogroups/tabs_ogroups.inc b/gosa-core/plugins/admin/ogroups/tabs_ogroups.inc index f70d3c374..bea1067d8 100644 --- a/gosa-core/plugins/admin/ogroups/tabs_ogroups.inc +++ b/gosa-core/plugins/admin/ogroups/tabs_ogroups.inc @@ -291,10 +291,10 @@ class ogrouptabs extends tabs return ( $str); } - function ogrouptabs($config, $data, $dn,$category ="ogroups") + function ogrouptabs($config, $data, $dn,$category ="ogroups",$hide_refs = FALSE, $hide_acls = FALSE) { - tabs::tabs($config, $data, $dn, $category); + tabs::tabs($config, $data, $dn, $category,$hide_refs, $hide_acls); $this->base= $this->by_object['ogroup']->base; $this->acl_category = $category; diff --git a/gosa-core/plugins/admin/users/tabs_user.inc b/gosa-core/plugins/admin/users/tabs_user.inc index 0f95ed901..aab4106c6 100644 --- a/gosa-core/plugins/admin/users/tabs_user.inc +++ b/gosa-core/plugins/admin/users/tabs_user.inc @@ -30,9 +30,9 @@ class usertabs extends tabs var $givenName = ""; var $sn; - function usertabs($config, $data, $dn) + function usertabs($config, $data, $dn, $cat = "", $hide_refs = FALSE, $hide_acls = FALSE) { - tabs::tabs($config, $data, $dn, 'users'); + tabs::tabs($config, $data, $dn, 'users',$hide_refs, $hide_acls); $this->base= $this->by_object['user']->base; $this->uid = &$this->by_object['user']->uid; diff --git a/gosa-plugins/goto/admin/applications/tabs_application.inc b/gosa-plugins/goto/admin/applications/tabs_application.inc index 4be68a07b..21891310a 100644 --- a/gosa-plugins/goto/admin/applications/tabs_application.inc +++ b/gosa-plugins/goto/admin/applications/tabs_application.inc @@ -5,9 +5,9 @@ class apptabs extends tabs var $parent = FALSE; var $FAIstate = ""; - function apptabs($config, $data, $dn,$category) + function apptabs($config, $data, $dn,$category,$hide_refs = FALSE, $hide_acls = FALSE) { - tabs::tabs($config, $data, $dn,$category); + tabs::tabs($config, $data, $dn,$category,$hide_refs, $hide_acls); /* Add references/acls/snapshots */ $this->addSpecialTabs(); diff --git a/gosa-plugins/goto/admin/devices/tabs_devices.inc b/gosa-plugins/goto/admin/devices/tabs_devices.inc index f6664a16f..e2b497993 100644 --- a/gosa-plugins/goto/admin/devices/tabs_devices.inc +++ b/gosa-plugins/goto/admin/devices/tabs_devices.inc @@ -4,9 +4,9 @@ class devicetabs extends tabs { var $Release= ""; - function devicetabs($config, $data, $dn,$category) + function devicetabs($config, $data, $dn,$category,$hide_refs = FALSE, $hide_acls = FALSE) { - tabs::tabs($config, $data, $dn,$category); + tabs::tabs($config, $data, $dn,$category,$hide_refs, $hide_acls); /* Add references/acls/snapshots */ $this->addSpecialTabs(); diff --git a/gosa-plugins/goto/admin/mimetypes/tabs_mimetypes.inc b/gosa-plugins/goto/admin/mimetypes/tabs_mimetypes.inc index efc06be71..dacda4486 100644 --- a/gosa-plugins/goto/admin/mimetypes/tabs_mimetypes.inc +++ b/gosa-plugins/goto/admin/mimetypes/tabs_mimetypes.inc @@ -5,9 +5,9 @@ class mimetabs extends tabs var $parent = FALSE; var $FAIstate = ""; - function mimetabs($config, $data, $dn,$category) + function mimetabs($config, $data, $dn,$category,$hide_refs = FALSE, $hide_acls = FALSE) { - tabs::tabs($config, $data, $dn,$category); + tabs::tabs($config, $data, $dn,$category,$hide_refs , $hide_acls); /* Add references/acls/snapshots */ $this->addSpecialTabs(); diff --git a/gosa-plugins/goto/admin/systems/goto/tabs_printers.inc b/gosa-plugins/goto/admin/systems/goto/tabs_printers.inc index 5b8eb259d..8ab23c8d3 100644 --- a/gosa-plugins/goto/admin/systems/goto/tabs_printers.inc +++ b/gosa-plugins/goto/admin/systems/goto/tabs_printers.inc @@ -3,13 +3,17 @@ class printtabs extends tabs { - function printtabs($config, $data, $dn,$category) + function printtabs($config, $data, $dn,$category,$hide_refs = FALSE, $hide_acls = FALSE) { /* Save dn */ $this->dn= $dn; $this->config= $config; + $this->hide_acls = $hide_acls; + $this->hide_refs = $hide_refs; + + $baseobject= NULL; foreach ($data as $tab){ diff --git a/gosa-plugins/goto/admin/systems/goto/tabs_terminal.inc b/gosa-plugins/goto/admin/systems/goto/tabs_terminal.inc index 266566c2c..95457217a 100644 --- a/gosa-plugins/goto/admin/systems/goto/tabs_terminal.inc +++ b/gosa-plugins/goto/admin/systems/goto/tabs_terminal.inc @@ -4,12 +4,15 @@ class termtabs extends tabs { public $was_activated = FALSE; - function termtabs($config, $data, $dn, $category) + function termtabs($config, $data, $dn, $category,$hide_refs = FALSE, $hide_acls = FALSE) { /* Save dn */ $this->dn= $dn; $this->config= $config; + $this->hide_refs = $hide_refs; + $this->hide_acls = $hide_acls; + $baseobject= NULL; foreach ($data as $tab){ diff --git a/gosa-plugins/goto/admin/systems/goto/tabs_workstation.inc b/gosa-plugins/goto/admin/systems/goto/tabs_workstation.inc index a84b5fcb9..5086602cf 100644 --- a/gosa-plugins/goto/admin/systems/goto/tabs_workstation.inc +++ b/gosa-plugins/goto/admin/systems/goto/tabs_workstation.inc @@ -5,13 +5,16 @@ class worktabs extends tabs public $was_activated = FALSE; - function worktabs($config, $data, $dn,$category) + function worktabs($config, $data, $dn,$category,$hide_refs = FALSE, $hide_acls = FALSE) { /* Save dn */ $this->dn= $dn; $this->config= $config; + $this->hide_refs = $hide_refs; + $this->hide_acls = $hide_acls; + $baseobject= NULL; foreach ($data as $tab){ diff --git a/gosa-plugins/roleManagement/admin/roleManagement/tabs_roles.inc b/gosa-plugins/roleManagement/admin/roleManagement/tabs_roles.inc index e0c64754a..59bd541ab 100644 --- a/gosa-plugins/roleManagement/admin/roleManagement/tabs_roles.inc +++ b/gosa-plugins/roleManagement/admin/roleManagement/tabs_roles.inc @@ -23,9 +23,9 @@ class roletabs extends tabs { - function __construct($config, $data, $dn) + function __construct($config, $data, $dn,$hide_refs = FALSE, $hide_acls = FALSE) { - tabs::tabs($config, $data, $dn,"roles"); + tabs::tabs($config, $data, $dn,"roles",$hide_refs, $hide_acls); $this->base = $baseobject= $this->by_object['roleGeneric']->base; $this->addSpecialTabs(); } diff --git a/gosa-plugins/samba/admin/systems/samba/tabs_winstation.inc b/gosa-plugins/samba/admin/systems/samba/tabs_winstation.inc index a1dc10ed8..7a6d7ebe4 100644 --- a/gosa-plugins/samba/admin/systems/samba/tabs_winstation.inc +++ b/gosa-plugins/samba/admin/systems/samba/tabs_winstation.inc @@ -3,9 +3,9 @@ class wintabs extends tabs { - function wintabs($config, $data, $dn,$category) + function wintabs($config, $data, $dn,$category,$hide_refs = FALSE, $hide_acls = FALSE) { - tabs::tabs($config, $data, $dn,$category); + tabs::tabs($config, $data, $dn,$category,$hide_refs , $hide_acls); /* Add references/acls/snapshots */ $this->addSpecialTabs(); diff --git a/gosa-plugins/systems/admin/systems/tabs_component.inc b/gosa-plugins/systems/admin/systems/tabs_component.inc index dc0d743b0..5dfc787cc 100644 --- a/gosa-plugins/systems/admin/systems/tabs_component.inc +++ b/gosa-plugins/systems/admin/systems/tabs_component.inc @@ -23,9 +23,9 @@ class componenttabs extends tabs { - function componenttabs($config, $data, $dn,$category) + function componenttabs($config, $data, $dn,$category,$hide_refs = FALSE, $hide_acls = FALSE) { - tabs::tabs($config, $data, $dn,$category); + tabs::tabs($config, $data, $dn,$category,$hide_refs, $hide_acls); /* Add references/acls/snapshots */ $this->addSpecialTabs(); diff --git a/gosa-plugins/systems/admin/systems/tabs_server.inc b/gosa-plugins/systems/admin/systems/tabs_server.inc index 39c030953..af7da365f 100644 --- a/gosa-plugins/systems/admin/systems/tabs_server.inc +++ b/gosa-plugins/systems/admin/systems/tabs_server.inc @@ -24,12 +24,15 @@ class servtabs extends tabs { public $was_activated = FALSE; - function servtabs($config, $data, $dn,$category) + function servtabs($config, $data, $dn,$category,$hide_refs = FALSE, $hide_acls = FALSE) { /* Save dn */ $this->dn= $dn; $this->config= $config; + $this->hide_acls = $hide_acls; + $this->hide_refs = $hide_refs; + $baseobject= NULL; foreach ($data as $tab){