Beispiel #1
0
 function prepareDisplay()
 {
     $app = JFactory::getApplication();
     $this->form = $this->get('Form');
     $this->option = $app->input->get('option', '');
     $this->item = $this->get('Item');
     $this->state = $this->get('State');
     // Check Errors
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->isNew = @$this->item->id > 0 ? 0 : 1;
     $this->item->parent_id = Helper_Admin::getSelected($this->vName, 'folder', Helper_Folder::getParent($this->item->id), 2);
     $this->item->parent_db = !$this->isNew ? $this->item->parent_id : null;
     $this->insidebox = Helper_Admin::addInsidebox($this->isNew);
     Helper_Admin::addToolbarEdit($this->vName, 'COM_CCK_' . _C0_TEXT, array('isNew' => $this->isNew, 'folder' => $this->state->get('filter.folder'), 'checked_out' => $this->item->checked_out));
 }
Beispiel #2
0
 function prepareDisplay()
 {
     $app = JFactory::getApplication();
     $model = $this->getModel();
     $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->isNew = @$this->item->id > 0 ? 0 : 1;
     $this->item->folder = Helper_Admin::getSelected($this->vName, 'folder', $this->item->folder, 1);
     $this->item->published = Helper_Admin::getSelected($this->vName, 'state', $this->isNew ? $this->state->get('ajax.state') : $this->item->published, 1);
     $this->item->type = Helper_Admin::getSelected($this->vName, 'type', $app->input->getString('ajax_type', $this->state->get('ajax.type', $this->item->type)), 'text');
     $this->insidebox = Helper_Admin::addInsidebox($this->isNew);
     Helper_Admin::addToolbarEdit($this->vName, _C3_TEXT, array('isNew' => $this->isNew, 'folder' => $this->state->get('filter.folder'), 'checked_out' => $this->item->checked_out));
 }
Beispiel #3
0
 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));
 }
 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;
         $app->setUserState(CCK_COM . '.edit.type.client', NULL);
     } else {
         $this->isNew = 1;
         $this->panel_class = 'open';
         $this->panel_style = '';
         $name = '';
         $featured = $this->state->get('skeleton_id', 0);
         if ($featured == 11) {
             $this->item->storage_location = 'joomla_category';
         } elseif ($featured == 13) {
             $this->item->storage_location = 'joomla_user';
         } elseif ($featured == 14) {
             $this->item->storage_location = 'joomla_user_group';
         }
     }
     $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' : $this->state->get('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, 'seb_one'));
     $this->item->template = $this->style->template;
     $this->insidebox = Helper_Admin::addInsidebox($this->isNew);
     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));
 }