Code

Added new resolution type 'auto''
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 28 Feb 2006 09:59:29 +0000 (09:59 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 28 Feb 2006 09:59:29 +0000 (09:59 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2763 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/environment/class_environment.inc
plugins/personal/environment/environment.tpl

index adfd3495e977e0c24d35328e42adef068b7d0747..3b347e70b3848b9493dd2909671af87031b2285a 100644 (file)
@@ -28,7 +28,7 @@ class environment extends plugin
   var $gotoProfileFlags   = "";     // Flags enabled  ? only used to set ACL and save 
   var $gotoProfileFlag_C  = "";     // Flag is set to C if we have the profile caching fucntion enabled 
   
-  var $gotoXResolution    = "1024x768";     // The selected resolution eg: 1024x768
+  var $gotoXResolution    = "auto";     // The selected resolution eg: 1024x768
   var $gotoXResolutions   = array();// Contains all available resolutions for this account
   var $gotoProfileFlag_L  = "";     // Flag is set to L to enable runtime resolution change 
   var $gotoProfileQuota   = "";     // User Quota Settings
@@ -376,9 +376,16 @@ class environment extends plugin
       $smarty->assign("gotoProfileFlag_CCHK"," checked ");
     }
 
-    $this->gotoXResolutions = array("640x480","800x600","1024x768","1280x768","1280x1024");
+    $this->gotoXResolutions = array("auto"=>_("auto"),
+                                    "640x480"   =>  "640x480",
+                                    "800x600"   =>  "800x600",
+                                    "1024x768"  =>  "1024x768",
+                                    "1280x768"  =>  "1280x768",
+                                    "1280x1024" =>  "1280x1024");
+
+    $smarty->assign("gotoXResolutions"    , $this->gotoXResolutions);
+    $smarty->assign("gotoXResolutionKeys" , array_flip($this->gotoXResolutions));
 
-    $smarty->assign("gotoXResolutions",$this->gotoXResolutions);
     $smarty->assign("gotoProfileServers",$this->gotoProfileServers);
     if(!is_array($this->gotoProfileServers)){
       $this->gotoProfileServers =array();
@@ -676,8 +683,8 @@ class environment extends plugin
     plugin::remove_from_parent();
 
     /* Don't save our template variables */
-    $skip = array("uid",
-                  "gotoLogonScripts","gotoPrinter","gotoShares","gotoKioskProfiles","gotoHotplugDevices" );
+    $skip = array("uid","gotoLogonScripts","gotoPrinter","gotoShares","gotoKioskProfiles","gotoHotplugDevices" );
+
     /* Skip all these attributes */
     foreach($skip as $del){
       unset($this->attrs[$del]);
@@ -687,7 +694,7 @@ class environment extends plugin
 
     $ldap->cd($this->dn);
     $this->cleanup();
-$ldap->modify ($this->attrs); 
+    $ldap->modify ($this->attrs); 
 
 
     show_ldap_error($ldap->get_error());
@@ -978,8 +985,9 @@ $ldap->modify ($attrs);
     }
 
 
+    if($this->gotoXResolution == "auto") $this->gotoXResolution ="";
     $saveThis = array("gotoProfileQuota","gotoXResolution","gotoProfileServer","gotoKioskProfile");
-  
+     
     foreach($saveThis as $tosave){
       if(!empty($this->$tosave)){
         $this->attrs[$tosave]=$this->$tosave;
index bfc1bc0f68b745039b0636c91bce72b35347fdb7..cb0071a4ed3e16529a21b51c9b95c6563d508268 100644 (file)
@@ -87,7 +87,7 @@
                                        </td>
                                        <td>
                                                <select name="gotoXResolution" {$gotoXResolutionACL} id="gotoXResolution">
-                               {html_options values=$gotoXResolutions output=$gotoXResolutions selected=$gotoXResolution}
+                               {html_options values=$gotoXResolutionKeys output=$gotoXResolutions selected=$gotoXResolution}
                             <option disabled>&nbsp;</option>
                        </select>
                                        </td>