/** * Displays available options with input fields. * * @param EcrProjectBase $project The project * * @return string HTML */ public function displayOptions(EcrProjectBase $project) { ecrScript('dbtables'); ecrStylesheet('dbtables'); if (false == in_array('mysql', $project->dbTypes)) { $project->dbTypes = array_merge(array('mysql'), $project->dbTypes); } $fields = array(); $field = new EcrTableField(); $field->name = 'catid'; $field->label = 'Category id'; $field->type = 'INT'; $field->length = '11'; $field->attributes = 'UNSIGNED'; $field->null = 'NOT_NULL'; $field->comment = 'Category ID'; $fields[] = $field; $field = new EcrTableField(); $field->name = 'checked_out'; $field->label = 'Checked out'; $field->type = 'INT'; $field->length = '11'; $field->attributes = 'UNSIGNED'; $field->default = '0'; $field->null = 'NOT_NULL'; $fields[] = $field; $html = array(); $html[] = '<script type="text/javascript">'; $html[] = '//--Set object count to 3 - 0 is the standard field "id"'; $html[] = '//-- 1 is "catid" and 2 is "checked_out"'; $html[] = 'var obCount = 3;'; $html[] = 'var obCountOrig = 3;'; $html[] = '</script>'; $html[] = '<h3>' . jgettext('Database support') . '</h3>'; $html[] = EcrHtmlOptions::database($project); $html[] = '<h3>' . jgettext('User defined table fields') . '</h3>'; $html[] = '<strong>' . sprintf(jgettext('Please define the fields for the table %s that will be created for your component.'), '"' . strtolower($project->name) . '"') . '</strong>'; $html[] = EcrTableHelper::startDbEditor(); foreach ($fields as $count => $field) { $html[] = EcrTableHelper::drawPredefinedRow($field, $count + 1); } $html[] = EcrTableHelper::endDbEditor(); return implode(NL, $html); }
<?php defined('_JEXEC') || die('=;)'); /** * @package EasyCreator * @subpackage Views * @author Nikolai Plath * @author Created on 25-Mar-2012 * @license GNU/GPL, see JROOT/LICENSE.php */ ?> <div class="infoHeader img icon24-database"><?php echo jgettext('Database support'); ?> </div> <?php echo EcrHtmlOptions::database($this->project);