summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1954f95)
raw | patch | inline | side by side (parent: 1954f95)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 12 Jan 2006 10:19:51 +0000 (10:19 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 12 Jan 2006 10:19:51 +0000 (10:19 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2457 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_workstationService.inc | patch | blob | history | |
plugins/admin/systems/workstationService.tpl | patch | blob | history |
diff --git a/plugins/admin/systems/class_workstationService.inc b/plugins/admin/systems/class_workstationService.inc
index dd41f8bc3d1a70065dd92b962a37876d8cde99ab..c80b799fba8e8fe22e1027895e2573d1265df4e1 100644 (file)
var $gotoXColordepth= "";
var $gotoXHsync= "";
var $gotoXVsync= "";
+ var $AutoSync = false;
var $gotoXKbModel= "";
var $gotoXKbLayout= "";
var $gotoXKbVariant= "";
}
}
+ if(preg_match("/\+/",$this->gotoXHsync)){
+ $this->AutoSync = true;
+ $this->gotoXHsync = preg_replace("/\+/","-",$this->gotoXHsync);
+ $this->gotoXVsync = preg_replace("/\+/","-",$this->gotoXVsync);
+ }
+
$this->hardware_list["automatic"]= _("automatic");
ksort($this->hardware_list);
}
$hl.= "</select>\n";
$smarty->assign ("hardware_list", $hl);
$smarty->assign ("gotoXMonitor", $this->gotoXMonitor);
+ $smarty->assign("AutoSyncACL",chkacl($this->acl,"AutoSync"));
+
+ if($this->AutoSync){
+ $smarty->assign("AutoSyncCHK"," checked ");
+ }else{
+ $smarty->assign("AutoSyncCHK"," ");
+ }
/* Show main page */
return($smarty->fetch (get_template_path('workstationService.tpl',TRUE,dirname(__FILE__))));
$this->handle_post_events("remove");
}
-
/* Save data to object */
function save_object()
{
plugin::save_object();
+ if(isset($_POST['gotoXHsync'])){
+ if(isset($_POST['AutoSync'])){
+ $this->AutoSync = true;
+ }else{
+ $this->AutoSync = false;
+ }
+ }
}
-
/* Check supplied data */
function check()
{
/* Check vsync for correct usage */
$val= preg_replace ("/\s/", "", $this->gotoXVsync);
- if (!preg_match ("/^\d+(\.\d+)?([-+]\d+(\.\d+)?)?$/", $val)
+ if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val)
&& chkacl ($this->acl, "gotoXVsync") == ""){
$message[]= _("Please specify a valid VSync range.");
/* Check hsync for correct usage */
$val= preg_replace ("/\s/", "", $this->gotoXHsync);
- if (!preg_match ("/^\d+(\.\d+)?([-+]\d+(\.\d+)?)?$/", $val)
+ if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val)
&& chkacl ($this->acl, "gotoXHsync") == ""){
$message[]= _("Please specify a valid HSync range.");
}
}
+ if($this->AutoSync){
+ $this->attrs['gotoXHsync'] = preg_replace("/-/","+",$this->attrs['gotoXHsync']) ;
+ $this->attrs['gotoXVsync'] = preg_replace("/-/","+",$this->attrs['gotoXVsync']) ;
+ }
+
/* Write back to ldap */
$ldap= $this->config->get_ldap_link();
$ldap->cd($this->dn);
diff --git a/plugins/admin/systems/workstationService.tpl b/plugins/admin/systems/workstationService.tpl
index 1cde8e980c88db651867b9f538b844ffdc5c61a0..3346fca5ff807cf3110d448a1bf40a30cbe4e906 100644 (file)
<table summary="">
<tr>
<td>{t}Type{/t}</td>
- <td>{$gotoXMonitor}</td>
+ <td>{if $gotoXMonitor==""}{t}unknown{/t}{/if}{$gotoXMonitor}</td>
+ </tr>
+ <tr>
+ <td><input type="checkbox" name="AutoSync" value="1" {$AutoSyncACL} {$AutoSyncCHK}>
+ </td>
+ <td>{t}Automatic modelines{/t}
+ </td>
</tr>
<tr>
<td><LABEL for="gotoXHsync">{t}HSync{/t}</LABEL></td>