Code

Moved nfs dialog to correct position
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 19 Mar 2010 16:22:48 +0000 (16:22 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 19 Mar 2010 16:22:48 +0000 (16:22 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16966 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/services/nfs/class_servNfs.inc [deleted file]
gosa-plugins/goto/admin/systems/services/nfs/servnfs.tpl [deleted file]
gosa-plugins/goto/admin/systems/services/shares/class_servNfs.inc [new file with mode: 0644]
gosa-plugins/goto/admin/systems/services/shares/servnfs.tpl [new file with mode: 0644]

diff --git a/gosa-plugins/goto/admin/systems/services/nfs/class_servNfs.inc b/gosa-plugins/goto/admin/systems/services/nfs/class_servNfs.inc
deleted file mode 100644 (file)
index 14bd267..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
-<?php
-
-class servnfs extends plugin
-{
-  /* attribute list for save action */
-  var $ignore_account   = TRUE;
-  var $attributes       = array("description","type","charset","path","option", "volume");
-  var $objectclasses    = array("whatever");
-  var $is_account       = true;
-
-  var $name          ="";  // Name of  
-  var $description   ="";  // description
-  var $type          ="";  // Type FS/Samba/NCP
-  var $charset       ="";  // charset
-  var $host          ="";  // hostname
-  var $types         =array();  // Array Types NFS/Samba/NCP/netatalk
-  var $charsets      =array();  // Array with charsets
-  var $path          ="";  // Path
-  var $volume        ="";  // Volume
-  var $option        ="";  // Options
-  var $is_edit           =false;
-  var $create_mount_init = false; //mount entry set for this entry (while editing)?
-  var $create_mount = false; //save mount entry
-
-  var $parent       = NULL;
-  var $view_logged  = FALSE;
-
-  function servnfs (&$config, $parent,$entry= false,$mount =false)
-  {
-    $this->parent = $parent;
-    $dn = $parent->dn;
-    plugin::plugin ($config, $dn);
-
-    $this->types   = array("NBD" => "NBD", "CIFS" => "CIFS", "NFS"=>"NFS","samba"=>"samba","netatalk"=>"netatalk","NCP"=>"NCP");
-    if($dn){
-      $this->host = substr($dn, 3, strpos($dn, ',')-3);
-    }
-    asort($this->types);
-
-    $this->charsets = array();
-
-    if(!file_exists(CONFIG_DIR."/encodings")){
-      msg_dialog::display(_("Error"), msgPool::fileDoesNotExist(CONFIG_DIR."/encodings"), ERROR_DIALOG);
-    }else{
-      if(!is_readable(CONFIG_DIR."/encodings")){
-        msg_dialog::display(_("Error"), msgPool::cannotReadFile(CONFIG_DIR."/encodings"), ERROR_DIALOG);
-      }else{
-        $fp = fopen(CONFIG_DIR."/encodings","r");
-        $i = 100;
-        while(!feof($fp)&&$i){
-          $i -- ;
-          $str = trim(fgets($fp,256));
-
-          /* Skip comments */
-          if(!preg_match("/^#/",$str)){
-            $arr = explode("=",$str);
-            if(count($arr)==2){
-              $this->charsets[$arr[0]]=$arr[1];
-            }
-          }
-        }
-      }
-    }
-
-    if($entry){
-      list($this->name, $this->description, $this->type, $this->charset,
-          $this->path, $this->option, $this->volume)= explode("|",$entry."|");
-      $this->is_edit          = true;
-
-    }else{
-      $this->attributes[] = "name";
-    }
-
-
-    $this->create_mount_init = $mount;
-  }
-
-  function execute()
-  {
-    /* Call parent execute */
-    plugin::execute();
-
-    if($this->is_account && !$this->view_logged){
-      $this->view_logged = TRUE;
-      new log("view","server/".get_class($this),$this->dn);
-    }
-
-    /* Fill templating stuff */
-    $smarty= get_smarty();
-
-    $smarty->assign("charsets" ,$this->charsets);
-    $smarty->assign("types"    ,$this->types);
-
-    /* attrs to smarty*/
-    foreach($this->attributes as $attr){
-      $smarty->assign($attr,$this->$attr);
-    }
-
-    $tmp = $this->parent->plInfo();
-    foreach($tmp['plProvidedAcls'] as $name => $translation){
-      $smarty->assign($name."ACL",$this->parent->getacl($name));
-    }
-
-    $smarty->assign("name",$this->name);
-    if($this->is_edit){
-      $smarty->assign("nameACL", preg_replace("/w/","",$this->parent->getacl("name")));
-    } 
-    $smarty->assign("allow_mounts", $this->parent->allow_mounts);
-    $smarty->assign("mount_checked", "");
-
-    $smarty->assign("appleMountsACL",    $this->getacl("appleMounts"));
-
-    if (($this->type == "netatalk") || ($this->type == "NFS")) {
-      if ($this->create_mount_init) {
-        $smarty->assign("mount_checked", "checked");
-      } else {
-        $tmp = explode(",", $this->dn);
-        $clip = $tmp[0] . ",".get_ou('serverRDN');
-        $mountsdn = "cn=mounts," . substr($this->dn, strlen($clip));
-        switch ($this->type) {
-          case "netatalk" : {
-            $mountdn = "cn=".$this->host.":/".$this->name.",".$mountsdn;
-            break;
-          }
-          case "NFS" : {
-            $mountdn = "cn=".$this->host.":".$this->path.",".$mountsdn;
-            break;
-          }
-          default : {
-                      continue;
-                    }
-        }
-        $ldap = $this->config->get_ldap_link();
-        $ldap->cat($mountdn, array('dn'));
-        $attrs = $ldap->fetch();
-        if (count($attrs) > 0) {
-          $smarty->assign("mount_checked", "checked");
-        }
-      }        
-    }
-
-    $display= $smarty->fetch(get_template_path('servnfs.tpl', TRUE, dirname(__FILE__)));
-    return($display);
-  }
-
-  function remove_from_parent()
-  {
-    /* This cannot be removed... */
-  }
-
-
-  /* Save data to object */
-  function save_object()
-  {
-    if(isset($_POST['servnfs_posted'])){
-
-      foreach($this->attributes as $name){
-        if($this->parent->acl_is_writeable($name) && isset($_POST[$name])){
-          $this->$name = $_POST[$name];
-        }
-      }
-
-      if ((isset($_POST['netatalk_mount'])) && (($this->type == "netatalk") || ($this->type == "NFS"))) {
-        $this->create_mount = true;
-      } else {
-        $this->create_mount = false;
-      }
-    }
-  }
-
-
-  /* Check supplied data */
-  function check()
-  {
-    /* Call common method to give check the hook */
-    $message= plugin::check();
-
-    if(empty($this->path)){
-      $message[]= msgPool::required(_("Path"));
-    }
-
-    if($this->type == "NBD") {
-      if (!preg_match('/^[a-z0-9-]+:[0-9]+$/', $this->path)){
-        $message[]= _("'Path / Volume' must be of format 'server:port'!");
-      }
-    } else {
-      if (!tests::is_path($this->path)){
-        $message[]= _("'Path / Volume' must contain at least one '/'!");
-      }
-    }
-
-    if(!in_array($this->type,$this->types)){
-      $message[]= msgPool::required(_("Type"));
-    }
-
-    // only 0-9a-z
-    if(!$this->is_edit){
-      if(empty($this->name)){
-        $message[]= msgPool::required(_("Name"));
-      }
-      if(!preg_match("/^[a-z0-9\._äüö-]*$/ui",$this->name)){
-        $message[]= msgPool::invalid(_("Name"),$this->name,"/[a-z0-9\._äüö-]/ui");
-      }
-    }
-
-    if(!empty($this->description) && preg_match("/^[^a-z0-9\._äüö\+ -]*$/ui",$this->description)){
-      $message[]= msgPool::invalid(_("Description"),$this->description,"/^[a-z0-9\._äüö\+ -]*$/ui");
-    }
-
-    if(!empty($this->volume) && preg_match("/^[^a-z0-9\._äüö\+ -]*$/ui",$this->volume)){
-      $message[]= msgPool::invalid(_("Volume"),$this->volume,"/^[a-z0-9\._äüö\+ -]*$/ui");
-    }
-
-    if(!empty($this->option) && preg_match("/^[^a-z0-9\._äüö,=\+ -]*$/ui",$this->option)){
-      $message[]= msgPool::invalid(_("Option"),$this->option,"/^[a-z0-9\._äüö\+ -]*$/ui");
-    }
-
-    /* remove a / at the end of the path, we neither need it there nor
-     * do we want to check for it later.
-     */
-    if(substr($this->path, -1, 1) == '/') {
-      $this->path=substr($this->path, 0, -1);
-    }
-
-    $ldap= $this->config->get_ldap_link();
-    $ldap->cd($this->config->current['BASE']);
-    $ldap->search("(objectClass=goShareServer)", array("goExportEntry"));
-    while($test = $ldap->fetch()){
-      if($test['dn']==$this->dn)
-        continue;
-      if(isset($test['goExportEntry'])){
-        foreach($test['goExportEntry'] as $entry){
-          $tmp = explode("|",$entry);
-          if($tmp[0] == $this->name){
-            $message[]= msgPool::duplicated(_("Name"));
-          }
-        }
-      }
-    }
-    return ($message);
-  }
-
-
-  /* Save to LDAP */
-  function save()
-  {
-    /* Everything seems perfect, lets 
-       generate an new export Entry 
-     */
-
-    $s_return = "";
-
-    $s_return.= $this->name."|";     
-    $s_return.= $this->description."|";     
-    $s_return.= $this->type."|";     
-    $s_return.= $this->charset."|";     
-    $s_return.= $this->path."|";     
-    $s_return.= $this->option."|";     
-    $s_return.= $this->volume;     
-
-    return(array($this->name=>$s_return));
-  }
-
-  function should_create_mount() {
-    return $this->create_mount;
-  }
-
-
-}
-
-// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
-?>
diff --git a/gosa-plugins/goto/admin/systems/services/nfs/servnfs.tpl b/gosa-plugins/goto/admin/systems/services/nfs/servnfs.tpl
deleted file mode 100644 (file)
index 9e91a55..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-<h3>{t}Edit share{/t}</h3>
-<table summary="{t}NFS setup{/t}" width="100%">
-       <tr>
-               <td>
-
-               <!--Table left-top-->
-                       <table summary="">
-                               <tr>
-                                       <td>
-                                               {t}Name{/t} {$must}
-                                       </td>
-                                       <td>
-{render acl=$nameACL}
-                                               <input type="text" name="name" value="{$name}" >
-{/render}
-                                       </td>
-                               </tr>
-                               <tr>
-                                       <td>
-                                               {t}Description{/t}
-                                       </td>
-                                       <td>
-{render acl=$descriptionACL}
-                                               <input type="text" size="40" name="description" value="{$description}">
-{/render}
-                                       </td>
-                               </tr>
-                               <tr>
-                                       <td>
-                                               {t}Path{/t} / {t}Volume{/t} {$must}
-                                       </td>
-                                       <td>
-{render acl=$pathACL}
-                                               <input type="text" size="40" name="path" value="{$path}">
-{/render}
-                                       </td>
-                               </tr>
-                               <tr>
-                                       <td>
-                                               <div id="vlabel">{t}Server{/t}</div>
-                                       </td>
-                                       <td>
-{render acl=$volumeACL}
-                                               <input type="text" id="volume" size="40" name="volume" value="{$volume}">
-{/render}
-                                       </td>
-                               </tr>
-                       </table>
-               </td>
-               <td class='left-border'>
-
-
-               <!--Table right-top-->
-                       <table summary="">
-                               <tr>
-                                       <td>
-
-
-                                               {t}Type{/t}
-                                       </td>
-                                       <td>
-{render acl=$typeACL}
-                                               <select size="1" name="type" id="sharetype">
-                                                       {html_options options=$types selected=$type}
-                                               </select>
-{/render}
-                                               {if $allow_mounts == TRUE}
-                                               <br><br>
-{render acl=$netatalkmountACL}
-                                               <input type="checkbox" name="netatalk_mount" id="netatalk_mount" {$mount_checked} />
-{/render}
-                                               <label for="netatalk_mount">{t}Auto-mount share on Apple systems{/t}</label>
-                                                       <br>
-                                                       <br>
-                                               {/if}
-
-                                                               {literal}
-                                                                       <script language="JavaScript">
-                                                                               document.getElementById('sharetype').onchange=function() {
-                                                                                       var foobar=this[this.selectedIndex].value;
-                                                                                       var box=document.getElementById('netatalk_mount');
-                                                                                       var volume=document.getElementById('volume');
-                                                                                       var vlabel=document.getElementById('vlabel');
-                                                               {/literal}
-                                                                       <!-- Only add checkbox enable/disable js part if checkbox is available --> 
-                                                                       {if $allow_mounts == TRUE}
-                                                                               {literal}
-                                                                                       if(foobar=="NFS"||foobar=="netatalk"){
-                                                                                               box.disabled=false;
-                                                                                       } else {
-                                                                                               box.disabled=true;
-                                                                                               box.checked=false;
-                                                                                       }
-                                                                               {/literal}
-                                                                       {/if}
-                                                               {literal}
-                                                                                       if(foobar=="NCP"){
-                                                                                               volume.style.visibility="visible";
-                                                                                               vlabel.style.visibility="visible";
-                                                                                       } else {
-                                                                                               volume.style.visibility="hidden";
-                                                                                               vlabel.style.visibility="hidden";
-                                                                                       }
-                                                                               };
-                                                                               document.getElementById('sharetype').onchange();
-                                                                       </script>
-                                                               {/literal}
-                                       </td>
-                               </tr>
-                               <tr>
-                                       <td>
-                                               {t}Codepage{/t}
-                                       </td>
-                                       <td>
-{render acl=$charsetACL}
-                                               <select size="1" name="charset">
-                                                       {html_options options=$charsets selected=$charset}
-                                               </select>       
-{/render}
-                                       </td>
-                               </tr>
-                               <tr>
-                                   <td>
-                                       {t}Option{/t}
-                                   </td>
-                                   <td>
-{render acl=$optionACL}
-                                                               <input type="text" name="option" value="{$option}">
-{/render}
-                                   </td>
-                               </tr>
-                       </table>
-               </td>
-       </tr>
-       <tr>
-               <td colspan=2>
-                       <hr>
-               </td>
-       </tr>
-       <tr>
-               <td colspan=2 style="text-align:right">
-                       <button type='submit' name='NFSsave'>{msgPool type=saveButton}</button>
-
-                       <button type='submit' name='NFScancel'>{msgPool type=cancelButton}</button>
-
-               </td>
-       </tr>
-</table>
-<input type='hidden' name='servnfs_posted' value='1'>
diff --git a/gosa-plugins/goto/admin/systems/services/shares/class_servNfs.inc b/gosa-plugins/goto/admin/systems/services/shares/class_servNfs.inc
new file mode 100644 (file)
index 0000000..14bd267
--- /dev/null
@@ -0,0 +1,272 @@
+<?php
+
+class servnfs extends plugin
+{
+  /* attribute list for save action */
+  var $ignore_account   = TRUE;
+  var $attributes       = array("description","type","charset","path","option", "volume");
+  var $objectclasses    = array("whatever");
+  var $is_account       = true;
+
+  var $name          ="";  // Name of  
+  var $description   ="";  // description
+  var $type          ="";  // Type FS/Samba/NCP
+  var $charset       ="";  // charset
+  var $host          ="";  // hostname
+  var $types         =array();  // Array Types NFS/Samba/NCP/netatalk
+  var $charsets      =array();  // Array with charsets
+  var $path          ="";  // Path
+  var $volume        ="";  // Volume
+  var $option        ="";  // Options
+  var $is_edit           =false;
+  var $create_mount_init = false; //mount entry set for this entry (while editing)?
+  var $create_mount = false; //save mount entry
+
+  var $parent       = NULL;
+  var $view_logged  = FALSE;
+
+  function servnfs (&$config, $parent,$entry= false,$mount =false)
+  {
+    $this->parent = $parent;
+    $dn = $parent->dn;
+    plugin::plugin ($config, $dn);
+
+    $this->types   = array("NBD" => "NBD", "CIFS" => "CIFS", "NFS"=>"NFS","samba"=>"samba","netatalk"=>"netatalk","NCP"=>"NCP");
+    if($dn){
+      $this->host = substr($dn, 3, strpos($dn, ',')-3);
+    }
+    asort($this->types);
+
+    $this->charsets = array();
+
+    if(!file_exists(CONFIG_DIR."/encodings")){
+      msg_dialog::display(_("Error"), msgPool::fileDoesNotExist(CONFIG_DIR."/encodings"), ERROR_DIALOG);
+    }else{
+      if(!is_readable(CONFIG_DIR."/encodings")){
+        msg_dialog::display(_("Error"), msgPool::cannotReadFile(CONFIG_DIR."/encodings"), ERROR_DIALOG);
+      }else{
+        $fp = fopen(CONFIG_DIR."/encodings","r");
+        $i = 100;
+        while(!feof($fp)&&$i){
+          $i -- ;
+          $str = trim(fgets($fp,256));
+
+          /* Skip comments */
+          if(!preg_match("/^#/",$str)){
+            $arr = explode("=",$str);
+            if(count($arr)==2){
+              $this->charsets[$arr[0]]=$arr[1];
+            }
+          }
+        }
+      }
+    }
+
+    if($entry){
+      list($this->name, $this->description, $this->type, $this->charset,
+          $this->path, $this->option, $this->volume)= explode("|",$entry."|");
+      $this->is_edit          = true;
+
+    }else{
+      $this->attributes[] = "name";
+    }
+
+
+    $this->create_mount_init = $mount;
+  }
+
+  function execute()
+  {
+    /* Call parent execute */
+    plugin::execute();
+
+    if($this->is_account && !$this->view_logged){
+      $this->view_logged = TRUE;
+      new log("view","server/".get_class($this),$this->dn);
+    }
+
+    /* Fill templating stuff */
+    $smarty= get_smarty();
+
+    $smarty->assign("charsets" ,$this->charsets);
+    $smarty->assign("types"    ,$this->types);
+
+    /* attrs to smarty*/
+    foreach($this->attributes as $attr){
+      $smarty->assign($attr,$this->$attr);
+    }
+
+    $tmp = $this->parent->plInfo();
+    foreach($tmp['plProvidedAcls'] as $name => $translation){
+      $smarty->assign($name."ACL",$this->parent->getacl($name));
+    }
+
+    $smarty->assign("name",$this->name);
+    if($this->is_edit){
+      $smarty->assign("nameACL", preg_replace("/w/","",$this->parent->getacl("name")));
+    } 
+    $smarty->assign("allow_mounts", $this->parent->allow_mounts);
+    $smarty->assign("mount_checked", "");
+
+    $smarty->assign("appleMountsACL",    $this->getacl("appleMounts"));
+
+    if (($this->type == "netatalk") || ($this->type == "NFS")) {
+      if ($this->create_mount_init) {
+        $smarty->assign("mount_checked", "checked");
+      } else {
+        $tmp = explode(",", $this->dn);
+        $clip = $tmp[0] . ",".get_ou('serverRDN');
+        $mountsdn = "cn=mounts," . substr($this->dn, strlen($clip));
+        switch ($this->type) {
+          case "netatalk" : {
+            $mountdn = "cn=".$this->host.":/".$this->name.",".$mountsdn;
+            break;
+          }
+          case "NFS" : {
+            $mountdn = "cn=".$this->host.":".$this->path.",".$mountsdn;
+            break;
+          }
+          default : {
+                      continue;
+                    }
+        }
+        $ldap = $this->config->get_ldap_link();
+        $ldap->cat($mountdn, array('dn'));
+        $attrs = $ldap->fetch();
+        if (count($attrs) > 0) {
+          $smarty->assign("mount_checked", "checked");
+        }
+      }        
+    }
+
+    $display= $smarty->fetch(get_template_path('servnfs.tpl', TRUE, dirname(__FILE__)));
+    return($display);
+  }
+
+  function remove_from_parent()
+  {
+    /* This cannot be removed... */
+  }
+
+
+  /* Save data to object */
+  function save_object()
+  {
+    if(isset($_POST['servnfs_posted'])){
+
+      foreach($this->attributes as $name){
+        if($this->parent->acl_is_writeable($name) && isset($_POST[$name])){
+          $this->$name = $_POST[$name];
+        }
+      }
+
+      if ((isset($_POST['netatalk_mount'])) && (($this->type == "netatalk") || ($this->type == "NFS"))) {
+        $this->create_mount = true;
+      } else {
+        $this->create_mount = false;
+      }
+    }
+  }
+
+
+  /* Check supplied data */
+  function check()
+  {
+    /* Call common method to give check the hook */
+    $message= plugin::check();
+
+    if(empty($this->path)){
+      $message[]= msgPool::required(_("Path"));
+    }
+
+    if($this->type == "NBD") {
+      if (!preg_match('/^[a-z0-9-]+:[0-9]+$/', $this->path)){
+        $message[]= _("'Path / Volume' must be of format 'server:port'!");
+      }
+    } else {
+      if (!tests::is_path($this->path)){
+        $message[]= _("'Path / Volume' must contain at least one '/'!");
+      }
+    }
+
+    if(!in_array($this->type,$this->types)){
+      $message[]= msgPool::required(_("Type"));
+    }
+
+    // only 0-9a-z
+    if(!$this->is_edit){
+      if(empty($this->name)){
+        $message[]= msgPool::required(_("Name"));
+      }
+      if(!preg_match("/^[a-z0-9\._äüö-]*$/ui",$this->name)){
+        $message[]= msgPool::invalid(_("Name"),$this->name,"/[a-z0-9\._äüö-]/ui");
+      }
+    }
+
+    if(!empty($this->description) && preg_match("/^[^a-z0-9\._äüö\+ -]*$/ui",$this->description)){
+      $message[]= msgPool::invalid(_("Description"),$this->description,"/^[a-z0-9\._äüö\+ -]*$/ui");
+    }
+
+    if(!empty($this->volume) && preg_match("/^[^a-z0-9\._äüö\+ -]*$/ui",$this->volume)){
+      $message[]= msgPool::invalid(_("Volume"),$this->volume,"/^[a-z0-9\._äüö\+ -]*$/ui");
+    }
+
+    if(!empty($this->option) && preg_match("/^[^a-z0-9\._äüö,=\+ -]*$/ui",$this->option)){
+      $message[]= msgPool::invalid(_("Option"),$this->option,"/^[a-z0-9\._äüö\+ -]*$/ui");
+    }
+
+    /* remove a / at the end of the path, we neither need it there nor
+     * do we want to check for it later.
+     */
+    if(substr($this->path, -1, 1) == '/') {
+      $this->path=substr($this->path, 0, -1);
+    }
+
+    $ldap= $this->config->get_ldap_link();
+    $ldap->cd($this->config->current['BASE']);
+    $ldap->search("(objectClass=goShareServer)", array("goExportEntry"));
+    while($test = $ldap->fetch()){
+      if($test['dn']==$this->dn)
+        continue;
+      if(isset($test['goExportEntry'])){
+        foreach($test['goExportEntry'] as $entry){
+          $tmp = explode("|",$entry);
+          if($tmp[0] == $this->name){
+            $message[]= msgPool::duplicated(_("Name"));
+          }
+        }
+      }
+    }
+    return ($message);
+  }
+
+
+  /* Save to LDAP */
+  function save()
+  {
+    /* Everything seems perfect, lets 
+       generate an new export Entry 
+     */
+
+    $s_return = "";
+
+    $s_return.= $this->name."|";     
+    $s_return.= $this->description."|";     
+    $s_return.= $this->type."|";     
+    $s_return.= $this->charset."|";     
+    $s_return.= $this->path."|";     
+    $s_return.= $this->option."|";     
+    $s_return.= $this->volume;     
+
+    return(array($this->name=>$s_return));
+  }
+
+  function should_create_mount() {
+    return $this->create_mount;
+  }
+
+
+}
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/gosa-plugins/goto/admin/systems/services/shares/servnfs.tpl b/gosa-plugins/goto/admin/systems/services/shares/servnfs.tpl
new file mode 100644 (file)
index 0000000..9e91a55
--- /dev/null
@@ -0,0 +1,149 @@
+<h3>{t}Edit share{/t}</h3>
+<table summary="{t}NFS setup{/t}" width="100%">
+       <tr>
+               <td>
+
+               <!--Table left-top-->
+                       <table summary="">
+                               <tr>
+                                       <td>
+                                               {t}Name{/t} {$must}
+                                       </td>
+                                       <td>
+{render acl=$nameACL}
+                                               <input type="text" name="name" value="{$name}" >
+{/render}
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td>
+                                               {t}Description{/t}
+                                       </td>
+                                       <td>
+{render acl=$descriptionACL}
+                                               <input type="text" size="40" name="description" value="{$description}">
+{/render}
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td>
+                                               {t}Path{/t} / {t}Volume{/t} {$must}
+                                       </td>
+                                       <td>
+{render acl=$pathACL}
+                                               <input type="text" size="40" name="path" value="{$path}">
+{/render}
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td>
+                                               <div id="vlabel">{t}Server{/t}</div>
+                                       </td>
+                                       <td>
+{render acl=$volumeACL}
+                                               <input type="text" id="volume" size="40" name="volume" value="{$volume}">
+{/render}
+                                       </td>
+                               </tr>
+                       </table>
+               </td>
+               <td class='left-border'>
+
+
+               <!--Table right-top-->
+                       <table summary="">
+                               <tr>
+                                       <td>
+
+
+                                               {t}Type{/t}
+                                       </td>
+                                       <td>
+{render acl=$typeACL}
+                                               <select size="1" name="type" id="sharetype">
+                                                       {html_options options=$types selected=$type}
+                                               </select>
+{/render}
+                                               {if $allow_mounts == TRUE}
+                                               <br><br>
+{render acl=$netatalkmountACL}
+                                               <input type="checkbox" name="netatalk_mount" id="netatalk_mount" {$mount_checked} />
+{/render}
+                                               <label for="netatalk_mount">{t}Auto-mount share on Apple systems{/t}</label>
+                                                       <br>
+                                                       <br>
+                                               {/if}
+
+                                                               {literal}
+                                                                       <script language="JavaScript">
+                                                                               document.getElementById('sharetype').onchange=function() {
+                                                                                       var foobar=this[this.selectedIndex].value;
+                                                                                       var box=document.getElementById('netatalk_mount');
+                                                                                       var volume=document.getElementById('volume');
+                                                                                       var vlabel=document.getElementById('vlabel');
+                                                               {/literal}
+                                                                       <!-- Only add checkbox enable/disable js part if checkbox is available --> 
+                                                                       {if $allow_mounts == TRUE}
+                                                                               {literal}
+                                                                                       if(foobar=="NFS"||foobar=="netatalk"){
+                                                                                               box.disabled=false;
+                                                                                       } else {
+                                                                                               box.disabled=true;
+                                                                                               box.checked=false;
+                                                                                       }
+                                                                               {/literal}
+                                                                       {/if}
+                                                               {literal}
+                                                                                       if(foobar=="NCP"){
+                                                                                               volume.style.visibility="visible";
+                                                                                               vlabel.style.visibility="visible";
+                                                                                       } else {
+                                                                                               volume.style.visibility="hidden";
+                                                                                               vlabel.style.visibility="hidden";
+                                                                                       }
+                                                                               };
+                                                                               document.getElementById('sharetype').onchange();
+                                                                       </script>
+                                                               {/literal}
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td>
+                                               {t}Codepage{/t}
+                                       </td>
+                                       <td>
+{render acl=$charsetACL}
+                                               <select size="1" name="charset">
+                                                       {html_options options=$charsets selected=$charset}
+                                               </select>       
+{/render}
+                                       </td>
+                               </tr>
+                               <tr>
+                                   <td>
+                                       {t}Option{/t}
+                                   </td>
+                                   <td>
+{render acl=$optionACL}
+                                                               <input type="text" name="option" value="{$option}">
+{/render}
+                                   </td>
+                               </tr>
+                       </table>
+               </td>
+       </tr>
+       <tr>
+               <td colspan=2>
+                       <hr>
+               </td>
+       </tr>
+       <tr>
+               <td colspan=2 style="text-align:right">
+                       <button type='submit' name='NFSsave'>{msgPool type=saveButton}</button>
+
+                       <button type='submit' name='NFScancel'>{msgPool type=cancelButton}</button>
+
+               </td>
+       </tr>
+</table>
+<input type='hidden' name='servnfs_posted' value='1'>