summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 86b057b)
raw | patch | inline | side by side (parent: 86b057b)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 27 Sep 2010 12:44:58 +0000 (12:44 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 27 Sep 2010 12:44:58 +0000 (12:44 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19800 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc
index 317313c3396ff70b959a4ac79842ccf60849ecef..263b88d242b34d093d96ddd27f38063ff4e0e647 100644 (file)
"dependency": {
"description": "Modules that are needed to be installed for this module",
"required": false,
- "value": [
-
- ],
+ "value": "0x002",
"syntax": "^[a-zA-Z0-9_+\\\\./-]+(\\\\[[<=>]+[a-zA-Z0-9_+\\\\.-]+\\\\])?$",
- "type": "list",
+ "type": "file",
"display": "Module dependencies"
},
"version": {
"required": true,
"value": "",
"syntax": "^[a-zA-Z0-9_+.-]+$",
- "type": "textarea",
+ "type": "string",
"display": "Module version"
},
"name": {
$this->setCurrentItem('root');
$this->addItem('PuppetModule','test1',
array(
- 'dependency' => array('mozilla-2','toaster-2.0'),
+ 'dependency' => '',
'version' => '2.4-f',
'name' => 'Thundebird',
'description' => 'Mozilla mail client')
diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget_file.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget_file.inc
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+
+class TemplateWidget_file extends TemplateWidget
+{
+ function render()
+ {
+ $title = set_post($this->description);
+ if(mb_strlen($this->value) == 0){
+ $ret = "<i>"._("No file uploaded yet")."</i>";
+ $ret.= "<br> <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"2000000\">
+ <input id=\"{$this->postName}\"
+ name=\"{$this->postName}\"
+ type=\"file\"
+ size=\"20\"
+ maxlength=\"255\"
+ accept=\"*.*\"> ";
+ $ret.= "<button name='{$this->postName}_Upload'>"._("Upload")."</button>";
+ }else{
+ $ret = "<i>"._("File uploaded").": ".mb_strlen($this->value)." "._("Bytes");
+ $ret.= " <button name='{$this->postName}_Remove'>".msgPool::delButton()."</button>";
+ }
+ return($ret);
+ }
+
+ function save_object()
+ {
+ if(isset($_POST["{$this->postName}_Upload"]) && isset($_FILES[$this->postName]['tmp_name'])){
+ $this->value = file_get_contents($_FILES[$this->postName]['tmp_name']);
+ }
+ if(isset($_POST["{$this->postName}_Remove"])) $this->value ="";
+ }
+}
+
+?>
diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget_textarea.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget_textarea.inc
index 26c733c476e8970d752aeb38ed77133bc6f428a2..030dd1156e2331f3f7c5ae1585dc997923b5c644 100644 (file)
{
function render()
{
- return("<textarea type='text' name=\"{$this->postName}\">".set_post($this->value)."</textarea>");
+ $title = set_post($this->description);
+ return("<textarea title=\"{$title}\"
+ style='width:100%'
+ rows=4 type='text'
+ name=\"{$this->postName}\">".set_post($this->value)."</textarea>");
}
}
diff --git a/gosa-plugins/goto/admin/systems/goto/Config/puppet.tpl b/gosa-plugins/goto/admin/systems/goto/Config/puppet.tpl
index 78a90826ccdd59c38687b30d9c778a865c71fc0c..a5d6787a79c421f77c87b9219220df88cb84961a 100644 (file)
</table>
</td>
<td style="width:50%; vertical-align: top;">
- {$dependencyName}
+ {$dependencyName}:<br>
{$dependency}
</td>
</tr>