summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 98d4da0)
raw | patch | inline | side by side (parent: 98d4da0)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 27 Jan 2010 17:46:03 +0000 (17:46 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 27 Jan 2010 17:46:03 +0000 (17:46 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15393 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_baseSelector.inc | patch | blob | history |
index baea70e5fcc27eaec6b724b3adc670990a8d7d55..9ca0a429542758b63d761508c383eb411812e8f0 100644 (file)
{
$this->setBases($bases);
$this->setBase($base);
+ $this->update();
}
$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;
+
+ $selected= $this->base == $config->current['BASE']?"Selected":"";
+ $this->tree= "<div class='treeList'><a class='treeList$selected' href='#'>"._("Root")."</a><ul class='treeList'>\n";
+ $first= true;
+ $last_indent= 2;
+
+ foreach ($this->pathMapping as $base => $dummy) {
// Skip root for tree
if ($base == $config->current['BASE']) {
continue;
}
+ // Build path style display
+ $elements= explode(',', substr($base, 0, strlen($base) - strlen($config->current['BASE'])));
+
$indent= count($elements);
if (!$first && ($indent == $last_indent)) {
$this->tree.= "</li>\n";
$this->tree.= "</li>\n";
}
$selected= $this->base == $base?" class='treeListSelected'":"";
- $this->tree.= "<li$selected><a href='#'>".ldap::fix(preg_replace('/^[a-z0-9]+=([^,]+),.*$/i', '$1', $base))."</a>";
+ $this->tree.= "<li><a$selected href='#'>".ldap::fix(preg_replace('/^[a-z0-9]+=([^,]+),.*$/i', '$1', $base))."</a>";
$last_indent= $indent;
$first= false;
$this->tree.= "</div>\n";
echo $this->tree;
-
- // Save bases to session for autocompletion
- session::global_set('pathMapping', $this->pathMapping);
}
-
function render()
{
$result= "";
}
- function update()
- {
- echo "update";
- }
-
-
function getBase()
{
return $this->base;