コード例 #1
0
ファイル: lockrules.php プロジェクト: ratbird/hope
 function new_action()
 {
     $this->lock_rule = new LockRule();
     $this->lock_config = LockRules::getLockRuleConfig($this->lock_rule_type);
     if (Request::submitted('ok')) {
         $this->lock_rule->user_id = $GLOBALS['user']->id;
         $this->lock_rule->object_type = $this->lock_rule_type;
         if (!$this->handle_form_data()) {
             PageLayout::postMessage(MessageBox::error(_('Die neue Sperrebene konnte nicht gespeichert werden.'), $this->msg['error']));
         } else {
             PageLayout::postMessage(MessageBox::success(_('Die neue Sperrebene wurde gespeichert')));
             $this->redirect($this->url_for('admin/lockrules/edit/' . $this->lock_rule->getid()));
         }
     }
     $actions = new ActionsWidget();
     $actions->addLink(_('Bearbeiten abbrechen'), $this->url_for('admin/lockrules'), Icon::create('decline', 'clickable'));
     $this->sidebar->addWidget($actions);
 }