Skip to content

Commit

Permalink
Re-use setDocumentTitle method
Browse files Browse the repository at this point in the history
  • Loading branch information
joomdonation committed Jan 4, 2018
1 parent 13d9601 commit a755e1c
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions libraries/src/MVC/View/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ public function getForm()
*/
public function setDocumentTitle($title)
{
$app = \JFactory::getApplication();
$app = Factory::getApplication();

// Check for empty title and add site name if param is set
if (empty($title))
Expand Down Expand Up @@ -890,25 +890,8 @@ protected function setDocumentHeadData()
{
/* @var Registry $params */
$params = $this->params;
$app = Factory::getApplication();

$title = $params->get('page_title');

// Check for empty title and add site name if param is set
if (empty($title))
{
$title = $app->get('sitename');
}
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = \JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = \JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}

$this->document->setTitle($title);
$this->setDocumentTitle($params->get('page_title'));

if ($params->get('menu-meta_description'))
{
Expand Down

0 comments on commit a755e1c

Please sign in to comment.