public function display($tpl = null) { // Automatically fetch the item and assign it to the layout $this->fetchItem(); // Common lists $parent_id_params = array('nullvalue' => 1, 'nulltitle' => JText::_('No parent'), 'current' => $this->item->parent_id, 'self' => $this->item->id); $this->lists['parent_id'] = SimplelistsHTML::selectCategories('parent_id', $parent_id_params); // Construct the modal boxes $modal = array(); //$modal['image'] = 'index.php?option=com_simplelists&view=files&tmpl=component&type=picture' ; //$modal['image'] .= ($this->item->image) ? '&folder=/'.dirname($this->item->image).'&current='.$this->item->image : '&current='; $this->assignRef('modal', $modal); // Construct the slider-panel jimport('joomla.html.pane'); $pane =& JPane::getInstance('sliders'); $this->assignRef('pane', $pane); // Add jQuery if (JFactory::getApplication()->get('jquery') == false) { $this->addJs('jquery.js'); JFactory::getApplication()->set('jquery', true); } // Add extra JavaScript JHTML::_('behavior.formvalidation'); $this->addJs('form-validation.js'); parent::display($tpl); }
function fetchElement($name, $value, &$node, $control_name) { if (!empty($control_name)) { $fieldName = $control_name . '[' . $name . ']'; } else { $fieldName = $name; } $categories_params = array('current' => $value, 'nullvalue' => 1); return SimplelistsHTML::selectCategories($fieldName, $categories_params); }
public function display($tpl = null) { // Give a warning if no categories are configured SimplelistsHelper::checkCategories(); // Fetch the item automatically $this->fetchItem(true); // Modify the item a bit $this->item->image_default_folder = COM_SIMPLELISTS_DIR; $this->item->image_default_uri = COM_SIMPLELISTS_BASEURL; $this->item->picture_folder = $this->item->image_default_folder; $this->item->picture_uri = $this->item->image_default_uri; $this->item->picture_path = null; if (!empty($this->item->picture)) { $this->item->picture_path = JPATH_SITE . DS . $this->item->picture; $this->item->picture_uri = str_replace(DS, '/', $this->item->picture); $this->item->picture_folder = dirname($this->item->picture_uri); } // Add extra filtering lists $defaultCategory = $this->item->id == 0 ? (int) $this->getFilter('category_id', null, null, 'com_simplelists_items_') : null; $categories_params = array('item_id' => $this->item->id, 'multiple' => 1, 'current' => $defaultCategory); $this->lists['categories'] = SimplelistsHTML::selectCategories('categories[]', $categories_params); // Construct the modal boxes $modal = array(); $modal['picture'] = 'index.php?option=com_simplelists&view=files&tmpl=component&type=picture&current=' . $this->item->picture; if ($this->item->picture) { $modal['picture'] .= '&folder=' . $this->item->picture_folder; } $this->assignRef('modal', $modal); // Construct the slider-panel jimport('joomla.html.pane'); $pane =& JPane::getInstance('sliders'); $this->assignRef('pane', $pane); // Include extra JavaScript $this->addJs('mootools-cookie.js'); $this->addJs('view-browser.js'); // Load the plugins $link_plugins = SimplelistsPluginHelper::getPlugins('simplelistslink'); $this->assignRef('link_plugins', $link_plugins); // Add extra stuff JHTML::_('behavior.tooltip'); JHTML::_('behavior.modal', 'a.modal-button'); parent::display($tpl); }
public function display($tpl = null) { // Set extra toolbar items for the page JToolBarHelper::preferences('com_simplelists', '480'); //JToolBarHelper::help( 'screen.simplelist' ); // Preliminary check to see if any categories have been configured yet SimplelistsHelper::checkCategories(); // Automatically fetch items, total and pagination - and assign them to the template $this->fetchItems(); // Prepare data for each simplelists item foreach ($this->items as $index => $item) { $item->categories = SimplelistsHelper::getCategories($item->id); $item->edit_link = JRoute::_('index.php?option=com_simplelists&view=item&task=edit&cid[]=' . $item->id); $this->items[$index] = $item; } // build list of categories $category_id_params = array('current' => $this->getFilter('category_id'), 'javascript' => 1, 'nullvalue' => 1); $this->lists['category_id'] = SimplelistsHTML::selectCategories('filter_category_id', $category_id_params); $this->lists['link_type'] = SimplelistsHTML::selectLinkType($this->getFilter('link_type')); parent::display($tpl); }
protected function getInput() { $categories_params = array('current' => $this->value, 'nullvalue' => 1); return SimplelistsHTML::selectCategories($this->name, $categories_params); }