/** * 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) { // Initialise variables. $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->state = $this->get('State'); $user = JFactory::getUser(); $this->groups = $user->groups; /* Get Age of Member */ $this->age = ChurchDirectoryHelper::getAge($this->form->getValue('birthdate')); // Check for errors. if (count($errors = $this->get('Errors'))) { JFactory::getApplication()->enqueueMessage(implode("\n", $errors), 'error'); return false; } $itemacess = $this->state->params->get('protectedaccess'); $groups = $this->groups; if (isset($groups[$itemacess]) || isset($groups['8'])) { $this->access = true; } else { $this->access = false; } // Set the toolbar $this->addToolbar(); // Display the template return parent::display($tpl); }