Пример #1
0
 function showFormEdit($params, $options = array())
 {
     global $LANG, $CFG_GLPI;
     if ($params['id'] > 0) {
         $this->check($params['id'], 'r');
     } else {
         // Create item
         $this->check(-1, 'w');
     }
     echo "<form method='POST' \n      action='" . $CFG_GLPI["root_doc"] . "/plugins/formcreator/front/section.form.php'>";
     echo "<input type='hidden' name='plugin_formcreator_forms_id' \n            value='" . $this->fields['plugin_formcreator_forms_id'] . "' />";
     echo "<input type='hidden' name='id' \n            value='" . $this->fields['id'] . "' />";
     echo "<div class='spaced' id='tabsbody'>";
     echo "<table class='tab_cadre_fixe fix_tab_height'>";
     echo "<tr>";
     echo "<th colspan='2'>" . $LANG['plugin_formcreator']["target"][1] . "</th>";
     echo "<th colspan='2'>&nbsp;</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['plugin_formcreator']["target"][8] . "&nbsp;:</td><td>";
     PluginFormcreatorTarget::getSelectTarget($this->fields['plugin_formcreator_forms_id'], 'plugin_formcreator_targets_id', $this->fields['plugin_formcreator_targets_id']);
     echo "</td>";
     echo "<td>" . __('Name') . "&nbsp;:</td>";
     echo "<td>";
     echo '<input type="text" name="name" value="' . $this->fields['name'] . '" size="54"/>';
     echo "</td>";
     echo "</tr>";
     echo '<tr class="tab_bg_1">';
     echo '<td>' . $LANG['plugin_formcreator']["question"][11] . ' :</td>';
     echo '<td><input type="text" name="position" 
                        value="' . $this->fields['position'] . '" size="3" /></td>';
     echo "<td>" . __('Description') . "&nbsp;:</td>";
     echo "<td>";
     echo "<textarea name='content' cols='55' rows='6'>";
     echo $this->fields["content"];
     echo "</textarea>";
     echo "</td>";
     echo '</tr>';
     echo "<tr>";
     echo "<td class='center' colspan='2'>";
     echo "<input class='submit' type='submit' value='" . __('Update') . "' name='update'>";
     echo "</td>";
     echo "<td class='center' colspan='2'>";
     echo "<input class='submit' type='submit' value='" . __('Purge') . "' name='delete'>";
     echo "</td>";
     echo "</tr>";
     echo "</table>";
     echo "</div>";
     Html::closeForm();
 }