Code

Updated Icon Menu
[gosa.git] / gosa-core / include / functions.inc
index a543c7cf6360bc2d166976ac08af65ef08776504..8609fab62e3f2236c7a81ea923b6bf1b1e3d5542 100644 (file)
@@ -120,7 +120,7 @@ $REWRITE= array( "รค" => "ae",
  *
  *  \param  string 'class_name' The currently requested class
  */
-function __autoload($class_name) {
+function __gosa_autoload($class_name) {
     global $class_mapping, $BASE_DIR;
 
     if ($class_mapping === NULL){
@@ -135,6 +135,7 @@ function __autoload($class_name) {
       exit;
     }
 }
+spl_autoload_register('__gosa_autoload');
 
 
 /*! \brief Checks if a class is available. 
@@ -3503,5 +3504,18 @@ function get_next_id_traditional($attrib, $dn)
 }
 
 
+/* Mark the occurance of a string with a span */
+function mark($needle, $haystack, $ignorecase= true)
+{
+  $result= "";
+
+  while (preg_match('/^(.*)('.preg_quote($needle).')(.*)$/i', $haystack, $matches)) {
+    $result.= $matches[1]."<span class='mark'>".$matches[2]."</span>";
+    $haystack= $matches[3];
+  }
+
+  return $result.$haystack;
+}
+
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>