From: hickert Date: Thu, 18 May 2006 11:16:36 +0000 (+0000) Subject: Added external resolution hook to environment X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=fe46c790be7e8ab8fba2dc6c12ac923fafba4dbf;p=gosa.git Added external resolution hook to environment git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3426 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc index 84d18ae86..a9630783a 100644 --- a/plugins/personal/environment/class_environment.inc +++ b/plugins/personal/environment/class_environment.inc @@ -180,6 +180,34 @@ class environment extends plugin $this->is_group = true; } + /* Set resolutions */ + $this->gotoXResolutions = array("auto"=>_("auto"), + "640x480" => "640x480", + "800x600" => "800x600", + "1024x768" => "1024x768", + "1154x864" => "1154x864", + "1280x768" => "1280x768", + "1280x1024" => "1280x1024"); + + if(isset($this->config->data['MAIN']['RESOLUTION_HOOK'])){ + $file = $this->config->data['MAIN']['RESOLUTION_HOOK']; + + if(is_readable($file)){ + $str = file_get_contents($file); + $lines = split("\n",$str); + foreach($lines as $line){ + $line = trim($line); + if(!empty($line)){ + $this->gotoXResolutions[$line]=$line; + } + } + //natcasesort($this->gotoXResolutions); + }else{ + print_red(sprintf(_("You have specified an external resolution hook which can't be read, please check the permission of the file '%s'."),$file)); + } + } + + $this->gotoProfileServers= $config->getShareServerList() ; $this->gotoShareSelections= $config->getShareList(true); $this->gotoAvailableShares= $config->getShareList(false); @@ -380,13 +408,6 @@ class environment extends plugin $smarty->assign("gotoProfileFlag_CCHK"," checked "); } - $this->gotoXResolutions = array("auto"=>_("auto"), - "640x480" => "640x480", - "800x600" => "800x600", - "1024x768" => "1024x768", - "1154x864" => "1154x864", - "1280x768" => "1280x768", - "1280x1024" => "1280x1024"); $smarty->assign("gotoXResolutions" , $this->gotoXResolutions); $smarty->assign("gotoXResolutionKeys" , array_flip($this->gotoXResolutions));