Пример #1
0
 /**
  * Method to render the view.
  *
  * @return  string  The rendered view.
  *
  * @throws  RuntimeException
  */
 public function render()
 {
     if ($this->model && !$this->pagination) {
         // Pagination
         $this->pagination = $this->model->getPagination();
         // Ordering
         $this->listOrder = $this->escape($this->model->getState()->get('list.' . $this->prefix . '.ordering'));
         $this->listDir = $this->escape($this->model->getState()->get('list.' . $this->prefix . '.direction'));
     }
     // Page title
     $app = JFactory::getApplication();
     if ($app instanceof JApplicationSite) {
         $active = $app->getMenu()->getActive();
         $title = '';
         if ($active) {
             $title = $this->params->get('page_title', '');
             $uri = JUri::getInstance();
             // Check if the menu determines this view.
             foreach ($active->query as $key => $value) {
                 if (substr($uri->getVar($key), 0, 7) != 'filter_' && $uri->getVar($key) !== $value) {
                     $title = $this->defaultTitle;
                 }
             }
         }
         if (!$title) {
             $title = $this->defaultTitle;
         }
         if ($title) {
             if ($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'));
             }
             $app->getDocument()->setTitle($title);
         }
     }
     return parent::render();
 }
Пример #2
0
 /**
  * MonitorModelClassification constructor.
  *
  * @param   JApplicationCms  $application  The Application object to use in this model.
  * @param   boolean          $loadFilters  If set to true, filters and list options will be loaded from the page request.
  *
  * @throws Exception
  */
 public function __construct($application = null, $loadFilters = true)
 {
     $this->prefix = 'classification';
     parent::__construct($application, $loadFilters);
 }
Пример #3
0
 /**
  * MonitorModelAttachments constructor.
  *
  * @param   JApplicationCms  $application  The Application object to use in this model.
  * @param   boolean          $loadFilters  If set to true, filters and list options will be loaded from the page request.
  * @param   string           $pathPrefix   Base path for file storage for this component.
  *                                         Defaults to /media/com_monitor.
  */
 public function __construct($application = null, $loadFilters = true, $pathPrefix = '/media/com_monitor/')
 {
     $this->pathPrefix = JPATH_ROOT . $pathPrefix;
     parent::__construct();
 }