From: hickert Date: Fri, 15 Dec 2006 09:49:34 +0000 (+0000) Subject: Added navigation gray out if option is not available X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8d25a981707ac7e708aca0ed6216c5379a1228f8;hp=8a4f4aecde582cb15b1861df74f6e86e36f69580;p=gosa.git Added navigation gray out if option is not available git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5409 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/html/images/list_back_gray.png b/html/images/list_back_gray.png new file mode 100644 index 000000000..df2e987b4 Binary files /dev/null and b/html/images/list_back_gray.png differ diff --git a/html/images/list_home_gray.png b/html/images/list_home_gray.png new file mode 100644 index 000000000..9fb42ffe5 Binary files /dev/null and b/html/images/list_home_gray.png differ diff --git a/html/images/list_root_gray.png b/html/images/list_root_gray.png new file mode 100644 index 000000000..9dffb4e99 Binary files /dev/null and b/html/images/list_root_gray.png differ diff --git a/include/class_MultiSelectWindow.inc b/include/class_MultiSelectWindow.inc index 581986e51..105f6ab7d 100644 --- a/include/class_MultiSelectWindow.inc +++ b/include/class_MultiSelectWindow.inc @@ -153,6 +153,68 @@ class MultiSelectWindow{ $this->array_Elements[] = $arr; } + + function get_default_header() + { + $enable_back = TRUE; + $enable_root = TRUE; + $enable_home = TRUE; + + $ui = get_userinfo(); + + /* Check if selectedBase = first available base */ + $deps = array(); + foreach($this->config->departments as $dep){ + $deps[] = $dep; + } + + + if(!count($deps) || $deps[0] == $this->selectedBase){ + $enable_back = FALSE; + $enable_root = FALSE; + } + + /* Check if we are in users home department */ + if(!count($deps) ||$this->selectedBase == get_base_from_people($ui->dn)){ + $enable_home = FALSE; + } + + /* Create header with selected base */ + $listhead = "
"; + + /* Draw root button */ + if($enable_root){ + $listhead .= "  "; + }else{ + $listhead .= " "._("Root")." "; + } + + /* Draw back button */ + if($enable_back){ + $listhead .= "  "; + }else{ + $listhead .= " "._("Up")." "; + } + + /* Draw home button */ + if($enable_home){ + $listhead .= "  "; + }else{ + $listhead .= " "._("Home")." "; + } + + /* And at least draw reload button, this button is enabled everytime */ + $listhead .= "  ". + " - "; + + return ($listhead); + } + + /* Add a checkbox to the filter element, the name specifies an existing class var to store the 'selection' */ function AddCheckBox($name,$value="Unset",$string="Unset",$default=false) diff --git a/plugins/admin/applications/class_divListApplication.inc b/plugins/admin/applications/class_divListApplication.inc index 56a4b0f5a..834b097e9 100755 --- a/plugins/admin/applications/class_divListApplication.inc +++ b/plugins/admin/applications/class_divListApplication.inc @@ -84,20 +84,9 @@ class divListApplication extends MultiSelectWindow $Copy_Paste =""; } - /* Create listhead, it will be shown on top of the divlist. - * It provides general navigation and object creation - */ - $listhead = "
". - "  ". - "  ". - "  ". - "  ". - "  ". - "  ". $Copy_Paste. "  ". diff --git a/plugins/admin/departments/class_divListDepartment.inc b/plugins/admin/departments/class_divListDepartment.inc index 4eaea028b..fb3148b99 100755 --- a/plugins/admin/departments/class_divListDepartment.inc +++ b/plugins/admin/departments/class_divListDepartment.inc @@ -64,18 +64,15 @@ class divListDepartment extends MultiSelectWindow } } - /* Generate list head */ - $listhead = "
". - "  ". - "  ". - "  ". - "  ". - "  ". - "   ". - "  ". - _("Base")." ". - "  ". - "
"; + /* Add default header */ + $listhead = MultiSelectWindow::get_default_header(); + $listhead.="   ". + "  ". + _("Base")." ". + "  ". + "
"; $this->SetListHeader($listhead); } diff --git a/plugins/admin/fai/class_divListFai.inc b/plugins/admin/fai/class_divListFai.inc index 3f8f520a8..0a51b32d8 100644 --- a/plugins/admin/fai/class_divListFai.inc +++ b/plugins/admin/fai/class_divListFai.inc @@ -111,27 +111,9 @@ class divListFai extends MultiSelectWindow $Copy_Paste =""; } - /* Create listhead, it will be shown on top of the divlist. - * It provides general navigation and object creation - */ - $listhead = - "
 ". - - " ". - - " ". - - " ". - - "  ". - - "\"\" ". - - "  ". "\"\" ". diff --git a/plugins/admin/groups/class_divListGroup.inc b/plugins/admin/groups/class_divListGroup.inc index f8139ab58..b2feee42e 100644 --- a/plugins/admin/groups/class_divListGroup.inc +++ b/plugins/admin/groups/class_divListGroup.inc @@ -87,20 +87,15 @@ class divListGroup extends MultiSelectWindow $Copy_Paste =""; } - // Managment - $listhead = " -
". - "  ". - "  ". - "  ". - "  ". - "  ". - "  ". + /* Add default header */ + $listhead = MultiSelectWindow::get_default_header(); + $listhead.= "  ". $Copy_Paste. "  ". _("Base")." ". - "  ". + "  ". "
"; $this->SetListHeader($listhead); diff --git a/plugins/admin/ogroups/class_divListOGroup.inc b/plugins/admin/ogroups/class_divListOGroup.inc index 9fc480e26..a40237fac 100755 --- a/plugins/admin/ogroups/class_divListOGroup.inc +++ b/plugins/admin/ogroups/class_divListOGroup.inc @@ -93,18 +93,9 @@ class divListOGroup extends MultiSelectWindow $Copy_Paste =""; } - // Managment - $listhead = "
". - "  ". - "  ". - "  ". - "  ". - "  ". - " ". $Copy_Paste. "  ". diff --git a/plugins/admin/systems/class_divListSystem.inc b/plugins/admin/systems/class_divListSystem.inc index 6353c3e4b..9d732b212 100644 --- a/plugins/admin/systems/class_divListSystem.inc +++ b/plugins/admin/systems/class_divListSystem.inc @@ -88,16 +88,10 @@ class divListSystem extends MultiSelectWindow $options.= ""; } } - $listhead = "
". - "  ". - "  ". - "  ". - "  ". - "  ". - " ". " ". diff --git a/plugins/admin/users/class_divListUsers.inc b/plugins/admin/users/class_divListUsers.inc index e63142f8a..722760672 100644 --- a/plugins/admin/users/class_divListUsers.inc +++ b/plugins/admin/users/class_divListUsers.inc @@ -87,18 +87,10 @@ class divListUsers extends MultiSelectWindow $Copy_Paste =""; } - /* Create header with selected base */ - $listhead = "
". - "  ". - "  ". - "  ". - "  ". - "  ". - "  ". "  ". diff --git a/plugins/gofax/blocklists/class_divListBlocklists.inc b/plugins/gofax/blocklists/class_divListBlocklists.inc index 42e884dc2..745d9b50e 100755 --- a/plugins/gofax/blocklists/class_divListBlocklists.inc +++ b/plugins/gofax/blocklists/class_divListBlocklists.inc @@ -71,18 +71,9 @@ class divListBlocklist extends MultiSelectWindow } } - /* NEW LIST MANAGMENT */ - $listhead = "
". - "  ". - "  ". - "  ". - "  ". - "  ". - "  ". " ". " "._("Base")." ". diff --git a/plugins/gofon/conference/class_divListConferences.inc b/plugins/gofon/conference/class_divListConferences.inc index 18ee1f7a5..82e74f5bc 100755 --- a/plugins/gofon/conference/class_divListConferences.inc +++ b/plugins/gofon/conference/class_divListConferences.inc @@ -69,18 +69,9 @@ class divListConference extends MultiSelectWindow } } - /* NEW LIST MANAGMENT */ - $listhead = "
". - "  ". - "  ". - "  ". - "  ". - "  ". - "  ". "  ". _("Base")." ". diff --git a/plugins/gofon/macro/class_divListMacros.inc b/plugins/gofon/macro/class_divListMacros.inc index 1ab12136f..3d14404e1 100755 --- a/plugins/gofon/macro/class_divListMacros.inc +++ b/plugins/gofon/macro/class_divListMacros.inc @@ -68,18 +68,9 @@ class divListMacro extends MultiSelectWindow } } - /* NEW LIST MANAGMENT */ - $listhead = "
". - "  ". - "  ". - "  ". - "  ". - "  ". - "  ". "  ". _("Base")." ".