コード例 #1
0
ファイル: AdminController.php プロジェクト: Saltly/SourceBans
 /**
  * Displays the 'admins' admin page
  */
 public function actionAdmins()
 {
     $this->pageTitle = Yii::t('sourcebans', 'controllers.admin.admins.title');
     $this->breadcrumbs = array(Yii::t('sourcebans', 'controllers.admin.index.title') => array('admin/index'), Yii::t('sourcebans', 'controllers.admin.admins.title'));
     $this->menu = array(array('label' => Yii::t('sourcebans', 'controllers.admin.admins.menu.list'), 'url' => '#list', 'visible' => Yii::app()->user->data->hasPermission('LIST_ADMINS')), array('label' => Yii::t('sourcebans', 'controllers.admin.admins.menu.add'), 'url' => '#add', 'visible' => Yii::app()->user->data->hasPermission('ADD_ADMINS')), array('label' => Yii::t('sourcebans', 'controllers.admin.admins.menu.import'), 'url' => '#import', 'visible' => Yii::app()->user->data->hasPermission('ADD_ADMINS')), array('label' => Yii::t('sourcebans', 'controllers.admin.admins.menu.overrides'), 'url' => '#overrides', 'visible' => Yii::app()->user->data->hasPermission('OVERRIDES')), array('label' => Yii::t('sourcebans', 'controllers.admin.admins.menu.actions'), 'url' => '#actions'));
     $admin = new SBAdmin();
     $admins = new SBAdmin('search');
     $admins->unsetAttributes();
     // clear any default values
     if (isset($_GET['SBAdmin'])) {
         $admins->attributes = $_GET['SBAdmin'];
     }
     $actions = new SBAction('search');
     $actions->unsetAttributes();
     // clear any default values
     if (isset($_GET['SBAction'])) {
         $actions->attributes = $_GET['SBAction'];
     }
     $overrides = new SBOverride('search');
     $overrides->unsetAttributes();
     // clear any default values
     if (isset($_GET['SBOverride'])) {
         $overrides->attributes = $_GET['SBOverride'];
     }
     $this->render('admins', array('actions' => $actions, 'admin' => $admin, 'admins' => $admins, 'overrides' => $overrides));
 }
コード例 #2
0
ファイル: _form.php プロジェクト: Saltly/SourceBans
<div class="modal-header">
  <button aria-hidden="true" class="close" data-dismiss="modal" type="button">&times;</button>
  <h3><?php 
echo Yii::t('sourcebans', 'Override');
?>
</h3>
</div>
<div class="modal-body">
  <div class="control-group">
    <?php 
echo $form->label($model, 'type', array('class' => 'control-label'));
?>
    <div class="controls">
      <?php 
echo $form->dropDownList($model, 'type', SBOverride::getTypes());
?>
      <?php 
echo $form->error($model, 'type');
?>
    </div>
  </div>

  <div class="control-group">
    <?php 
echo $form->labelEx($model, 'name', array('class' => 'control-label'));
?>
    <div class="controls">
      <?php 
echo $form->textField($model, 'name', array('size' => 60, 'maxlength' => 64));
?>