Пример #1
0
 static function PageTitle($title = "", $subtitle = "", $template = 'display_h1')
 {
     // if we have page_headingout set, then the self::$open_header var contains some html to be displayed after the heading
     // has been output. Must output this otherwise you end up with missing container div tags
     $post = "";
     if (!empty(self::$open_header) && self::$open_header) {
         $post = self::$open_header;
     }
     self::$open_header = null;
     $mainframe = JFactory::getApplication();
     $pageparams = $mainframe->getPageParameters('com_fss');
     $title = JText::_($title);
     $subtitle = JText::_($subtitle);
     $pageheading = $pageparams->get('page_title', '');
     $menutitle = $pageparams->get('page_heading', $pageheading);
     $document = JFactory::getDocument();
     // setup browser title
     $title_browser = FSS_Helper::TitleString($title, $subtitle, $pageheading, true);
     if ($mainframe->getCfg('sitename_pagetitles', 0) == 1) {
         $title_browser = JText::sprintf('JPAGETITLE', $mainframe->getCfg('sitename'), $title_browser);
     }
     if ($mainframe->getCfg('sitename_pagetitles', 0) == 2) {
         $title_browser = JText::sprintf('JPAGETITLE', $title_browser, $mainframe->getCfg('sitename'));
     }
     $document->setTitle($title_browser);
     // setup page title
     $title_page = FSS_Helper::TitleString($title, $subtitle, $menutitle, false);
     // title set to none, just return
     if (FSS_Settings::get('title_prefix') == 99) {
         return $post;
     }
     // should the "Show Page Heading" option be used?
     if (FSS_Settings::get('use_joomla_page_title_setting')) {
         if ($pageparams->get('show_page_heading', 1)) {
             return str_replace("\$1", $title_page, FSS_Settings::get($template)) . $post;
         }
         return $post;
     }
     // Normal, always show title
     $output = str_replace("\$1", $title_page, FSS_Settings::get($template));
     return $output . $post;
 }