public function display() { jimport('joomla.html.pagination'); // get application $app = Zoo::getApplication(); // set toolbar items $this->joomla->set('JComponentTitle', $app->getToolbarTitle(JText::_('Tags'))); JToolBarHelper::deleteList(); ZooHelper::toolbarHelp(); JHTML::_('behavior.tooltip'); // get request vars $state_prefix = $this->option . '_' . $app->id . '.tags.'; $filter_order = $this->joomla->getUserStateFromRequest($state_prefix . 'filter_order', 'filter_order', '', 'cmd'); $filter_order_Dir = $this->joomla->getUserStateFromRequest($state_prefix . 'filter_order_Dir', 'filter_order_Dir', 'desc', 'word'); $limit = $this->joomla->getUserStateFromRequest('global.list.limit', 'limit', $this->joomla->getCfg('list_limit'), 'int'); $limitstart = $this->joomla->getUserStateFromRequest($state_prefix . 'limitstart', 'limitstart', 0, 'int'); $search = $this->joomla->getUserStateFromRequest($state_prefix . 'search', 'search', '', 'string'); $search = JString::strtolower($search); // is filtered ? $this->is_filtered = !empty($search); // in case limit has been changed, adjust limitstart accordingly $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0; // get data $filter = $filter_order ? $filter_order . ' ' . $filter_order_Dir : ''; $this->tags = YTable::getInstance('tag')->getAll($app->id, $search, '', $filter, $limitstart, $limit); $count = (int) YTable::getInstance('tag')->count($app->id); $this->pagination = new JPagination($count, $limitstart, $limit); // table ordering and search filter $this->lists['order_Dir'] = $filter_order_Dir; $this->lists['order'] = $filter_order; $this->lists['search'] = $search; // display view $this->getView()->display(); }
public function add() { // disable menu YRequest::setVar('hidemainmenu', 1); // get application metadata $metadata = $this->application->getMetaData(); // set toolbar items $this->joomla->set('JComponentTitle', $this->application->getToolbarTitle(JText::_('New App') . ': ' . $metadata['name'])); JToolBarHelper::save(); JToolBarHelper::custom('', 'back', '', 'Back', false); ZooHelper::toolbarHelp(); // get params $this->params = $this->application->getParams(); // set default template $this->params->set('template', 'default'); // template select $options = array(JHTML::_('select.option', '', '- ' . JText::_('Select Template') . ' -')); foreach ($this->application->getTemplates() as $template) { $metadata = $template->getMetaData(); $options[] = JHTML::_('select.option', $template->name, $metadata['name']); } $this->lists['select_template'] = JHTML::_('select.genericlist', $options, 'template', '', 'value', 'text', $this->params->get('template')); // display view $this->getView()->setLayout('application')->display(); }
public function display() { // set toolbar items $this->joomla->set('JComponentTitle', $this->application->getToolbarTitle(JText::_('Frontpage'))); JToolBarHelper::save(); ZooHelper::toolbarHelp(); // get params $this->params = $this->application->getParams(); // display view $this->getView()->display(); }
public function edit($tpl = null) { // disable menu YRequest::setVar('hidemainmenu', 1); // get database $this->db = JFactory::getDBO(); // get request vars $cid = YRequest::getArray('cid.0', '', 'int'); $edit = $cid > 0; // get item if ($edit) { $this->submission = YTable::getInstance('submission')->get($cid); } else { $this->submission = new Submission(); $this->submission->application_id = $this->application->id; $this->submission->access = 1; } // set toolbar items $this->joomla->set('JComponentTitle', $this->application->getToolbarTitle(JText::_('Submission') . ': ' . $this->submission->name . ' <small><small>[ ' . ($edit ? JText::_('Edit') : JText::_('New')) . ' ]</small></small>')); JToolBarHelper::save(); JToolBarHelper::custom('saveandnew', 'saveandnew', 'saveandnew', 'Save & New', false); JToolBarHelper::apply(); JToolBarHelper::cancel('cancel', $edit ? 'Close' : 'Cancel'); ZooHelper::toolbarHelp(); // published select $this->lists['select_published'] = JHTML::_('select.booleanlist', 'state', null, $this->submission->state); // tooltip select $this->lists['select_tooltip'] = JHTML::_('select.booleanlist', 'params[show_tooltip]', null, $this->submission->showTooltip()); // type select $this->types = array(); foreach ($this->application->getTypes() as $type) { // list types with submission layouts only if (count(ZooHelper::getLayouts($this->application, $type->id, 'submission')) > 0) { $form = $this->submission->getForm($type->id); $this->types[$type->id]['name'] = $type->name; $options = array(JHTML::_('select.option', '', '- ' . JText::_('not submittable') . ' -')); $this->types[$type->id]['select_layouts'] = JHTML::_('zoo.layoutList', $this->application, $type->id, 'submission', $options, 'params[form][' . $type->id . '][layout]', '', 'value', 'text', $form->get('layout')); $options = array(JHTML::_('select.option', '', '- ' . JText::_('uncategorized') . ' -')); $this->types[$type->id]['select_categories'] = JHTML::_('zoo.categorylist', $this->application, $options, 'params[form][' . $type->id . '][category]', 'size="1"', 'value', 'text', $form->get('category')); } } // display view $this->getView()->setLayout('edit')->display(); }
public function edit() { // disable menu YRequest::setVar('hidemainmenu', 1); // get request vars $cid = YRequest::getArray('cid.0', '', 'int'); $edit = $cid > 0; // get category if ($edit) { $this->category = YTable::getInstance('category')->get($cid); } else { $this->category = new Category(); $this->category->parent = 0; } // get category params $this->params = $this->category->getParams(); // set toolbar items $text = $edit ? JText::_('Edit') : JText::_('New'); $this->joomla->set('JComponentTitle', $this->application->getToolbarTitle(JText::_('Category') . ': ' . $this->category->name . ' <small><small>[ ' . $text . ' ]</small></small>')); JToolBarHelper::save(); JToolBarHelper::custom('saveandnew', 'saveandnew', 'saveandnew', 'Save & New', false); JToolBarHelper::apply(); JToolBarHelper::cancel('cancel', $edit ? 'Close' : 'Cancel'); ZooHelper::toolbarHelp(); // select published state $this->lists['select_published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $this->category->published); // get categories and exclude the current category $categories = $this->application->getCategories(); unset($categories[$this->category->id]); // build category tree $list = CategoryHelper::buildTreeList(0, CategoryHelper::buildTree($this->application->id, $categories)); $options = array(JHTML::_('select.option', '0', JText::_('Root'))); foreach ($list as $item) { $options[] = JHTML::_('select.option', $item->id, ' ' . $item->treename); } // select parent category $this->lists['select_parent'] = JHTML::_('select.genericlist', $options, 'parent', 'class="inputbox" size="10"', 'value', 'text', $this->category->parent); // display view $this->getView()->setLayout('edit')->display(); }
public function assignSubmission() { // disable menu YRequest::setVar('hidemainmenu', 1); // init vars $type = YRequest::getString('type'); $this->template = YRequest::getString('template'); $this->layout = YRequest::getString('layout'); // get type $this->type = $this->application->getType($type); // set toolbar items $this->joomla->set('JComponentTitle', $this->application->getToolbarTitle(JText::_('Type') . ': ' . $this->type->name . ' <small><small>[ ' . JText::_('Assign Submittable elements') . ': ' . $this->layout . ' ]</small></small>')); JToolBarHelper::save('savesubmission'); JToolBarHelper::apply('applysubmission'); JToolBarHelper::cancel('types'); ZooHelper::toolbarHelp(); // for template, module, plugin if ($this->template) { $this->path = $this->application->getPath() . '/templates/' . $this->template; } // get renderer $renderer = new ItemRenderer(); $renderer->addPath($this->path); // get positions and config $this->config = $renderer->getConfig('item')->get($this->group . '.' . $type . '.' . $this->layout); $prefix = 'item.'; if ($renderer->pathExists('item' . DIRECTORY_SEPARATOR . $type)) { $prefix .= $type . '.'; } $this->positions = $renderer->getPositions($prefix . $this->layout); // display view $this->getView()->setLayout('assignsubmission')->display(); }
public function edit($tpl = null) { // disable menu YRequest::setVar('hidemainmenu', 1); // get database $this->db = JFactory::getDBO(); // get request vars $cid = YRequest::getArray('cid.0', '', 'int'); $edit = $cid > 0; // get item if ($edit) { $this->item = YTable::getInstance('item')->get($cid); } else { $this->item = new Item(); $this->item->application_id = $this->application->id; $this->item->type = JRequest::getVar('type'); $this->item->publish_down = $this->db->getNullDate(); } // get item params $this->params = $this->item->getParams(); // set toolbar items $this->joomla->set('JComponentTitle', $this->application->getToolbarTitle(JText::_('Item') . ': ' . $this->item->name . ' <small><small>[ ' . ($edit ? JText::_('Edit') : JText::_('New')) . ' ]</small></small>')); JToolBarHelper::save(); JToolBarHelper::custom('saveandnew', 'saveandnew', 'saveandnew', 'Save & New', false); JToolBarHelper::apply(); JToolBarHelper::cancel('cancel', $edit ? 'Close' : 'Cancel'); ZooHelper::toolbarHelp(); // published select $this->lists['select_published'] = JHTML::_('select.booleanlist', 'state', null, $this->item->state); // published searchable $this->lists['select_searchable'] = JHTML::_('select.booleanlist', 'searchable', null, $this->item->searchable); // categories select $related_categories = $this->item->getRelatedCategoryIds(); $this->lists['select_frontpage'] = JHTML::_('select.booleanlist', 'frontpage', null, in_array(0, $related_categories)); $this->lists['select_categories'] = JHTML::_('zoo.categorylist', $this->application, array(), 'categories[]', 'size="15" multiple="multiple"', 'value', 'text', $related_categories); $this->lists['select_primary_category'] = JHTML::_('zoo.categorylist', $this->application, array(JHTML::_('select.option', '', JText::_('none'))), 'params[primary_category]', '', 'value', 'text', $this->params->get('config.primary_category')); // most used tags $this->lists['most_used_tags'] = YTable::getInstance('tag')->getAll($this->application->id, null, null, 'items DESC, a.name ASC', null, self::MAX_MOST_USED_TAGS); // comments enabled select $this->lists['select_enable_comments'] = JHTML::_('select.booleanlist', 'params[enable_comments]', null, $this->params->get('config.enable_comments', 1)); // display view $this->getView()->setLayout('edit')->display(); }