/** * Get insert options. * * @return void */ public function getOptions() { $db = JFactory::getDBO(); $tables = $db->getTableList(); $ajaxLink = 'index.php?option=com_easycreator&tmpl=component&controller=ajax&task=part_task'; $ajaxLink .= '&group=tables&part=admin_map'; $ajaxLink .= '&part_task=show_tablefields'; $ajax = "new Request({ url: '" . $ajaxLink . "'+'&table_name='+this.value, update:'addPartTableFields', onComplete: function() '\n .'{ div_new_element.show(); } }).send();"; echo '<strong id="table_name_label">' . jgettext('Table') . ' :</strong>'; echo '<select name="table_name" id="table_name" onchange="' . $ajax . '">'; echo '<option value="">' . jgettext('Choose') . '...</option>'; $prefix = $db->getPrefix(); foreach ($tables as $table) { $v = str_replace($prefix, '', $table); echo '<option value="' . $v . '">' . $v . '</option>'; } //foreach echo '</select>'; echo '<div id="addPartTableFields"></div>'; EcrHtmlSelect::name(); echo '<strong>' . jgettext('Menu link') . ' :</strong><br />'; echo '<input type="checkbox" name="create_menu_link" checked="checked"' . ' id="create_menu_link" value="create_menu_link">'; echo '<label for="create_menu_link">' . jgettext('Create a menu link') . '</label><br />'; echo '<hr />'; EcrHtmlOptions::logging(); $requireds = array('element_name', 'table_name'); EcrHtmlButton::submitParts($requireds); }
/** * Get insert options. * * @return void */ public function getOptions() { EcrHtmlSelect::scope(); EcrHtmlSelect::name(); EcrHtmlOptions::logging(); $requireds = array('element_name', 'element_scope'); EcrHtmlButton::submitParts($requireds); }
/** * Get insert options. * * @return void|boolean false on error */ public function getOptions() { $ecr_project = JFactory::getApplication()->input->get('ecr_project'); $basePathDest = JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . $ecr_project; if (JFile::exists($basePathDest . DS . 'CHANGELOG.php')) { EcrHtml::message(jgettext('This project already has a changelog'), 'error'); return false; } EcrHtmlOptions::logging(); EcrHtmlButton::submitParts(); }
/** * Get insert options. * * @return void|boolean false on error */ public function getOptions() { // $project = EcrProjectHelper::getProject(); $ecr_project = JFactory::getApplication()->input->get('ecr_project'); $basePathDest = JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . $ecr_project; if (JFile::exists($basePathDest . DS . 'install' . DS . 'script.php')) { EcrHtml::message(jgettext('This project already has an install file - consider removing it'), 'error'); return false; } EcrHtmlOptions::logging(); EcrHtmlButton::submitParts(); return $this; }
/** * 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); }
/** * Here you define custom options that will be displayed along with the input form. * * @return void */ public function getOptions() { /* Array with required fields */ $requireds = array(); $requireds[] = EcrHtmlSelect::scope($this->scope); if (!$this->element) { $db = JFactory::getDBO(); $tables = $db->getTableList(); $prefix = $db->getPrefix(); echo '<strong id="element_label">' . jgettext('Table') . '</strong> : '; echo '<select name="element" id="table_name" onchange="$(\'element_name\').value=$(\'element\').value;">'; echo '<option value="">' . jgettext('Choose') . '...</option>'; foreach ($tables as $table) { $v = str_replace($prefix, '', $table); echo '<option value="' . $v . '">' . $v . '</option>'; } //foreach echo '</select>'; echo '<br />'; } else { echo '<input type="hidden" name="element" value="' . $this->element . '" />'; } /* Draws an input box for a name field */ $requireds[] = EcrHtmlSelect::name($this->element, jgettext('Table')); echo '<strong>Var Scope:</strong><br />'; foreach ($this->varScopes as $vScope) { $checked = $vScope == 'var' ? ' checked="checked"' : ''; echo '<input type="radio" name="var_scope" value="' . $vScope . '"' . ' id="vscope-' . $vScope . '"' . $checked . '> <label for="vscope-' . $vScope . '">' . $vScope . '</label><br />'; } //foreach /* * Add your custom options * ... */ /* Displays options for logging */ EcrHtmlOptions::logging(); /* Draws the submit button */ EcrHtmlButton::submitParts($requireds); }
<?php defined('_JEXEC') || die('=;)'); /** * @package EasyCreator * @subpackage Views * @author Nikolai Plath * @author Created on 03-Jun-2012 * @license GNU/GPL, see JROOT/LICENSE.php */ ?> <div class="infoHeader img icon24-package_creation"> <?php echo jgettext('Build options'); ?> </div> <?php EcrHtmlOptions::logging();
/** * Get insert options. * * @return void */ public function getOptions() { $input = JFactory::getApplication()->input; /* Array with required fields */ $requireds = array(); $tableName = $input->get('element'); $db = JFactory::getDBO(); $tables = $db->getTableList(); $requireds[] = EcrHtmlSelect::name($tableName); $requireds[] = EcrHtmlSelect::scope($this->_scope); if (!$tableName) { $ajaxLink = 'index.php?option=com_easycreator&tmpl=component&controller=ajax&task=part_task'; $ajaxLink .= '&group=views&part=data_list'; $ajaxLink .= '&part_task=show_tablefields'; $ajax = "new Request({ url: '" . $ajaxLink . "'+'&element='+this.value, '\n .' update:'addPartTableFields', onComplete: function() { div_new_element.show(); } }).send();"; echo '<strong id="table_name_label">' . jgettext('Table') . ' :</strong>'; echo '<select name="table_name" id="table_name" onchange="' . $ajax . '">'; echo '<option value="">' . jgettext('Choose...') . '</option>'; $prefix = $db->getPrefix(); foreach ($tables as $table) { $v = str_replace($prefix, '', $table); echo '<option value="' . $v . '">' . $v . '</option>'; } //foreach echo '</select>'; echo '<div id="addPartTableFields"></div>'; } else { $this->show_tablefields($tableName); echo '<input type="hidden" name="table_name" value="' . $tableName . '" />'; } // echo '<strong>'.jgettext('Menu link').' :</strong><br />'; // echo '<input type="checkbox" name="create_menu_link" //checked="checked" id="create_menu_link" value="create_menu_link">'; // echo '<label for="create_menu_link">'.jgettext('Create a menu link').'</label><br />'; echo '<hr />'; EcrHtmlOptions::logging(); EcrHtmlButton::submitParts($requireds); }
/* @var EcrProjectModelBuildpreset $preset */ $preset = $this->preset; ?> <div class="infoHeader imgbarleft icon24-info"> <?php echo jgettext('Options'); ?> </div> <p> <strong><?php echo jgettext('Packing format options'); ?> :</strong> <?php EcrHtmlOptions::packing($this->project->presets['default']); ?> </p> <p> <strong class="img icon16-joomla"> <?php echo jgettext('Joomla! version'); ?> </strong> </p> <p> <!-- @Joomla!-version-check --> <input type="radio" id="jversion25" name="jcompat" value="2.5" <?php echo '2.5' == $this->project->JCompat ? ' checked="checked"' : '';
?> "/> <?php if ($this->project->zipPath && false == JFolder::exists($this->project->zipPath)) { EcrHtml::message(sprintf(jgettext('The folder %s does not exist'), $this->project->zipPath), 'warning'); } ?> </fieldset> <h4><?php echo jgettext('Compression'); ?> </h4> <?php EcrHtmlOptions::packing($preset); ?> <hr/> <h4><?php echo jgettext('Options'); ?> </h4> <input type="checkbox" name="buildopts[]" id="createIndexhtml" <?php echo 'ON' == $preset->createIndexhtml ? ' checked="checked"' : ''; ?> value="createIndexhtml"/> <label class="inline" for="createIndexhtml">
<?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);
/** * @package EasyCreator * @subpackage Views * @author Nikolai Plath (elkuku) * @author Created on 21-Mar-2010 * @license GNU/GPL, see JROOT/LICENSE.php */ //-- No direct access defined('_JEXEC') || die('=;)'); /* @var EasyCreatorViewStuffer $this */ ?> <div class="ecr_floatbox"> <div class="infoHeader img icon24-easycreator">AutoCode</div> <h4><?php echo jgettext('List postfix'); ?> </h4> <?php echo $this->project->listPostfix; ?> <h4><?php echo jgettext('File header template'); ?> </h4> <?php echo EcrHtmlOptions::header($this->project->headerType); ?> </div>