Esempio n. 1
0
 /**
  * Method to render the view.
  *
  * @return  string  The rendered view.
  *
  * @since   12.1
  * @throws  RuntimeException
  */
 public function render()
 {
     $this->prefix = 'classification';
     $classifications = $this->model->getClassifications();
     $this->items = $classifications;
     $this->setLayout('default');
     $this->addToolbar();
     return parent::render();
 }
Esempio n. 2
0
 /**
  * Method to get the field input markup.
  *
  * @return  string  The field input markup.
  *
  * @since   11.1
  */
 protected function getOptions()
 {
     $options = array();
     JLoader::register('MonitorModelAbstract', JPATH_ROOT . '/administrator/components/com_monitor/model/abstract.php');
     JLoader::register('MonitorModelClassification', JPATH_ROOT . '/administrator/components/com_monitor/model/classification.php');
     $model = new MonitorModelClassification(null, false);
     $classifications = $model->getClassifications();
     $user = JFactory::getUser();
     foreach ($classifications as $classification) {
         if (in_array($classification->access, $user->getAuthorisedViewLevels())) {
             $options[] = JHtml::_('select.option', $classification->id, $classification->title);
         }
     }
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }