From: cajus Date: Thu, 28 Jan 2010 13:00:25 +0000 (+0000) Subject: Updated base selector X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4fb638983db1e8ea78211a0ecb9a64351f881520;p=gosa.git Updated base selector git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15415 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_baseSelector.inc b/gosa-core/include/class_baseSelector.inc index 28d0025c2..375fe207a 100644 --- a/gosa-core/include/class_baseSelector.inc +++ b/gosa-core/include/class_baseSelector.inc @@ -24,6 +24,7 @@ class baseSelector { private $base; private $pid; + private $action; protected $tree; protected $pathMapping; @@ -44,7 +45,6 @@ class baseSelector { // Transfer data $this->setBases($bases); $this->setBase($base); - $this->update(); } @@ -52,6 +52,7 @@ class baseSelector { { if (isset($this->pathMapping[$base])) { $this->base= $base; + $this->update(true); } else { die("Invalid base selected"); } @@ -81,13 +82,35 @@ class baseSelector { } - function update() + function update($force= false) { global $config; - $this->tree= "pid."').hide()\" onmouseover=\"\$('bs_".$this->pid."').show();pos = Element.positionedOffset('bs_input_".$this->pid."');\$('bs_".$this->pid."').setStyle({left: (pos[0]), top: (pos[1]+ Element.getHeight('bs_input_".$this->pid."'))});\" onmouseout=\"rtimer= Element.hide.delay(0.25, 'bs_".$this->pid."')\" value='".$this->pathMapping[$this->base]."'>"; + + // Analyze for base changes if needed + $this->action= null; + $last_base= $this->base; + if(isset($_REQUEST['PID']) && $_REQUEST['PID'] == $this->pid) { + if (isset($_REQUEST['REBASE'])) { + $new_base= base64_decode($_REQUEST['REBASE']); + if (isset($this->pathMapping[$new_base])) { + $this->base= $new_base; + $this->action= 'rebase'; + } else { + die ("Base mismatch!"); + } + } + } + + /* Skip if there's no change */ + if (($this->tree && $this->base == $last_base) && !$force) { + return; + } + + $link= "href='?plug=".$_GET['plug']."&PID=".$this->pid."&REBASE=".base64_encode($config->current['BASE'])."'"; + $this->tree= "pid."').hide()\" onmouseover=\"Element.clonePosition(\$('bs_".$this->pid."'), 'bs_input_".$this->pid."', {setHeight: false, setWidth: false, offsetTop:(Element.getHeight('bs_input_".$this->pid."'))});\$('bs_".$this->pid."').show();\" onmouseout=\"rtimer= Element.hide.delay(0.25, 'bs_".$this->pid."')\" value='".$this->pathMapping[$this->base]."'>"; $selected= $this->base == $config->current['BASE']?"Selected":""; - $this->tree.= "