Ejemplo n.º 1
0
 /**
  * Display the list of lock rules
  */
 function index_action()
 {
     $actions = new ActionsWidget();
     $actions->addLink(_('Neue Sperrebene anlegen'), $this->url_for('admin/lockrules/new'), Icon::create('add', 'clickable'));
     $this->sidebar->addWidget($actions);
     if ($GLOBALS['perm']->have_perm('root')) {
         $list = new SelectWidget(_('Bereichsauswahl'), $this->url_for('admin/lockrules'), 'lock_rule_type');
         foreach (array('sem' => _('Veranstaltung'), 'inst' => _('Einrichtung'), 'user' => _('Nutzer')) as $type => $desc) {
             $list->addElement(new SelectElement($type, $desc, Request::get('lock_rule_type') == $type), 'lock_rule_type-' . $type);
         }
         $this->sidebar->addWidget($list);
     }
     if ($this->lock_rule_type == 'sem') {
         $this->lock_rules = LockRules::getAdministrableSeminarRules($GLOBALS['user']->id);
     } else {
         $this->lock_rules = LockRule::findAllByType($this->lock_rule_type);
     }
 }