Example #1
0
 /**
  * Default view function
  *
  * @return void
  */
 public function displayTask()
 {
     // Get scope
     $this->view->scope = Request::getWord('scope', 'Hub');
     $this->view->scope_id = Request::getInt('scope_id', 0);
     // Get permissions
     $access = new \JForm('permissions');
     $access->loadFile(dirname(dirname(__DIR__)) . DS . 'models' . DS . 'forms' . DS . 'permissions.xml');
     // Bind existing rules if applicable
     $asset = new \JTableAsset($this->database);
     $name = 'com_time.' . strtolower($this->view->scope) . '.' . $this->view->scope_id;
     $asset->loadByName($name);
     if ($asset->get('id')) {
         $access->setValue('asset_id', null, $asset->get('id'));
     }
     $this->view->permissions = $access->getField(strtolower($this->view->scope));
     // Display
     $this->view->display();
 }