Code

Updated kiosk list
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Jan 2006 08:38:45 +0000 (08:38 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Jan 2006 08:38:45 +0000 (08:38 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2485 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/environment/class_environment.inc
plugins/personal/environment/class_kioskManagementDialog.inc
plugins/personal/environment/kioskManagement.tpl

index af7d2bcb17ec89d9485d210bf18fab803eab45ac..dcbe0bdb49b778f481cd4bb17e99922bd5c01517 100644 (file)
@@ -407,6 +407,7 @@ class environment extends plugin
     if(isset($_POST['KioskManagementDialog'])){
       $this->dialog = new kioskManagementDialog($this->config,$this->dn,$this->newKioskProfiles); 
       $this->dialog->parent= $this;
+      $this->dialog->acl = $this->acl;
       $this->is_dialog = true;
     }
 
index 93af0635dcfa466ee488b6e22a1efa8a98b75fe7..107af006611388d184d48eb4300bf908aaa543cf 100644 (file)
@@ -36,9 +36,9 @@ class kioskManagementDialog extends plugin
 
     $smarty->assign("gotoKioskProfileACL",chkacl($this->acl,"gotoKioskProfile"));
 
-  foreach($this->attributes as $attr){
-    $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
-  }
+    foreach($this->attributes as $attr){
+      $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+    }
 
     /* Add new kiosk profile 
      * in profile directory ($this->baseDir); 
@@ -50,7 +50,29 @@ class kioskManagementDialog extends plugin
         $this->filesToAttach[$file['name']]['contents'] = file_get_contents($file['tmp_name']);
       }
     }
+     
+    $only_once = true;
+    foreach($_POST as $name => $value){
       
+      if((preg_match("/^delkiosk_/",$name))&&($only_once)){
+        $only_once = false;
+        $id  = preg_replace("/^delkiosk_/","",$name);
+        $id = preg_replace("/_.*$/","",$id);
+
+        $filename = $this->baseDir."/".preg_replace("/^.*\//i","",base64_decode($id));
+
+        $res = unlink($filename);
+        if(!$res){
+          if(!is_writeable($filename)){
+            print_red(sprintf(_("Can't delete '%s'. Error was: permission denied."), $filename));
+          }
+          if(!file_exists($filename)){
+            print_red(sprintf(_("Can't delete '%s'. Errow was: file doesn't exist."), $filename));
+          }
+        }
+      }
+    }
+
     /* Delete profile
      * Delete selected file form $this->baseDir
      */
@@ -69,7 +91,25 @@ class kioskManagementDialog extends plugin
       }
     }
 
+    $divlist = new divSelectBox("KioskProfiles");
+    $divlist -> SetHeight (300);
+
+    $tmp = $this->getKioskProfiles();
+
+    foreach($tmp as $val ){
+      $divlist->AddEntry(array(
+                          array("string"=>"<a target='_blank' href='getkiosk.php?id=".$val."'>".$val."</a>"),
+                          array("string"=>"<input type='image' src='images/edittrash.png' class='center' alt='delete' name='delkiosk_".base64_encode($val)."'>" , 
+                                "attach"=>" style='border-right: 0px;width:24px; text-align:center;' ")
+                              )); 
+    }
+      
+
     /*Assign all existing profiles to smarty*/
+
+
+    $smarty->assign("divlist",$divlist->DrawList());
+
     $smarty->assign("gotoKioskProfiles",$this->getKioskProfiles());
     $smarty->assign("gotoKioskProfileKeys",array_flip($this->getKioskProfiles()));
 
index c32ebfef4dd617127c853df499164b18b639e7f8..091407596bd3aca0fe57042ba9a245dfbc0e5937 100644 (file)
@@ -5,13 +5,14 @@
        <table summary="{t}Kiosk profile management{/t}" width="100%">
                <tr>
                        <td>
-               <select style="width:100%;" size=18 name="gotoKioskProfile" {$gotoKioskProfileACL} id="gotoKioskProfile">
+                               {$divlist}
+<!--                   <select style="width:100%;" size=18 name="gotoKioskProfile" {$gotoKioskProfileACL} id="gotoKioskProfile">
                 {html_options values=$gotoKioskProfileKeys output=$gotoKioskProfiles}
                 <option disabled>&nbsp;</option>
-                </select><br>
+                </select>-->
                <input type="file" size=50 name="newProfile" value="{t}Browse{/t}">                     
                <input type="submit" name="profileAdd" value="{t}Add{/t}">
-                         <input type="submit" name="profileDel" value="{t}Remove{/t}">
+               <!--      <input type="submit" name="profileDel" value="{t}Remove{/t}">-->
                        </td>
                        <td>
                        </td>