diff --git a/components/com_contact/views/categories/tmpl/default_items.php b/components/com_contact/views/categories/tmpl/default_items.php index 9d68a3ec4463f..ae2e2ca17863d 100644 --- a/components/com_contact/views/categories/tmpl/default_items.php +++ b/components/com_contact/views/categories/tmpl/default_items.php @@ -25,15 +25,17 @@
> params->get('show_subcat_desc_cat') == 1) :?> @@ -44,7 +46,7 @@ - getChildren()) > 0) :?> + getChildren()) > 0 && $this->maxLevelcat > 1) :?>
items[$item->id] = $item->getChildren(); diff --git a/components/com_contact/views/category/view.html.php b/components/com_contact/views/category/view.html.php index afdf543e760e3..18f676c81526a 100644 --- a/components/com_contact/views/category/view.html.php +++ b/components/com_contact/views/category/view.html.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Registry\Registry; + /** * HTML View class for the Contacts component * @@ -49,8 +51,8 @@ public function display($tpl = null) // Compute the contact slug. foreach ($this->items as $item) { - $item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id; - $temp = new JRegistry; + $item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id; + $temp = new Registry; $temp->loadString($item->params); $item->params = clone($this->params); $item->params->merge($temp); diff --git a/components/com_contact/views/contact/tmpl/default.php b/components/com_contact/views/contact/tmpl/default.php index ccc562678f939..40286ba2cde8a 100644 --- a/components/com_contact/views/contact/tmpl/default.php +++ b/components/com_contact/views/contact/tmpl/default.php @@ -13,7 +13,7 @@ jimport('joomla.html.html.bootstrap'); ?> -
+
params->get('show_page_heading')) : ?>

escape($this->params->get('page_heading')); ?> @@ -26,7 +26,7 @@ item->published == 0) : ?> - contact->name; ?> + contact->name; ?>

@@ -84,13 +84,13 @@ contact->image && $this->params->get('show_image')) : ?>
- contact->image, JText::_('COM_CONTACT_IMAGE_DETAILS'), array('align' => 'middle')); ?> + contact->image, JText::_('COM_CONTACT_IMAGE_DETAILS'), array('align' => 'middle', 'itemprop' => 'image')); ?>
contact->con_position && $this->params->get('show_position')) : ?>
-
+
contact->con_position; ?>
@@ -120,6 +120,7 @@ params->get('presentation_style') == 'tabs') : ?> + params->get('presentation_style') == 'plain'): ?> ' . JText::_('COM_CONTACT_EMAIL_FORM') . ''; ?> diff --git a/components/com_contact/views/contact/view.html.php b/components/com_contact/views/contact/view.html.php index 4ac6ff57309f6..b393e04757d2a 100644 --- a/components/com_contact/views/contact/view.html.php +++ b/components/com_contact/views/contact/view.html.php @@ -52,21 +52,19 @@ class ContactViewContact extends JViewLegacy protected $return_page; /** - * Method to display the view. + * Execute and display a template script. * - * @param string $tpl A template file to load. [optional] + * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * - * @return mixed Exception on failure, void on success. - * - * @since 1.5 + * @return mixed A string if successful, otherwise a Error object. */ public function display($tpl = null) { - $app = JFactory::getApplication(); - $user = JFactory::getUser(); - $state = $this->get('State'); - $item = $this->get('Item'); - $this->form = $this->get('Form'); + $app = JFactory::getApplication(); + $user = JFactory::getUser(); + $state = $this->get('State'); + $item = $this->get('Item'); + $this->form = $this->get('Form'); // Get the parameters $params = JComponentHelper::getParams('com_contact'); @@ -95,19 +93,20 @@ public function display($tpl = null) } // Check if access is not public - $groups = $user->getAuthorisedViewLevels(); + $groups = $user->getAuthorisedViewLevels(); $return = ''; if ((!in_array($item->access, $groups)) || (!in_array($item->category_access, $groups))) { - JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR')); + $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error'); + $app->setHeader('status', 403, true); return false; } - $options['category_id'] = $item->catid; - $options['order by'] = 'a.default_con DESC, a.ordering ASC'; + $options['category_id'] = $item->catid; + $options['order by'] = 'a.default_con DESC, a.ordering ASC'; // Handle email cloaking if ($item->email_to && $params->get('show_email')) @@ -305,10 +304,10 @@ public function display($tpl = null) */ protected function _prepareDocument() { - $app = JFactory::getApplication(); - $menus = $app->getMenu(); - $pathway = $app->getPathway(); - $title = null; + $app = JFactory::getApplication(); + $menus = $app->getMenu(); + $pathway = $app->getPathway(); + $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself @@ -355,15 +354,15 @@ protected function _prepareDocument() if (empty($title)) { - $title = $app->getCfg('sitename'); + $title = $app->get('sitename'); } - elseif ($app->getCfg('sitename_pagetitles', 0) == 1) + elseif ($app->get('sitename_pagetitles', 0) == 1) { - $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); + $title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title); } - elseif ($app->getCfg('sitename_pagetitles', 0) == 2) + elseif ($app->get('sitename_pagetitles', 0) == 2) { - $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); + $title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename')); } if (empty($title)) @@ -377,7 +376,7 @@ protected function _prepareDocument() { $this->document->setDescription($this->item->metadesc); } - elseif (!$this->item->metadesc && $this->params->get('menu-meta_description')) + elseif ($this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } @@ -386,7 +385,7 @@ protected function _prepareDocument() { $this->document->setMetadata('keywords', $this->item->metakey); } - elseif (!$this->item->metakey && $this->params->get('menu-meta_keywords')) + elseif ($this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } diff --git a/components/com_contact/views/featured/view.html.php b/components/com_contact/views/featured/view.html.php index dfd7a366f4d74..f00a1c593509c 100644 --- a/components/com_contact/views/featured/view.html.php +++ b/components/com_contact/views/featured/view.html.php @@ -12,7 +12,7 @@ use Joomla\Registry\Registry; /** - * Frontpage View class + * Featured View class * * @since 1.6 */ @@ -63,7 +63,7 @@ class ContactViewFeatured extends JViewLegacy /** * Method to display the view. * - * @param string $tpl A template file to load. [optional] + * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed Exception on failure, void on success. * @@ -71,16 +71,16 @@ class ContactViewFeatured extends JViewLegacy */ public function display($tpl = null) { - $app = JFactory::getApplication(); - $params = $app->getParams(); + $app = JFactory::getApplication(); + $params = $app->getParams(); // Get some data from the models - $state = $this->get('State'); - $items = $this->get('Items'); - $category = $this->get('Category'); - $children = $this->get('Children'); - $parent = $this->get('Parent'); - $pagination = $this->get('Pagination'); + $state = $this->get('State'); + $items = $this->get('Items'); + $category = $this->get('Category'); + $children = $this->get('Children'); + $parent = $this->get('Parent'); + $pagination = $this->get('Pagination'); // Check for errors. if (count($errors = $this->get('Errors'))) @@ -94,9 +94,9 @@ public function display($tpl = null) // Compute the contact slug. for ($i = 0, $n = count($items); $i < $n; $i++) { - $item = &$items[$i]; - $item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id; - $temp = new Registry; + $item = &$items[$i]; + $item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id; + $temp = new Registry; $temp->loadString($item->params); $item->params = clone $params; @@ -140,13 +140,13 @@ public function display($tpl = null) * * @return void * - * @since 1.5 + * @since 1.6 */ protected function _prepareDocument() { - $app = JFactory::getApplication(); - $menus = $app->getMenu(); - $title = null; + $app = JFactory::getApplication(); + $menus = $app->getMenu(); + $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself @@ -165,15 +165,15 @@ protected function _prepareDocument() if (empty($title)) { - $title = $app->getCfg('sitename'); + $title = $app->get('sitename'); } - elseif ($app->getCfg('sitename_pagetitles', 0) == 1) + elseif ($app->get('sitename_pagetitles', 0) == 1) { - $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); + $title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title); } - elseif ($app->getCfg('sitename_pagetitles', 0) == 2) + elseif ($app->get('sitename_pagetitles', 0) == 2) { - $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); + $title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename')); } $this->document->setTitle($title); diff --git a/templates/beez3/html/com_contact/contact/default.php b/templates/beez3/html/com_contact/contact/default.php index 1e42b2af17732..deed9166e57c7 100644 --- a/templates/beez3/html/com_contact/contact/default.php +++ b/templates/beez3/html/com_contact/contact/default.php @@ -62,6 +62,7 @@ params->get('presentation_style') == 'tabs') : ?> '1')); ?> + params->get('presentation_style') == 'plain'):?> ' . JText::_('COM_CONTACT_DETAILS') . ''; ?>