From 1de98af55386a326af7dbf4932673a86d729bee4 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 28 Feb 2006 09:59:29 +0000 Subject: [PATCH] Added new resolution type 'auto'' git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2763 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../environment/class_environment.inc | 22 +++++++++++++------ plugins/personal/environment/environment.tpl | 2 +- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc index adfd3495e..3b347e70b 100644 --- a/plugins/personal/environment/class_environment.inc +++ b/plugins/personal/environment/class_environment.inc @@ -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; diff --git a/plugins/personal/environment/environment.tpl b/plugins/personal/environment/environment.tpl index bfc1bc0f6..cb0071a4e 100644 --- a/plugins/personal/environment/environment.tpl +++ b/plugins/personal/environment/environment.tpl @@ -87,7 +87,7 @@ -- 2.30.2