[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= "") { // Initialize pid $this->pid= preg_replace("/[^0-9]/", "", microtime(TRUE)); // Transfer data $this->setBases($bases); $this->setBase($base); $this->update(); } function setBase($base) { if (isset($this->pathMapping[$base])) { $this->base= $base; } else { die("Invalid base selected"); } } function setBases($bases) { global $config; $this->pathMapping= array(); $selected= $this->base == $config->current['BASE']?"Selected":""; $first= true; $last_indent= 2; foreach ($bases as $base => $dummy) { // Build path style display $elements= explode(',', substr($base, 0, strlen($base) - strlen($config->current['BASE']))); $elements= array_reverse($elements, true); $this->pathMapping[$base]= $base == $config->current['BASE']? '/' : ldap::fix(preg_replace('/(^|,)[a-z0-9]+=/i', '/', implode(',', $elements))); } // Save bases to session for autocompletion session::global_set('pathMapping', $this->pathMapping); } function update() { 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]."'>"; $selected= $this->base == $config->current['BASE']?"Selected":""; $this->tree.= "\n"; } function render() { $result= ""; return $this->tree; } function getBase() { return $this->base; } function getAction() { // Do not do anything if this is not our PID, or there's even no PID available... #if(!isset($_REQUEST['PID']) || $_REQUEST['PID'] != $this->pid) { # return; #} } } ?>