From: hickert Date: Tue, 26 Oct 2010 07:03:59 +0000 (+0000) Subject: Updated base and item selector X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5fa9fb9cc9f55963a2df1ae896c3bd1a35584d49;p=gosa.git Updated base and item selector git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20144 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_ItemSelector.inc b/gosa-core/include/class_ItemSelector.inc index f8e5fad9a..55b808691 100644 --- a/gosa-core/include/class_ItemSelector.inc +++ b/gosa-core/include/class_ItemSelector.inc @@ -33,7 +33,7 @@ class ItemSelector { public $releaseInfo; public $releaseBase; - function __construct($bases, $base, $releaseBase) + function __construct($bases = array(), $base = "", $releaseBase = "") { // Initialize pid $this->pid= preg_replace("/[^0-9]/", "", microtime(TRUE)); @@ -123,8 +123,8 @@ class ItemSelector { } // Save bases to session for autocompletion - session::global_set('pathMapping', $this->pathMapping); - session::global_set('department_info', $this->releaseInfo); + session::global_set("pathMapping_{$this->pid}", $this->pathMapping); + session::global_set("department_info_{$this->pid}", $this->releaseInfo); } @@ -136,8 +136,9 @@ class ItemSelector { $this->action= null; $last_base= $this->base; if(isset($_REQUEST["BPID_{$this->pid}"]) && $_REQUEST["BPID_{$this->pid}"] == $this->pid) { - if (isset($_POST['bs_rebase_'.$this->pid]) && !empty($_POST['bs_rebase_'.$this->pid])) { + if (isset($_POST['bs_rebase_'.$this->pid])) { $new_base= base64_decode(get_post('bs_rebase_'.$this->pid)); + if (isset($this->pathMapping[$new_base])) { $this->base= $new_base; $this->action= 'rebase'; @@ -180,25 +181,36 @@ class ItemSelector { $initialValue = $this->pathMapping[$this->base]; } - $this->tree= "tree= " + + pid}').hide(); \" onfocus=\" \$('bs_{$this->pid}').hide(); \" - onmouseover=\" mouseIsStillOver = true; - function showIt() - { - if(mouseIsStillOver){ - \$('bs_".$this->pid."').show(); - } - }; - Element.clonePosition(\$('bs_".$this->pid."'), - 'bs_input_".$this->pid."', - {setHeight: false, setWidth: false, offsetTop:(Element.getHeight('bs_input_".$this->pid."'))}); - rtimer=showIt.delay(0.25); \" - - onmouseout=\" mouseIsStillOver=false; - rtimer=Element.hide.delay(0.25,'bs_".$this->pid."')\" + onmouseover=\" + mouseIsStillOver = true; + function showIt() + { + if(mouseIsStillOver){ + \$('bs_".$this->pid."').show(); + } + }; + + Element.clonePosition( + \$('bs_".$this->pid."'), + 'bs_input_".$this->pid."', + { + setHeight: false, + setWidth: false, + offsetTop:(Element.getHeight('bs_input_".$this->pid."')) + }); + rtimer=showIt.delay(0.25); \" + + onmouseout=\" + mouseIsStillOver=false; + rtimer=Element.hide.delay(0.25,'bs_".$this->pid."')\" value=\"".preg_replace('/"/','"',$initialValue)."\">"; @@ -206,29 +218,41 @@ class ItemSelector { $this->tree.= "
". ""; + $this->tree.= "
pid."')\"> +