From 5fbb233d2c8c637a39520bdd9cda7032969dddc9 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 19 Mar 2010 15:56:59 +0000 Subject: [PATCH] Made kiosk service w3c conform git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16963 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../services/kiosk/class_goKioskService.inc | 22 ++++++++---- .../systems/services/kiosk/goKioskService.tpl | 36 +++++++++---------- 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/gosa-plugins/goto/admin/systems/services/kiosk/class_goKioskService.inc b/gosa-plugins/goto/admin/systems/services/kiosk/class_goKioskService.inc index dc27c5333..780f9d90e 100644 --- a/gosa-plugins/goto/admin/systems/services/kiosk/class_goKioskService.inc +++ b/gosa-plugins/goto/admin/systems/services/kiosk/class_goKioskService.inc @@ -98,6 +98,8 @@ class goKioskService extends goService{ if(file_exists($name)){ $content = file_get_contents($name); send_binary_content($content,$id); + }else{ + msg_dialog::display(_("Warning"), sprintf(_("The profile does not exists '%s'!"), $name), ERROR_DIALOG); } } } @@ -117,7 +119,17 @@ class goKioskService extends goService{ 'tmp_name'=> $file['tmp_name'], 'content' => file_get_contents($file['tmp_name']), 'exists' => TRUE); - $this->gotoKioskProfiles[] = $tmp; + + + $used = array(); + foreach($this->gotoKioskProfiles as $k){ + $used[] = $k['name']; + } + if(in_array($file['name'], $used)){ + msg_dialog::display(_("Warning"), msgPool::duplicated(_("Profile")), WARNING_DIALOG); + }else{ + $this->gotoKioskProfiles[] = $tmp; + } } } @@ -128,8 +140,7 @@ class goKioskService extends goService{ /* Get id, name and path */ $only_once = false; - $id = preg_replace("/^delkiosk_/","",$name); - $id = preg_replace("/_.*$/","",$id); + $id = preg_replace("/^delkiosk_([0-9]*)$/","\\1",$name); $name = $this->gotoKioskProfiles[$id]['name']; $filename = $this->baseDir."/".$name; @@ -178,11 +189,10 @@ class goKioskService extends goService{ foreach($this->gotoKioskProfiles as $key => $val ){ $del = " "; if($this->acl_is_writeable("")){ - $del = ""; + $del = image("images/lists/trash.png", 'delkiosk_'.$key); } $divlist->AddEntry(array( - array("string"=>"".$val['name'].""), + array("string"=>"".$val['name'].""), array("string"=>$del, "attach"=>" style='border-right: 0px;width:24px; text-align:center;' ") )); diff --git a/gosa-plugins/goto/admin/systems/services/kiosk/goKioskService.tpl b/gosa-plugins/goto/admin/systems/services/kiosk/goKioskService.tpl index b7b304700..6c2fe6451 100644 --- a/gosa-plugins/goto/admin/systems/services/kiosk/goKioskService.tpl +++ b/gosa-plugins/goto/admin/systems/services/kiosk/goKioskService.tpl @@ -2,40 +2,36 @@ {if $baseDir == ""} -{msgPool type=invalidConfigurationAttribute param=KIOSKPATH} - -
-
- - -
+ {msgPool type=invalidConfigurationAttribute param=KIOSKPATH} +
+
+ +
{else} - + {t}Server path{/t}  -
-
+ {render acl=$ThisACL} -{$divlist} + {$divlist} {/render} + {render acl=$ThisACL} - + {/render} -{render acl=$ThisACL} - +{render acl=$ThisACL} + {/render}
-
- - -   - - +
+ +
+