X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fclass_baseSelector.inc;h=68dd3ca036630620cb822c31ef425b06a08aa96c;hb=1e99420f077c6595a6098da8b0685a852668852f;hp=ac62398db0eabcadba823fca6cebf41f2ef8bd15;hpb=05b1b86cf7628a526d3e74dee3d7dfe836b92cf5;p=gosa.git diff --git a/gosa-core/include/class_baseSelector.inc b/gosa-core/include/class_baseSelector.inc index ac62398db..68dd3ca03 100644 --- a/gosa-core/include/class_baseSelector.inc +++ b/gosa-core/include/class_baseSelector.inc @@ -29,15 +29,8 @@ class baseSelector { private $submitButton= true; protected $tree; protected $pathMapping; + protected $lastState; - // It would be better to get a dn -> [name, description, type] array - // to avoid these tasks be done several times. Skipping for the moment. - #'dc' => 'plugins/departments/images/domain.png', - #'dc' => 'plugins/departments/images/dc.png', - #'l' => 'plugins/departments/images/locality.png', - #'c' => 'plugins/departments/images/country.png', - #'o' => 'plugins/departments/images/organization.png', - #'ou' => 'plugins/departments/images/folder.png', function __construct($bases, $base= "") { @@ -77,6 +70,12 @@ class baseSelector { } + function checkLastBaseUpdate() + { + return $this->lastState; + } + + function setBases($bases) { global $config; @@ -97,6 +96,7 @@ class baseSelector { // Save bases to session for autocompletion session::global_set('pathMapping', $this->pathMapping); + session::global_set('department_info', $config->department_info); } @@ -114,22 +114,28 @@ class baseSelector { $this->base= $new_base; $this->action= 'rebase'; } else { + $this->lastState= false; return false; } - } - } elseif (isset($_POST['bs_input_'.$this->pid])) { - - // Take over input field base - if ($this->submitButton && isset($_POST['submit_base_'.$this->pid.'_x']) || !$this->submitButton) { - - // Check if base is available - foreach ($this->pathMapping as $key => $path) { - if (mb_strtolower($path) == mb_strtolower($_POST['bs_input_'.$this->pid])) { - $this->base= $key; - break; + }else{ + // Input field set? + if (isset($_POST['bs_input_'.$this->pid])) { + + // Take over input field base + if ($this->submitButton && isset($_POST['submit_base_'.$this->pid]) || !$this->submitButton) { + + // Check if base is available + $this->lastState= false; + foreach ($this->pathMapping as $key => $path) { + if (mb_strtolower($path) == mb_strtolower($_POST['bs_input_'.$this->pid])) { + $this->base= $key; + $this->lastState= true; + break; + } + } } } - } + } } @@ -151,7 +157,7 @@ class baseSelector { $this->tree.= ""; $selected= $this->base == $config->current['BASE']?"Selected":""; - $this->tree.= "