From 30f9f54c2904c325b77c4a6e4d01355ebee54a00 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 15 Sep 2011 07:52:48 +0000 Subject: [PATCH] Updated listing classes Backports from 2.7 git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.7@20984 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_ItemSelector.inc | 30 ++++++---- gosa-core/include/class_listing.inc | 30 +++++++++- gosa-core/include/class_sortableListing.inc | 63 +++++++++++++-------- 3 files changed, 86 insertions(+), 37 deletions(-) diff --git a/gosa-core/include/class_ItemSelector.inc b/gosa-core/include/class_ItemSelector.inc index f3eca4691..4b7d180b7 100644 --- a/gosa-core/include/class_ItemSelector.inc +++ b/gosa-core/include/class_ItemSelector.inc @@ -117,7 +117,7 @@ class ItemSelector { foreach ($bases as $path => $data) { // Build path style display - $this->pathMapping[$path]= $path == $this->releaseBase? '/' : $data['name']; + $this->pathMapping[$path]= preg_replace("/^".preg_quote($this->releaseBase,'/')."\/?/i", "/", $path); $this->releaseInfo[$path]['name'] = $data['name']; $this->releaseInfo[$path]['description'] = $data['desc']; } @@ -138,13 +138,14 @@ class ItemSelector { if(isset($_REQUEST["BPID_{$this->pid}"]) && $_REQUEST["BPID_{$this->pid}"] == $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'; - } else { - $this->lastState= false; - return false; + if($new_base){ + if (isset($this->pathMapping[$new_base])) { + $this->base= $new_base; + $this->action= 'rebase'; + } else { + $this->lastState= false; + return false; + } } }else{ // Input field set? @@ -234,6 +235,7 @@ class ItemSelector { });"; } $this->tree.= ""; + $selected= $this->base == $this->releaseBase?"Selected":""; $this->tree.= "
pid."')\"> + / ["._("Root")."]