summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cf6c5dd)
raw | patch | inline | side by side (parent: cf6c5dd)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 8 May 2006 09:27:54 +0000 (09:27 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 8 May 2006 09:27:54 +0000 (09:27 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3216 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_printerPPDDialog.inc | patch | blob | history |
diff --git a/plugins/admin/systems/class_printerPPDDialog.inc b/plugins/admin/systems/class_printerPPDDialog.inc
index 7f46699647efc04b2a4d2d58499f21d481c5d3c2..7d862b121843a127b7024a022423f1acd92b074c 100644 (file)
/* attribute list for save action */
var $ignore_account = TRUE;
- var $attributes = array();
+ var $attributes = array("cn");
var $objectclasses = array("whatever");
var $ppdList = array(); // Contains all Printer models
var $ppdConfig = false; // $this->ppdManager->loadProperties($this->selectedPPD['link']);
var $pathToPPD = "";
+ var $cn;
function printerPPDDialog ($config, $dn= NULL,$ppdfile=NULL )
{
}
}// Foreach
if(!$found){
- $ppdname = $vendor."/".$vendor."-".preg_replace("/^[^ ]/","",str_replace("-","",$model)).".ppd";
- $filename = $this->pathToPPD.$vendor."/".$vendor."-".preg_replace("/^[^ ]/","",str_replace("-","",$model)).".ppd";
- $fp = @fopen($filename,"w+");
+ $printerName = $this->cn."-".$vendor."-".preg_replace("/^[^ ]/","",str_replace("-","",$model));
+ $ppdname = $vendor."/".$printerName.".ppd";
+ $filename = $this->pathToPPD.$ppdname;
+ $fp = fopen($filename,"w+");
if(!$fp){
print_red(sprintf(_("Can't save file '%s'."),$filename));
}else{
fputs($fp,$str);
@fclose($fp);
+ $this->ppdManager->updateAttribute($filename,"NO_SECTION","ModelName",$printerName);
+
$tmp2= split("\n", $res);
- $tmp3['name'] =preg_replace("/^ -/","",$tmp2[1]);
+ $tmp3['name'] =preg_replace("/ */","",preg_replace("/^ -/","",$tmp2[1]));
$tmp3['link'] =$ppdname;
$tmp3['ppd'] =$res;
if(($type == "PickOne")||(($type=="Boolean")&&(count($values)>1))){
$str .= "<select name='".base64_encode($name)."'>\n";
- foreach($values as $value){
+ foreach($values as $optionKey => $value){
$selected = "";
if($value == $default){
$selected = " selected ";
}
- $str .= "<option value='".$value."' ".$selected.">".$value."</option>\n";
+ $str .= "<option value='".$optionKey."' ".$selected.">".$value."</option>\n";
}
$str .= "</select>\n";