Code

Made kiosk service w3c conform
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 19 Mar 2010 15:56:59 +0000 (15:56 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 19 Mar 2010 15:56:59 +0000 (15:56 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16963 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/services/kiosk/class_goKioskService.inc
gosa-plugins/goto/admin/systems/services/kiosk/goKioskService.tpl

index dc27c533356b0224c10a8eda49edfcf3ebcd23eb..780f9d90eeb43839b36f7e3be50329f52a360ad3 100644 (file)
@@ -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 = "&nbsp;";
       if($this->acl_is_writeable("")){
-        $del = "<input type='image' src='images/lists/trash.png'
-          class='center' alt='delete' name='delkiosk_".$key."'>";
+        $del = image("images/lists/trash.png", 'delkiosk_'.$key);
       }
       $divlist->AddEntry(array(
-            array("string"=>"<a href='?plug=".$_GET['plug']."&getkiosk=".$val['name']."'>".$val['name']."</a>"),
+            array("string"=>"<a href='?plug=".$_GET['plug']."&amp;getkiosk=".$val['name']."'>".$val['name']."</a>"),
             array("string"=>$del,
               "attach"=>" style='border-right: 0px;width:24px; text-align:center;' ")
             ));
index b7b3047002ef93a79240b54bb07643729a3767ee..6c2fe6451de832c51f48d511675d8e89ed70e2c9 100644 (file)
@@ -2,40 +2,36 @@
 
 {if $baseDir == ""}
 
-<b>{msgPool type=invalidConfigurationAttribute param=KIOSKPATH}</b>
-
-<hr>
-<div style="width:100%; text-align:right;padding-top:10px;padding-bottom:3px;">
-    <button type='submit' name='CancelService'>{msgPool type=cancelButton}</button>
-
-</div>
+  <b>{msgPool type=invalidConfigurationAttribute param=KIOSKPATH}</b>
+  <hr>
+  <div class="plugin-actions">
+   <button type='submit' name='CancelService'>{msgPool type=cancelButton}</button>
+  </div>
 
 {else}
 
-    <input type="hidden" name="dialogissubmitted" value="1">
+<input type="hidden" name="dialogissubmitted" value="1">
 
 {t}Server path{/t}&nbsp;<input type='text' name="server_path" style="width:300px;" value="{$server_path}">
-<br>
-<br>
+
 {render acl=$ThisACL}
-{$divlist}
+ {$divlist}
 {/render}
+
 {render acl=$ThisACL}
-<input type="file" size=50 name="newProfile" value="{t}Browse{/t}">
+ <input type="file" size=50 name="newProfile" value="{t}Browse{/t}">
 {/render}
-{render acl=$ThisACL}
-<button type='submit' name='profileAdd'>{msgPool type=addButton}</button>
 
+{render acl=$ThisACL}
+ <button type='submit' name='profileAdd'>{msgPool type=addButton}</button>
 {/render}
 
 <hr>
-<div style="width:100%; text-align:right;padding-top:10px;padding-bottom:3px;">
-    <button type='submit' name='SaveService'>{msgPool type=saveButton}</button>
-
-    &nbsp;
-    <button type='submit' name='CancelService'>{msgPool type=cancelButton}</button>
-
+<div class="plugin-actions">
+ <button type='submit' name='SaveService'>{msgPool type=saveButton}</button>
+ <button type='submit' name='CancelService'>{msgPool type=cancelButton}</button>
 </div>
+
 <input type="hidden" name="goKioskPosted" value="1">
 
 <script language="JavaScript" type="text/javascript">