コード例 #1
0
 /**
  * Display the view
  */
 public function display($tpl = null)
 {
     if ($this->getLayout() !== 'modal') {
         XmapHelper::addSubmenu('sitemaps');
     }
     $this->state = $this->get('State');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $version = new JVersion();
     $message = $this->get('ExtensionsMessage');
     if ($message) {
         JFactory::getApplication()->enqueueMessage($message);
     }
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     // We don't need toolbar in the modal window.
     if ($this->getLayout() !== 'modal') {
         if (version_compare($version->getShortVersion(), '3.0.0', '<')) {
             $tpl = 'legacy';
         }
         $this->addToolbar();
     }
     parent::display($tpl);
 }
コード例 #2
0
ファイル: controller.php プロジェクト: vnishukov/fdo
 /**
  * Display the view
  */
 public function display($cachable = false, $urlparams = false)
 {
     require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'xmap.php';
     // Get the document object.
     $document = JFactory::getDocument();
     // Set the default view name and format from the Request.
     $vName = JRequest::getWord('view', 'sitemaps');
     $vFormat = $document->getType();
     $lName = JRequest::getWord('layout', 'default');
     // Get and render the view.
     if ($view = $this->getView($vName, $vFormat)) {
         // Get the model for the view.
         $model = $this->getModel($vName);
         // Push the model into the view (as default).
         $view->setModel($model, true);
         $view->setLayout($lName);
         // Push document object into the view.
         $view->assignRef('document', $document);
         $view->display();
         // Load the submenu.
         XmapHelper::addSubmenu($vName);
     }
 }