예제 #1
0
 function showForm($ID, $options = array())
 {
     if (!$this->canview()) {
         return false;
     }
     $plugin_databases_databases_id = -1;
     if (isset($options['plugin_databases_databases_id'])) {
         $plugin_databases_databases_id = $options['plugin_databases_databases_id'];
     }
     if ($ID > 0) {
         $this->check($ID, 'r');
     } else {
         $database = new PluginDatabasesDatabase();
         $database->getFromDB($plugin_databases_databases_id);
         // Create item
         $input = array('plugin_databases_databases_id' => $plugin_databases_databases_id, 'entities_id' => $database->getEntityID(), 'is_recursive' => $database->isRecursive());
         $this->check(-1, 'w', $input);
     }
     if ($ID > 0) {
         $this->showTabs($options);
     }
     $this->showFormHeader($options);
     echo "<input type='hidden' name='plugin_databases_databases_id' value='{$plugin_databases_databases_id}'>";
     echo "<input type='hidden' name='entities_id' value='" . $this->fields["entities_id"] . "'>";
     echo "<input type='hidden' name='is_recursive' value='" . $this->fields["is_recursive"] . "'>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Name') . "</td>";
     echo "<td>";
     Html::autocompletionTextField($this, "name");
     echo "</td>";
     echo "<td>" . __('Type') . "</td>";
     echo "<td>";
     Dropdown::show('PluginDatabasesScriptType', array('name' => "plugin_databases_scripttypes_id", 'value' => $this->fields["plugin_databases_scripttypes_id"]));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Path', 'databases') . "</td>";
     echo "<td>";
     Html::autocompletionTextField($this, "path");
     echo "</td>";
     echo "<td></td>";
     echo "<td></td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td colspan = '4'>";
     echo "<table cellpadding='2' cellspacing='2' border='0'><tr><td>";
     echo __('Comments') . "</td></tr>";
     echo "<tr>";
     echo "<td class='center'>";
     echo "<textarea cols='125' rows='3' name='comment'>" . $this->fields["comment"] . "</textarea>";
     echo "</td></tr></table>";
     echo "</td>";
     echo "</tr>";
     $options['candel'] = false;
     $this->showFormButtons($options);
     if ($ID > 0) {
         $this->addDivForTabs();
     }
     return true;
 }