/** * @param $model PluginDatainjectionModel object * @param $canedit (false by default) **/ static function showAddInfo(PluginDatainjectionModel $model, $canedit = false) { if ($canedit) { echo "<form method='post' name='form' id='form' action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "'>"; echo "<table class='tab_cadre_fixe'>"; echo "<tr>"; echo "<th>" . __('Tables', 'datainjection') . "</th>"; echo "<th>" . _n('Field', 'Fields', 2) . "</th>"; echo "<th>" . __('Mandatory information', 'datainjection') . "</th>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td class='center'>"; $infos_id = -1; $info = new PluginDatainjectionInfo(); $info->fields['id'] = -1; $info->fields['models_id'] = $model->fields['id']; $info->getEmpty(); $rand = PluginDatainjectionInjectionType::dropdownLinkedTypes($info, array('primary_type' => $model->fields['itemtype'])); echo "</td>"; echo "<td class='center'><span id='span_field_{$infos_id}'></span></td>"; echo "<td class='center'><span id='span_mandatory_{$infos_id}'></span></td>"; echo "</tr>"; echo "<tr>"; echo "<td class='tab_bg_2 center' colspan='4'>"; echo "<input type='hidden' name='models_id' value='" . $model->fields['id'] . "'>"; echo "<input type='submit' name='update' value='" . _sx('button', 'Add') . "' class='submit' >"; echo "</td></tr>"; echo "</table>"; Html::closeForm(); echo "<br/>"; } }