/**
  * Display function
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a Error object.
  *
  * @since    1.7.0
  */
 public function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     ChurchDirectoryHelper::addSubmenu('info');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JFactory::getApplication()->enqueueMessage(implode("\n", $errors), 'error');
         return false;
     }
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     // Display the template
     return parent::display($tpl);
 }
 /**
  * Display the view
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return    mixed
  *
  * @since 1.7.0
  */
 public function display($tpl = null)
 {
     $language = JFactory::getLanguage();
     $language->load('com_installer');
     ChurchDirectoryHelper::addSubmenu('database');
     if (version_compare(JVERSION, '3.0', 'ge')) {
         $this->sidebar = JHtmlSidebar::render();
     }
     // Get data from the model for database
     $this->changeSet = $this->get('Items');
     $this->errors = $this->changeSet->check();
     $this->results = $this->changeSet->getStatus();
     $this->schemaVersion = $this->get('SchemaVersion');
     $this->updateVersion = $this->get('UpdateVersion');
     $this->filterParams = $this->get('DefaultTextFilters');
     $this->schemaVersion = $this->schemaVersion ? $this->schemaVersion : JText::_('JNONE');
     $this->updateVersion = $this->updateVersion ? $this->updateVersion : JText::_('JNONE');
     $this->pagination = $this->get('Pagination');
     $this->errorCount = count($this->errors);
     $this->jversion = $this->get('CompVersion');
     // End for database
     $errors = count($this->errors);
     if (!(strncmp($this->schemaVersion, $this->jversion, 5) === 0)) {
         $this->errorCount++;
     }
     if (!$this->filterParams) {
         $this->errorCount++;
     }
     if ($this->updateVersion != $this->jversion) {
         $this->errorCount++;
     }
     $this->setLayout('form');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JFactory::getApplication()->enqueueMessage(implode("\n", $errors), 'error');
         return false;
     }
     // Set the toolbar
     $this->addToolbar();
     // Display the template
     return parent::display($tpl);
 }
 /**
  * Display the view
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a Error object.
  *
  * @since    1.7.0
  */
 public function display($tpl = null)
 {
     // Assign data to the view
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->filterForm = $this->get('FilterForm');
     $this->activeFilters = $this->get('ActiveFilters');
     ChurchDirectoryHelper::addSubmenu('members');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JFactory::getApplication()->enqueueMessage(implode("\n", $errors), 'error');
         return false;
     }
     // Set the toolbar
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     // Display the template
     return parent::display($tpl);
 }
 /**
  * Display Function
  *
  * @param   string  $tpl  ?
  *
  * @return mixed
  *
  * @since 1.7.0
  */
 public function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $component = JPATH_ADMINISTRATOR . '/components/com_churchdirectory/churchdirectory.xml';
     if (file_exists($component)) {
         $this->xml = simplexml_load_file($component);
     }
     ChurchDirectoryHelper::addSubmenu('cpanel');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JFactory::getApplication()->enqueueMessage(implode("\n", $errors), 'error');
         return false;
     }
     // Set the toolbar
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     // Display the template
     return parent::display($tpl);
 }
 /**
  * Display the view
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a Error object.
  *
  * @since    1.7.0
  */
 public function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->filterForm = $this->get('FilterForm');
     $this->activeFilters = $this->get('ActiveFilters');
     ChurchDirectoryHelper::addSubmenu('positions');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JFactory::getApplication()->enqueueMessage(implode("\n", $errors), 'error');
         return false;
     }
     // Preprocessors the list of items to find ordering divisions.
     // TODO: Complete the ordering stuff with nested sets
     foreach ($this->items as &$item) {
         $item->order_up = true;
         $item->order_dn = true;
     }
     // We don't need toolbar in the modal window.
     if ($this->getLayout() !== 'modal') {
         $this->addToolbar();
         $this->sidebar = JHtmlSidebar::render();
     } else {
         // In article associations modal we need to remove language filter if forcing a language.
         // We also need to change the category filter to show show categories with All or the forced language.
         if ($forcedLanguage = JFactory::getApplication()->input->get('forcedLanguage', '', 'CMD')) {
             // If the language is forced we can't allow to select the language, so transform the language selector filter into an hidden field.
             $languageXml = new SimpleXMLElement('<field name="language" type="hidden" default="' . $forcedLanguage . '" />');
             $this->filterForm->setField($languageXml, 'filter', true);
             // Also, unset the active language filter so the search tools is not open by default with this filter.
             unset($this->activeFilters['language']);
             // One last changes needed is to change the category filter to just show categories with All language or with the forced language.
             $this->filterForm->setFieldAttribute('category_id', 'language', '*,' . $forcedLanguage, 'filter');
         }
     }
     // Display the template
     return parent::display($tpl);
 }
 /**
  * Display the view
  *
  * @param   string  $tpl  ?
  *
  * @since 1.7.0
  *
  * @return    mixed
  */
 public function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->filterForm = $this->get('FilterForm');
     $this->activeFilters = $this->get('ActiveFilters');
     ChurchDirectoryHelper::addSubmenu('dirheaders');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JFactory::getApplication()->enqueueMessage(implode("\n", $errors), 'error');
         return false;
     }
     // Set the toolbar
     $this->addToolbar();
     if (version_compare(JVERSION, '3.0', 'ge')) {
         $this->sidebar = JHtmlSidebar::render();
     }
     // Set the document
     $this->setDocument();
     // Display the template
     return parent::display($tpl);
 }