Code

Added import to scripts
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 9 Sep 2005 05:09:15 +0000 (05:09 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 9 Sep 2005 05:09:15 +0000 (05:09 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1335 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/FAI/class_faiScriptEntry.inc
plugins/admin/FAI/faiHookEntry.tpl
plugins/admin/FAI/faiScriptEntry.tpl

index 3ffc67a7d1c0b727d71d26efa046fdc77b4b07b1..43793ebac8b31543edfb0e506a51e8c57bdf8ead 100644 (file)
@@ -42,6 +42,20 @@ class faiScriptEntry extends plugin
     /* Fill templating stuff */
     $smarty     = get_smarty();
     $display = "";
+  
+    if(isset($_POST['ImportUpload'])){
+      if(($_FILES['ImportFile']['error']!=0)){
+        print_red(_("Please select a valid file."));
+      }else
+      if(($_FILES['ImportFile']['size']==0)){
+        print_red(_("Selected file is empty."));
+      }else{
+        $str = file_get_contents($_FILES['ImportFile']['tmp_name']);
+        $this->Object_FAIscript = $str;
+      }
+    }
+
+  
 
     foreach($this->attributes as $attrs){
       $smarty->assign($attrs,stripslashes($this->$attrs));
index fba769e1549d1536f56b20f827366eb5087db997..2dd86e4fcd40ef45539e8e3f51ac220ec4d792c6 100644 (file)
@@ -35,7 +35,7 @@
                                                        </LABEL>
                                                </td>
                                                <td>
-                                                       <input type="text" name="Object_FAIscript" value="{$Object_FAIscript}" id="Object_FAIscript">
+                                                       <input type="text" name="Object_FAIscript" value="{$Object_FAIscript}" id="Object_FAIscript" style="width:280px;">
                                                </td>
                                        </tr>
                                        <tr>
@@ -45,7 +45,7 @@
                                                        </LABEL>
                                                </td>
                                                <td>
-                                                       <input type="text" name="Object_FAItask" value="{$Object_FAItask}" id="Object_FAItask">
+                                                       <input type="text" name="Object_FAItask" value="{$Object_FAItask}" id="Object_FAItask" style="width:280px;">
                                                </td>
                                        </tr>
                                </table>
index 674994abdd24156d8fe21c06af89a0faf3296c79..e5d7a7018ea3656dab5c015ecf24f4538768d0fa 100644 (file)
                {t}Script{/t}
        </LABEL>
        </h2>
+<div>
+       {t}Import script{/t} &nbsp;
+       <input type="file" name="ImportFile">&nbsp;
+       <input type="submit" name="ImportUpload" value="{t}Import{/t}">
+</div>
+<br>
 <table width="100%">
     <tr>
         <td>