Пример #1
0
 /**
  * Method to display the view.
  *
  * @param   string  $tpl  A template file to load. [optional]
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @since   2.5
  */
 public function display($tpl = null)
 {
     // Load plug-in language files.
     FinderHelperLanguage::loadPluginLanguage();
     $this->items = $this->get('Items');
     $this->total = $this->get('Total');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->pluginState = $this->get('pluginState');
     $this->filterForm = $this->get('FilterForm');
     $this->activeFilters = $this->get('ActiveFilters');
     FinderHelper::addSubmenu('index');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     if (!$this->pluginState['plg_content_finder']->enabled) {
         JFactory::getApplication()->enqueueMessage(JText::_('COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED'), 'warning');
     } elseif ($this->get('TotalIndexed') === 0) {
         JFactory::getApplication()->enqueueMessage(JText::_('COM_FINDER_INDEX_NO_DATA') . '  ' . JText::_('COM_FINDER_INDEX_TIP'), 'notice');
     }
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     // Configure the toolbar.
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }
 /**
  * Method to configure the toolbar for this view.
  *
  * @return  void
  *
  * @since   2.5
  */
 protected function addToolbar()
 {
     $canDo = FinderHelper::getActions();
     JToolbarHelper::title(JText::_('COM_FINDER_INDEX_TOOLBAR_TITLE'), 'zoom-in finder');
     $toolbar = JToolbar::getInstance('toolbar');
     $toolbar->appendButton('Popup', 'archive', 'COM_FINDER_INDEX', 'index.php?option=com_finder&view=indexer&tmpl=component', 500, 210, 0, 0, 'window.parent.location.reload()', 'COM_FINDER_HEADING_INDEXER');
     if ($canDo->get('core.edit.state')) {
         JToolbarHelper::publishList('index.publish');
         JToolbarHelper::unpublishList('index.unpublish');
     }
     if ($canDo->get('core.delete')) {
         JToolbarHelper::deleteList('', 'index.delete');
     }
     if ($canDo->get('core.edit.state')) {
         JToolbarHelper::trash('index.purge', 'COM_FINDER_INDEX_TOOLBAR_PURGE', false);
     }
     if ($canDo->get('core.admin')) {
         JToolbarHelper::preferences('com_finder');
     }
     $toolbar->appendButton('Popup', 'stats', 'COM_FINDER_STATISTICS', 'index.php?option=com_finder&view=statistics&tmpl=component', 550, 350);
     JToolbarHelper::help('JHELP_COMPONENTS_FINDER_MANAGE_INDEXED_CONTENT');
     JHtmlSidebar::setAction('index.php?option=com_finder&view=index');
     JHtmlSidebar::addFilter(JText::_('COM_FINDER_INDEX_FILTER_BY_STATE'), 'filter_state', JHtml::_('select.options', JHtml::_('finder.statelist'), 'value', 'text', $this->state->get('filter.state')));
     JHtmlSidebar::addFilter(JText::_('COM_FINDER_INDEX_TYPE_FILTER'), 'filter_type', JHtml::_('select.options', JHtml::_('finder.typeslist'), 'value', 'text', $this->state->get('filter.type')));
 }
Пример #3
0
 /**
  * Method to configure the toolbar for this view.
  *
  * @return  void
  *
  * @since   2.5
  */
 protected function addToolbar()
 {
     $canDo = FinderHelper::getActions();
     JToolbarHelper::title(JText::_('COM_FINDER_FILTERS_TOOLBAR_TITLE'), 'finder');
     $toolbar = JToolbar::getInstance('toolbar');
     if ($canDo->get('core.create')) {
         JToolbarHelper::addNew('filter.add');
         JToolbarHelper::editList('filter.edit');
         JToolbarHelper::divider();
     }
     if ($canDo->get('core.edit.state')) {
         JToolbarHelper::publishList('filters.publish');
         JToolbarHelper::unpublishList('filters.unpublish');
         JToolbarHelper::divider();
     }
     if ($canDo->get('core.delete')) {
         JToolbarHelper::deleteList('', 'filters.delete');
         JToolbarHelper::divider();
     }
     if ($canDo->get('core.admin')) {
         JToolbarHelper::preferences('com_finder');
     }
     JToolbarHelper::divider();
     $toolbar->appendButton('Popup', 'stats', 'COM_FINDER_STATISTICS', 'index.php?option=com_finder&view=statistics&tmpl=component', 550, 350);
     JToolbarHelper::divider();
     JToolbarHelper::help('JHELP_COMPONENTS_FINDER_MANAGE_SEARCH_FILTERS');
     JHtmlSidebar::setAction('index.php?option=com_finder&view=filters');
     JHtmlSidebar::addFilter(JText::_('COM_FINDER_INDEX_FILTER_BY_STATE'), 'filter_state', JHtml::_('select.options', JHtml::_('finder.statelist'), 'value', 'text', $this->state->get('filter.state')));
 }
Пример #4
0
 /**
  * Method to configure the toolbar for this view.
  *
  * @return  void
  *
  * @since   2.5
  */
 protected function addToolbar()
 {
     $canDo = FinderHelper::getActions();
     JToolBarHelper::title(JText::_('COM_FINDER_INDEX_TOOLBAR_TITLE'), 'finder');
     $toolbar = JToolBar::getInstance('toolbar');
     $toolbar->appendButton('Popup', 'archive', 'COM_FINDER_INDEX', 'index.php?option=com_finder&view=indexer&tmpl=component', 500, 210);
     JToolBarHelper::divider();
     if ($canDo->get('core.edit.state')) {
         JToolBarHelper::publishList('index.publish');
         JToolBarHelper::unpublishList('index.unpublish');
         JToolBarHelper::divider();
     }
     if ($canDo->get('core.delete')) {
         JToolBarHelper::deleteList('', 'index.delete');
         JToolBarHelper::divider();
     }
     if ($canDo->get('core.edit.state')) {
         JToolBarHelper::trash('index.purge', 'COM_FINDER_INDEX_TOOLBAR_PURGE', false);
         JToolBarHelper::divider();
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_finder');
     }
     JToolBarHelper::divider();
     $toolbar->appendButton('Popup', 'stats', 'COM_FINDER_STATISTICS', 'index.php?option=com_finder&view=statistics&tmpl=component', 550, 500);
     JToolBarHelper::divider();
     JToolBarHelper::help('JHELP_COMPONENTS_FINDER_MANAGE_INDEXED_CONTENT');
 }
 /**
  * Method to configure the toolbar for this view.
  *
  * @return  void
  *
  * @since   2.5
  */
 protected function addToolbar()
 {
     // For whatever reason, the helper isn't being found
     include_once JPATH_COMPONENT . '/helpers/finder.php';
     $canDo = FinderHelper::getActions();
     JToolbarHelper::title(JText::_('COM_FINDER_MAPS_TOOLBAR_TITLE'), 'zoom-in finder');
     $toolbar = JToolbar::getInstance('toolbar');
     if ($canDo->get('core.edit.state')) {
         JToolbarHelper::publishList('maps.publish');
         JToolbarHelper::unpublishList('maps.unpublish');
         JToolbarHelper::divider();
     }
     if ($canDo->get('core.delete')) {
         JToolbarHelper::deleteList('', 'maps.delete');
         JToolbarHelper::divider();
     }
     if ($canDo->get('core.admin')) {
         JToolbarHelper::preferences('com_finder');
     }
     JToolbarHelper::divider();
     $toolbar->appendButton('Popup', 'stats', 'COM_FINDER_STATISTICS', 'index.php?option=com_finder&view=statistics&tmpl=component', 550, 350);
     JToolbarHelper::divider();
     JToolbarHelper::help('JHELP_COMPONENTS_FINDER_MANAGE_CONTENT_MAPS');
     JHtmlSidebar::setAction('index.php?option=com_finder&view=maps');
     JHtmlSidebar::addFilter('', 'filter_branch', JHtml::_('select.options', JHtml::_('finder.mapslist'), 'value', 'text', $this->state->get('filter.branch')), true);
     JHtmlSidebar::addFilter(JText::_('COM_FINDER_INDEX_FILTER_BY_STATE'), 'filter_state', JHtml::_('select.options', JHtml::_('finder.statelist'), 'value', 'text', $this->state->get('filter.state')));
 }
Пример #6
0
 /**
  * Method to display the view.
  *
  * @param   string  $tpl  A template file to load. [optional]
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @since   2.5
  */
 public function display($tpl = null)
 {
     // Load the view data.
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->total = $this->get('Total');
     $this->state = $this->get('State');
     FinderHelper::addSubmenu('filters');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     // Configure the toolbar.
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }
Пример #7
0
 /**
  * Method to configure the toolbar for this view.
  *
  * @return  void
  *
  * @since   2.5
  */
 protected function addToolbar()
 {
     JFactory::getApplication()->input->set('hidemainmenu', true);
     $user = JFactory::getUser();
     $userId = $user->get('id');
     $isNew = $this->item->filter_id == 0;
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
     $canDo = FinderHelper::getActions();
     // Configure the toolbar.
     JToolbarHelper::title(JText::_('COM_FINDER_FILTER_EDIT_TOOLBAR_TITLE'), 'finder');
     // Set the actions for new and existing records.
     if ($isNew) {
         // For new records, check the create permission.
         if ($canDo->get('core.create')) {
             JToolbarHelper::apply('filter.apply');
             JToolbarHelper::save('filter.save');
             JToolbarHelper::save2new('filter.save2new');
         }
         JToolbarHelper::cancel('filter.cancel');
     } else {
         // Can't save the record if it's checked out.
         if (!$checkedOut) {
             // Since it's an existing record, check the edit permission.
             if ($canDo->get('core.edit')) {
                 JToolbarHelper::apply('filter.apply');
                 JToolbarHelper::save('filter.save');
                 // We can save this record, but check the create permission to see if we can return to make a new one.
                 if ($canDo->get('core.create')) {
                     JToolbarHelper::save2new('filter.save2new');
                 }
             }
         }
         // If an existing item, can save as a copy
         if ($canDo->get('core.create')) {
             JToolbarHelper::save2copy('filter.save2copy');
         }
         JToolbarHelper::cancel('filter.cancel', 'JTOOLBAR_CLOSE');
     }
     JToolbarHelper::divider();
     JToolbarHelper::help('JHELP_COMPONENTS_FINDER_MANAGE_SEARCH_FILTERS_EDIT');
 }
Пример #8
0
 /**
  * Method to display a view.
  *
  * @param   boolean  $cachable   If true, the view output will be cached
  * @param   array    $urlparams  An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  *
  * @return	JController  A JController object to support chaining.
  *
  * @since	2.5
  */
 public function display($cachable = false, $urlparams = array())
 {
     include_once JPATH_COMPONENT . '/helpers/finder.php';
     // Set the variables.
     $input = JFactory::getApplication()->input;
     // Load the submenu.
     FinderHelper::addSubmenu($input->get('view', 'index', 'word'));
     $view = $input->get('view', 'index', 'word');
     $layout = $input->get('layout', 'index', 'word');
     $id = $input->get('id', null, 'int');
     $f_id = $input->get('filter_id', null, 'int');
     // Check for edit form.
     if ($view == 'filter' && $layout == 'edit' && !$this->checkEditId('com_finder.edit.filter', $f_id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $f_id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_finder&view=filters', false));
         return false;
     }
     parent::display();
     return $this;
 }
Пример #9
0
 /**
  * Method to display the view.
  *
  * @param   string  $tpl  A template file to load. [optional]
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @since   2.5
  */
 public function display($tpl = null)
 {
     // Load plug-in language files.
     FinderHelperLanguage::loadPluginLanguage();
     $this->items = $this->get('Items');
     $this->total = $this->get('Total');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->pluginState = $this->get('pluginState');
     $this->filterForm = $this->get('FilterForm');
     $this->activeFilters = $this->get('ActiveFilters');
     FinderHelper::addSubmenu('index');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     // Configure the toolbar.
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }
Пример #10
0
 /**
  * Method to configure the toolbar for this view.
  *
  * @return  void
  *
  * @since   2.5
  */
 protected function addToolbar()
 {
     // For whatever reason, the helper isn't being found
     include_once JPATH_COMPONENT . '/helpers/finder.php';
     $canDo = FinderHelper::getActions();
     JToolBarHelper::title(JText::_('COM_FINDER_MAPS_TOOLBAR_TITLE'), 'finder');
     $toolbar = JToolBar::getInstance('toolbar');
     if ($canDo->get('core.edit.state')) {
         JToolBarHelper::publishList('maps.publish');
         JToolBarHelper::unpublishList('maps.unpublish');
         JToolBarHelper::divider();
     }
     if ($canDo->get('core.delete')) {
         JToolBarHelper::deleteList('', 'maps.delete');
         JToolBarHelper::divider();
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_finder');
     }
     JToolBarHelper::divider();
     $toolbar->appendButton('Popup', 'stats', 'COM_FINDER_STATISTICS', 'index.php?option=com_finder&view=statistics&tmpl=component', 550, 500);
     JToolBarHelper::divider();
     JToolBarHelper::help('JHELP_COMPONENTS_FINDER_MANAGE_CONTENT_MAPS');
 }