Code

get rid of the div stuff
[gosa.git] / gosa-plugins / fai / admin / fai / class_faiScript.inc
index e29091b92866e03354e2a5501708decc0537f2cf..2703ae7219a1bc6b6f793396f920c84f7922642e 100644 (file)
@@ -77,18 +77,21 @@ class faiScript extends plugin
     $this->scriptListWidget->setInstantDelete(false);
     $this->scriptListWidget->setEditable(true);
     $this->scriptListWidget->setWidth("100%");
-    $this->scriptListWidget->setHeight("70px");
+    $this->scriptListWidget->setHeight("140px");
     $this->scriptListWidget->setHeader(array(_("Name"),_("Description")));
   }
 
+
   function convertList($type = FALSE)
   {
     $data = array();
+    $s_acl = $this->ui->get_permissions($this->dn,"fai/faiScriptEntry","FAIscript");
     foreach($this->SubObjects as $cn => $entry){
       if($entry['status'] == "delete") continue;
       if($type){
         $data[$cn] = $entry;
       }else{
+        if(!isset($entry['description'])) $entry['description']="";
         $data[$cn] = array('data' => array($entry['cn'], $entry['description']));
       }
     }
@@ -110,7 +113,7 @@ class faiScript extends plugin
 
         /* Check if we must decode some attributes */
         if(in_array_ics($attrs,$this->sub64coded)){
-          $var = postDecode($var);
+          $var = base64_decode($var);
         }
 
         /*  check if this is a binary entry */
@@ -169,18 +172,6 @@ class faiScript extends plugin
       set_object_info($this->dn);
     }
 
-    /* Handle posts */
-    $s_action = $s_entry = "";
-    foreach($_POST as $name => $value){
-      if(preg_match("/^download_/",$name)){
-        $s_entry = postDecode(preg_replace("/^download_/","",$name));
-        $obj = $this->SubObjects[$s_entry];
-        $obj  = $this->get_object_attributes($obj,$this->sub_Load_Later);
-        send_binary_content(stripslashes($obj['FAIscript']),$obj['cn'].".FAIscript"); 
-        break;
-      }
-    }
-
     $this->scriptListWidget->setAcl($this->getacl(""));
     $this->scriptListWidget->save_object();
     $action = $this->scriptListWidget->getAction();
@@ -287,7 +278,7 @@ class faiScript extends plugin
 
     $this->scriptListWidget->setListData($this->convertList(TRUE), $this->convertList());
     $this->scriptListWidget->update();
-    $smarty->assign("Entry_divlist",$this->scriptListWidget->render());
+    $smarty->assign("Entry_listing",$this->scriptListWidget->render());
 
     /* Magic quotes GPC, escapes every ' " \, to solve some security risks
      * If we post the escaped strings they will be escaped again
@@ -449,7 +440,7 @@ class faiScript extends plugin
     foreach($Objects as $name => $obj){
 
       foreach($this->sub64coded as $codeIt){
-        $obj[$codeIt]=postEncode(stripslashes($obj[$codeIt]));
+        $obj[$codeIt]=base64_encode(stripslashes($obj[$codeIt]));
       }
 
       $tmp = array();