Code

Added ! entries to list of shares. If we are not in group environemnt. ...
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 1 Jun 2006 08:09:21 +0000 (08:09 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 1 Jun 2006 08:09:21 +0000 (08:09 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3600 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/environment/class_environment.inc

index 60eb816b96198d73dbab11d420efcc545ccc026a..4c87bf17c85be07f5cd7604ab7e3e8ddf67eb9d6 100644 (file)
@@ -578,19 +578,34 @@ class environment extends plugin
     $tmp = $this->printOutAssignedShares();
     
     foreach($tmp as $key => $value){
-    
       $img = "";
+   
+      /* Check if entry starts with an ! */
+      if(preg_match("/^!/",$this->gotoShares[$key]['server'])){
 
-      if($this->gotoShares[$key]['PwdHash'] != ""){
-      $img.= "<input type='image' name='gotoShareResetPwd_".$key." 'src='images/list_reset_password.png' alt='"._("Reset password hash")."' 
-                title='"._("Reset password hash")."'>";
-      }
-      $img.= "&nbsp;";
-      $img.= "<input type='image' name='gotoShareDel_".$key." 'src='images/edittrash.png' alt='"._("Delete")."' 
-                title='"._("Delete share entry")."'>";
+        /* If we are currently editing groups environment, skip those ! entries */ 
+        if($this->is_group) continue;
+    
+        /* Create pwd reset images */
+        if($this->gotoShares[$key]['PwdHash'] != ""){
+          $img.= "<input type='image' name='gotoShareResetPwd_".$key." 'src='images/list_reset_password.png' alt='"._("Reset password hash")."' 
+            title='"._("Reset password hash")."'>";
+        }
+        $field1 = array("string" => "<font style=\"color:#C0C0C0\">".$value."</font>" );
+        $field2 = array("string" => $img   , "attach" => "style='border-right:0px;'");
+      }else{
 
-      $field1 = array("string" => $value);
-      $field2 = array("string" => $img   , "attach" => "style='border-right:0px;'");
+        /* Create pwd reset img && delete image */
+        if($this->gotoShares[$key]['PwdHash'] != ""){
+          $img.= "<input type='image' name='gotoShareResetPwd_".$key." 'src='images/list_reset_password.png' alt='"._("Reset password hash")."' 
+            title='"._("Reset password hash")."'>";
+          $img.= "&nbsp;";
+        }
+        $img.= "<input type='image' name='gotoShareDel_".$key." 'src='images/edittrash.png' alt='"._("Delete")."' 
+          title='"._("Delete share entry")."'>";
+        $field1 = array("string" => $value);
+        $field2 = array("string" => $img   , "attach" => "style='border-right:0px;'");
+      }
       $divlistShares->AddEntry(array($field1,$field2));
     }
     $smarty->assign("divlistShares",$divlistShares->DrawList());
@@ -1131,9 +1146,7 @@ $ldap->modify ($attrs);
     $a_return = array();
     if(is_array($this->gotoShares)){
       foreach($this->gotoShares as $share){
-        if (!preg_match('/^!/', $share['server'])){
-          $a_return[$share['name']."|".$share['server']]= $share['server']."://".$share['name']." on ".$share['mountPoint']." as ".$share['Username'];
-        }
+        $a_return[$share['name']."|".$share['server']]= preg_replace("/^!/","",$share['server'])."://".$share['name']." on ".$share['mountPoint']." as ".$share['Username'];
       }
     }
     return($a_return);