From: cajus Date: Fri, 14 Aug 2009 15:28:17 +0000 (+0000) Subject: Added navigation handling for list X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=81783f0b5138276fd921bfd7c050ea8bc6100c42;p=gosa.git Added navigation handling for list git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14070 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_listing.inc b/gosa-core/include/class_listing.inc index 0e34c9c17..f025a200c 100644 --- a/gosa-core/include/class_listing.inc +++ b/gosa-core/include/class_listing.inc @@ -232,6 +232,9 @@ echo "sorting, department browsing, copypaste handler, snapshot handler, daemon function update() { + global $config; + $ui= get_userinfo(); + // Do not do anything if this is not our PID # DISABLED because the object is not in the session #if(isset($_REQUEST['PID']) && $_REQUEST['PID'] != $this->pid) { @@ -250,6 +253,33 @@ echo "sorting, department browsing, copypaste handler, snapshot handler, daemon } } + // Override base if we got signals from the navigation elements + $action= ""; + foreach ($_POST as $key => $value) { + if (preg_match('/^(ROOT|BACK|HOME)_x$/', $key, $match)) { + $action= $match[1]; + break; + } + } + + // Navigation handling + if ($action == 'ROOT') { + $deps= $ui->get_module_departments($this->module); + $this->base= $deps[0]; + } + if ($action == 'BACK') { + $deps= $ui->get_module_departments($this->module); + $base= preg_replace("/^[^,]+,/", "", $this->base); + if(in_array_ics($base, $deps)){ + $this->base= $base; + } + } + if ($action == 'HOME') { + $ui= get_userinfo(); + $this->base= get_base_from_people($ui->dn); + } + + // Update filter and refresh entries $this->filter->setBase($this->base); $this->entries= $this->filter->query(); } @@ -576,7 +606,7 @@ echo "sorting, department browsing, copypaste handler, snapshot handler, daemon /* Draw root button */ if($enableRoot){ $result["ROOT"]= ""; + "title='"._("Go to root department")."' name='ROOT' alt='"._("Root")."'>"; }else{ $result["ROOT"]= ""._("Root").""; } @@ -584,7 +614,7 @@ echo "sorting, department browsing, copypaste handler, snapshot handler, daemon /* Draw back button */ if($enableBack){ $result["BACK"]= ""; + "title='"._("Go up one department")."' alt='"._("Up")."' name='BACK'>"; }else{ $result["BACK"]= ""._("Up").""; } @@ -592,14 +622,14 @@ echo "sorting, department browsing, copypaste handler, snapshot handler, daemon /* Draw home button */ if($enableHome){ $result["HOME"]= ""; + "title='"._("Go to users department")."' alt='"._("Home")."' name='HOME'>"; }else{ $result["HOME"]= ""._("Home").""; } /* Draw reload button, this button is enabled everytime */ $result["RELOAD"]= ""; + "title='"._("Reload list")."' name='REFRESH' alt='"._("Submit")."'>"; return ($result); }