Code

Updated base selector
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 21 Sep 2010 10:02:27 +0000 (10:02 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 21 Sep 2010 10:02:27 +0000 (10:02 +0000)
-Display readable bases in the by_input_ fields

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19785 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_ldap.inc
gosa-core/include/utils/class_msgPool.inc

index 0d22eb19ebca11d556292ff48288bdf2ad6d2b16..9f6a52bc00e80adee7a4a3922218eb3cdf8ac644 100644 (file)
@@ -140,10 +140,12 @@ class LDAP
                     LDAP::$characterMapRegTo[] = addslashes($to);
 
                     // Append entry make readable array
+                    LDAP::$readableMapRegFrom[] = "/".preg_quote($to,'/')."/";
                     LDAP::$readableMapRegFrom[] = "/".preg_quote(stripslashes($to),'/')."/";
-                    LDAP::$readableMapRegTo[] = stripslashes($from);
                     LDAP::$readableMapRegFrom[] = "/".preg_quote(LDAP::convert($to),'/')."/";
                     LDAP::$readableMapRegTo[] = stripslashes($from);
+                    LDAP::$readableMapRegTo[] = stripslashes($from);
+                    LDAP::$readableMapRegTo[] = stripslashes($from);
                 }
             }else{
                 // To avoid querying a hundred times without any success, stop here.
@@ -156,12 +158,14 @@ class LDAP
     }
 
 
+    /*!  \brief     This methods replaces non-readable characters be readable ones, 
+     *               depends on what were detect in 'updateSpecialCharHandling'.
+     * @param       String  The DN/string to cleanup 
+     * @return      String  The readable string.
+     */
     static function makeReadable($dn)
     {
         if(LDAP::$characterMap === NULL) LDAP::updateSpecialCharHandling();
-
-        print_a(array(LDAP::$readableMapRegFrom,LDAP::$readableMapRegTo,$dn, preg_replace(LDAP::$readableMapRegFrom,LDAP::$readableMapRegTo,$dn)));
-
         return (preg_replace(LDAP::$readableMapRegFrom,LDAP::$readableMapRegTo,$dn));
     }
 
index 817c1b9117d90ff95ebc170f6875d9df0c1aa623..a981c44cca232725fb563fd3d9e22ed801bf91a3 100644 (file)
@@ -349,9 +349,9 @@ class msgPool
     $objects= "<ul class='object-list'>";
     foreach ($data as $key => $value){
       if (is_numeric($key)){
-        $objects.= "<li>\n$value</li>";
+        $objects.= "<li>\n".LDAP::makeReadable($value)."</li>";
       } else {
-        $objects.= "<li>\n$value <span>$key</span></li>";
+        $objects.= "<li>\n$value <span>".LDAP::makeReadable($key)."</span></li>";
       }
     }
     $objects.= "</ul>";