diff --git a/gosa-plugins/goto/admin/systems/ppd/class_printerPPDSelectionDialog.inc b/gosa-plugins/goto/admin/systems/ppd/class_printerPPDSelectionDialog.inc
index ec93f23f9dceb3a9d78b61268d704409e8bd2188..e0dcd1c939cb9c100783fbd70c7abdd3ead78117 100644 (file)
return($smarty->fetch(get_template_path('remove_ppd.tpl', TRUE)));
}else{
- print_red(sprintf(_("Could not found specified ppd file '%s'."),$id_to_del));
+ msg_dialog::display(_("PPD error"), msgPool::fileDoesNotExist($id_to_del), ERROR_DIALOG);
}
}
if(isset($_POST['delete_ppd_confirm']) && !empty($this->current_del_id)){
/* check if file is removeable */
+ $is_ok = false;
if(is_writeable($this->current_del_id)){
$is_ok = @unlink($this->current_del_id);
}
}
}
- }else{
- $is_ok = false;
}
if(!$is_ok){
- print_red(_("Something went wrong while trying to remove the ppd file from server, possibly we have no write access."));
+ msg_dialog::display(_("PPD error"), msgPool::cannotDeleteFile($this->current_del_id), ERROR_DIALOG);
}
}
$list = array();
foreach($this->list as $cat => $ppds){
foreach($ppds as $ppd){
- if(preg_match("/^".str_replace("*",".*",$regex)."/i",$ppd['ppd'])){
+ $name = $ppd['ppd']['name'];
+ if(preg_match("/^".str_replace("*",".*",$regex)."/i",$name)){
if(is_readable($ppd['link'])){
$list[$ppd['link']] = $ppd;
}
}
}
}
+
+ /* Sort the list alphabetically */
+ asort($list);
if((isset($_GET['act']))&&($_GET['act']=="open")) {
if((!empty($_GET['id'])) && (!isset( $this->header[base64_decode($_GET['id'])]))){
- print_red(sprintf(_("Selected vendor '%s' does not exists in our list of ppds."),base64_decode($_GET['id'])));
+ msg_dialog::display(_("PPD error"), sprintf(_("Cannot locate vendor '%s' in available PPDs!"), base64_decode($_GET['id'])), ERROR_DIALOG);
$this->Vendor = "";
}else{
$this->Vendor = base64_decode($_GET['id']);
$div ->SetSummary(_("Printer ppd selection."));
$linkopen = "<a href='?plug=".$_GET['plug']."&act=open&id=%s'>
- <img src='images/folder.png' class='center' border=0> %s
+ <img src='images/lists/folder.png' class='center' border=0> %s
</a>";
$uselink = "<a href='?plug=".$_GET['plug']."&act=use&id=%s'>%s</a>";
$dellink = "<a href='?plug=".$_GET['plug']."&act=del&id=%s'>
- <img src='images/edittrash.png' alt='"._("delete")."' border=0>
+ <img src='images/lists/trash.png' alt='"._("delete")."' border=0>
</a>";
if(empty($this->Vendor)){
foreach($this-> header as $key => $entry){
$div ->AddEntry (array(
+
array("string"=>sprintf($linkopen,base64_encode($key),$key),"attach"=>"style='border-right:0px;'")
));
}
array("string"=>sprintf($linkopen,"",".. ["._("back")."]"),"attach"=>"style='border-right:0px;'")
));
foreach($list as $key => $ppd){
- if(preg_match("/^".$this->Vendor."/",$ppd['ppd'])){
+ $name = $ppd['ppd']['name'];
+ if(preg_match("/^".$this->Vendor."/", $name)){
if(is_writeable($ppd['link'])){
$del_str = sprintf($dellink,base64_encode($key));
}
$div ->AddEntry (array(
- array("string"=>sprintf($uselink,base64_encode($key),$ppd['ppd'])),
+ array("string"=>sprintf($uselink,base64_encode($key),$name)),
array("string"=>$del_str,"attach"=>"style='border-right:0px;'")
));
}
$smarty->assign("List", $div -> DrawList());
- $smarty->assign("search_image", get_template_path('images/search.png'));
- $smarty->assign("launchimage", get_template_path('images/small_filter.png'));
- $smarty->assign("tree_image", get_template_path('images/tree.png'));
+ $smarty->assign("search_image", get_template_path('images/lists/search.png'));
+ $smarty->assign("launchimage", get_template_path('images/lists/action.png'));
+ $smarty->assign("tree_image", get_template_path('images/lists/search-subtree.png'));
$smarty->assign("alphabet", generate_alphabet());
$smarty->assign("apply", apply_filter());
$smarty->assign("regex", $regex);