function prepareDisplay() { $app = JFactory::getApplication(); $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->option = $app->input->get('option', ''); $this->state = $this->get('State'); // Check Errors if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } if (@$this->item->id > 0) { $this->isNew = 0; $this->panel_class = 'closed'; $this->panel_style = 'display:none; '; $name = $this->item->name; } else { $this->isNew = 1; $this->panel_class = 'open'; $this->panel_style = ''; $name = ''; } $this->item->folder = Helper_Admin::getSelected($this->vName, 'folder', $this->item->folder, 1); $this->item->published = Helper_Admin::getSelected($this->vName, 'state', $this->item->published, 1); $this->item->client = $this->isNew ? 'admin' : $app->input->getString('client', $app->input->cookie->getString('cck_type' . $name . '_client', 'admin')); $this->item->master = $this->item->client == 'content' || $this->item->client == 'intro' ? 'content' : 'form'; $this->item->layer = $app->input->getString('layer', 'fields'); $P = 'template_' . $this->item->client; $this->style = Helper_Workshop::getTemplateStyle($this->vName, $this->item->{$P}, $this->state->get('tpl.' . $this->item->client, Helper_Workshop::getDefaultTemplate())); $this->item->template = $this->style->template; Helper_Admin::addToolbarEdit($this->vName, 'COM_CCK_' . _C2_TEXT, array('isNew' => $this->isNew, 'folder' => $this->state->get('filter.folder'), 'checked_out' => $this->item->checked_out), array('template' => $this->style->template)); }
function prepareDisplay() { $app = JFactory::getApplication(); $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->option = $app->input->get('option', ''); $this->state = $this->get('State'); // Check Errors if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } $this->item->cck_type = $this->state->get('content_type', ''); $this->item->skip = $this->state->get('skip'); if (@$this->item->id > 0) { $this->isNew = 0; $this->panel_class = 'closed'; $this->panel_style = 'display:none; '; $name = $this->item->name; $app->setUserState(CCK_COM . '.edit.search.client', NULL); } else { $this->isNew = 1; $this->panel_class = 'open'; $this->panel_style = ''; $name = ''; if ($this->item->cck_type != '') { $this->item->storage_location = JCckDatabase::loadResult('SELECT storage_location FROM #__cck_core_types WHERE name = "' . $this->item->cck_type . '"'); if ($this->item->storage_location == 'none') { $this->item->storage_location = ''; } } $this->tpl_list = $this->state->get('tpl.list'); } $this->item->folder = Helper_Admin::getSelected($this->vName, 'folder', $this->item->folder, 1); $this->item->published = Helper_Admin::getSelected($this->vName, 'state', $this->item->published, 1); if ($this->item->skip != '') { $this->item->client = $this->item->skip; $this->item->master = $this->item->client == 'list' || $this->item->client == 'item' ? 'content' : ($this->item->client == 'order' ? 'order' : 'search'); $this->item->layer = $app->input->getString('layer', 'fields'); $P = 'template_' . $this->item->client; $force_template = $this->item->client == 'list' ? $this->state->get('tpl.list') : Helper_Workshop::getDefaultTemplate(); } else { $this->item->client = $this->isNew ? 'search' : $this->state->get('client', $app->input->cookie->getString('cck_search' . $name . '_client', 'search')); $this->item->master = $this->item->client == 'list' || $this->item->client == 'item' ? 'content' : ($this->item->client == 'order' ? 'order' : 'search'); $this->item->layer = $app->input->getString('layer', 'fields'); $P = 'template_' . $this->item->client; $force_template = $this->item->client == 'list' ? '' : Helper_Workshop::getDefaultTemplate(); } $this->style = $this->item->client != 'order' ? Helper_Workshop::getTemplateStyle($this->vName, $this->item->{$P}, $this->state->get('tpl.' . $this->item->client, $force_template)) : ''; $this->item->template = isset($this->style->template) ? $this->style->template : ''; $this->insidebox = Helper_Admin::addInsidebox($this->isNew); Helper_Admin::addToolbarEdit($this->vName, 'COM_CCK_' . _C4_TEXT, array('isNew' => $this->isNew, 'folder' => $this->state->get('filter.folder'), 'checked_out' => $this->item->checked_out), array('template' => $this->item->template)); }
public function getItemsSelect() { $items = array(); $template = Helper_Workshop::getDefaultTemplate(); $options = JCckDatabase::loadObjectList('SELECT a.name AS value, a.title AS text FROM #__cck_core_templates AS a WHERE a.mode = 1 AND a.published = 1 ORDER BY a.title asc'); $items['admin'] = Jhtml::_('select.genericlist', $options, 'template_admin', 'class="inputbox" size="1" style="margin-bottom: 8px;"', 'value', 'text', $template); $items['site'] = Jhtml::_('select.genericlist', $options, 'template_site', 'class="inputbox" size="1" style="margin-bottom: 8px;"', 'value', 'text', $template); $options = JCckDatabase::loadObjectList('SELECT a.name AS value, a.title AS text FROM #__cck_core_templates AS a WHERE a.mode = 0 AND a.published = 1 ORDER BY a.title asc'); $items['content'] = Jhtml::_('select.genericlist', $options, 'template_content', 'class="inputbox" size="1" style="margin-bottom: 8px;"', 'value', 'text', $template); return $items; }