コード例 #1
0
ファイル: view.html.php プロジェクト: kylephp/com_dummy
 /**
  * Display the template list
  *
  * @param   string  $tpl  The template file to use
  *
  * @return   string
  *
  * @since   0.9.1
  */
 public function display($tpl = null)
 {
     $user = JFactory::getUser();
     $this->items = $this->get('Items');
     $this->state = $this->get('State');
     $this->pagination = $this->get('Pagination');
     $this->filterForm = $this->get('Form');
     $this->activeFilters = $this->get('ActiveFilters');
     $this->items = $this->getModel()->getItems();
     JFactory::getLanguage()->load('', JPATH_ADMINISTRATOR);
     // Items ordering
     $this->ordering = array();
     if ($this->items) {
         foreach ($this->items as $item) {
             $this->ordering[0][] = $item->id;
         }
     }
     // Edit permission
     $this->canEdit = false;
     if ($user->authorise('core.edit', 'com_dummy')) {
         $this->canEdit = true;
     }
     // Edit state permission
     $this->canEditState = false;
     if ($user->authorise('core.edit.state', 'com_dummy')) {
         $this->canEditState = true;
     }
     parent::display($tpl);
 }
コード例 #2
0
ファイル: view.html.php プロジェクト: kylephp/com_dummy
 /**
  * Display the category edit page
  *
  * @param   string  $tpl  The template file to use
  *
  * @return   string
  *
  * @todo Check the extra fields once implemented
  *
  * @since   0.9.1
  */
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     JFactory::getLanguage()->load('', JPATH_ADMINISTRATOR);
     $this->item = $this->get('Item');
     $this->form = $this->get('Form');
     // Display the template
     parent::display($tpl);
 }