public function initialize() { $buffer = array(); foreach ($this->tables as $table) { $buffer[] = "DROP TABLE IF EXISTS #__" . $table->dbname . ";"; } $this->template->addPlaceholders(array("code" => implode("\n", $buffer))); return parent::initialize(); }
protected function initialize() { // Global translations $this->getLanguage()->addKeys(array("COM_" . strtoupper($this->component->name) => $this->component->display_name), "", false); $this->getLanguage()->addKeys(array("N_ITEMS_UNPUBLISHED" => JText::_('COM_JDEVELOPER_N_ITEMS_UNPUBLISHED'), "N_ITEMS_ARCHIVED" => JText::_('COM_JDEVELOPER_N_ITEMS_ARCHIVED'), "N_ITEMS_TRASHED" => JText::_('COM_JDEVELOPER_N_ITEMS_TRASHED'), "N_ITEMS_DELETED" => JText::_('COM_JDEVELOPER_N_ITEMS_DELETED'), "PARAMS_FIELDSET_LABEL" => JText::_('COM_JDEVELOPER_PARAMS_FIELDSET_LABEL'))); // System translations $this->getLanguage("sys")->addKeys(array("COM_" . strtoupper($this->component->name) => $this->component->display_name), "", false); $this->getLanguage("sys")->addKeys(array(strtoupper($this->component->name) => $this->component->display_name), "", false); return parent::initialize(); }
protected function initialize() { $buffer = array(); foreach ($this->tables as $table) { $create = JDeveloperCreate::getInstance("table.admin.sql", array("item_id" => $table->id)); $buffer[] = $create->getBuffer(); } $this->template = new JDeveloperTemplate(implode("\n\n", $buffer), false); return parent::initialize(); }
public function initialize() { $buffer = array(); $model = $this->getModel("Field"); $db = JFactory::getDbo(); foreach ($this->tables as $table) { if (in_array($table->dbname, $db->getTableList())) { $add = JDeveloperHelperTable::missingExtern($table->id, "#__" . $table->dbname); $drop = JDeveloperHelperTable::missingIntern($table->id, "#__" . $table->dbname); foreach ($add as $field) { $buffer[] = "ALTER TABLE #__{$table->dbname} ADD " . $model->toSQL($field) . ";"; } foreach ($drop as $column) { $buffer[] = "ALTER TABLE #__{$table->dbname} DROP `" . $column->Field . "`;"; } } } if (!empty($buffer)) { $this->template->addPlaceholders(array("code" => implode("\n", $buffer))); } else { $this->template->addPlaceholders(array("code" => "\n")); } return parent::initialize(); }
/** * @see JDeveloperCreateComponent::initialize() */ protected function initialize() { $this->template->addPlaceholders(array("fields" => $this->getConfigFields(), "form" => $this->getForm($this->component->form_id))); return parent::initialize(); }
protected function initialize() { $this->template->addPlaceHolders(array('getfields' => $this->getFields(), 'submenu' => $this->submenu())); return parent::initialize(); }
protected function initialize() { $this->template->addPlaceHolders(array("Sections" => $this->sections(), "form" => $this->getForm($this->component->form_id_access))); return parent::initialize(); }
protected function initialize() { $this->template->addPlaceHolders(array('items' => $this->getItemRoute())); return parent::initialize(); }
protected function initialize() { $this->template->addPlaceHolders(array('author' => $this->component->get('author'), 'author_email' => $this->component->get('author_email'), 'author_url' => $this->component->get('author_url'), 'copyright' => $this->component->get('copyright'), 'creationdate' => date("M Y"), 'licence' => $this->component->get('licence'), 'languages_site' => $this->langSite(), 'languages_admin' => $this->langAdmin(), 'submenus' => $this->submenus(), 'updatefiles' => $this->updateFiles(), 'version' => $this->component->get('version'))); $this->template->addAreas(array('dbtables' => !empty($this->tables), 'frontend' => $this->component->site, 'mvc' => !empty($this->tables))); return parent::initialize(); }