X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fsystems%2Fclass_printerPPDDialog.inc;h=f30c50e5f4e3dbdd8fa912d81be6405c81f7e219;hb=5f1f63cbff1a76de561e6e556342179ace8ca24e;hp=a7458d53edfacfe4bc1e9f0ef9a654384c7fd93e;hpb=a7fc3c39e809cd45f2bc6ec46b554eff8b8679c8;p=gosa.git diff --git a/plugins/admin/systems/class_printerPPDDialog.inc b/plugins/admin/systems/class_printerPPDDialog.inc index a7458d53e..f30c50e5f 100644 --- a/plugins/admin/systems/class_printerPPDDialog.inc +++ b/plugins/admin/systems/class_printerPPDDialog.inc @@ -2,11 +2,6 @@ class printerPPDDialog extends plugin { - /* CLI vars */ - var $cli_summary = "Manage server basic objects"; - var $cli_description = "Some longer text\nfor help"; - var $cli_parameters = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - /* attribute list for save action */ var $ignore_account = TRUE; var $attributes = array("cn"); @@ -96,8 +91,7 @@ class printerPPDDialog extends plugin /* Check if path is write/readable*/ $is_r = @is_readable($path); if(((!is_dir($path))||(empty($path)) || (!$is_r)) && (!@mkdir($path))){ - print_red(sprintf(_("The specified path '%s' which results from PPD_PATH in your gosa.conf is invalid,". - " can't read/write any ppd informations."),$path)); + print_red(sprintf(_("The specified path '%s' which results from PPD_PATH in your gosa.conf is invalid, can't read/write any ppd informations."),$path)); /* Print out template */ $display.= $smarty->fetch(get_template_path('printerPPDDialog.tpl', TRUE,dirname(__FILE__))); return($display); @@ -423,7 +417,11 @@ class printerPPDDialog extends plugin /* Prepare data */ $values = array(); $name = $settings['_name']; - $default = $settings['_default']; + if (!isset($settings['_default'])){ + $default = ""; + } else { + $default = $settings['_default']; + } $type = $settings['_type']; /* Add name to table */ @@ -478,8 +476,32 @@ class printerPPDDialog extends plugin } return($str); } + + function removeModifiedPPD() + { + $path = $this->pathToPPD.$this->pathToModified.$this->selectedPPD['link']; + + if(file_exists($path)){ + if(is_writeable($path)){ + if(!@unlink($path)){ + print_red(sprintf(_("Removing old ppd file '%s' failed."),$path)); + } + }else{ + print_red(sprintf(_("Removing old ppd file '%s' failed. File is not accessible."),$path)); + } + }else{ + print_red(sprintf(_("Removing old ppd file '%s' failed. File does not exists or is not accessible."),$path)); + } + } - function check(){ return(plugin::check()); } + function check() + { + $message = plugin::check(); + if(empty($this->selectedPPD['link'])){ + $message[] = _("Please select a valid ppd file or use 'Cancel' to go back to printer configuration."); + } + return($message); + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?>