Esempio n. 1
0
     if ($model = $this->loadModel($id)) {
         if ($model->delete()) {
             Yii::log("Delete record " . print_r($model->attributes, true), 'info');
         }
     }
     // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
     if (!isset($_GET['ajax'])) {
         $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('index'));
     }
 } else {
     Yii::log('Invalid request. Please do not repeat this request again.');
 /**
  * Lists all models.
  */
 public function actionIndex()
 {
     $model = new Banners();
     $model->exposition()->search();
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Banners'])) {
         $model->attributes = $_GET['Banners'];
     }
     $this->render('index', array('model' => $model));
 }
Esempio n. 3
0
 public function actionIndex()
 {
     $this->layout = '//layouts/admin';
     $this->pageTitle = 'Баннеры';
     $this->breadcrumbs = array('Баннеры');
     $model = new Banners('search');
     $model->unsetAttributes();
     if (isset($_GET['banners'])) {
         $model->attributes = $_GET['banners'];
     }
     $this->render('index', array('model' => $model));
 }
Esempio n. 4
0
 public function actionDefault()
 {
     $pos = Yii::app()->request->getParam('pos');
     if (!$pos) {
         $pos = Yii::app()->request->getParam('photo');
     }
     if ($pos) {
         foreach ($pos as $k => $v) {
             $model = new Banners();
             $model->model()->updateByPk($v, array('pos' => $k + 1));
         }
         exit('success');
     }
     $model = new Banners('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Banners'])) {
         $model->attributes = $_GET['Banners'];
     }
     $this->render('admin', array('model' => $model));
 }
 /**
  * Manages all models.
  */
 public function actionManage()
 {
     $model = new Banners('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Banners'])) {
         $model->attributes = $_GET['Banners'];
     }
     $columnTemp = array();
     if (isset($_GET['GridColumn'])) {
         foreach ($_GET['GridColumn'] as $key => $val) {
             if ($_GET['GridColumn'][$key] == 1) {
                 $columnTemp[] = $key;
             }
         }
     }
     $columns = $model->getGridColumn($columnTemp);
     $this->pageTitle = Yii::t('phrase', 'Manage Banner');
     $this->pageDescription = '';
     $this->pageMeta = '';
     $this->render('admin_manage', array('model' => $model, 'columns' => $columns));
 }
 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     $model = new Banners('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Banners'])) {
         $model->attributes = $_GET['Banners'];
     }
     $this->render('admin', array('model' => $model));
 }
 /**
  * Manages all models.
  */
 public function actionIndex()
 {
     $model = new Banners('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Banners'])) {
         $model->attributes = $_GET['Banners'];
         /*if(isset($_GET['Banners']['model_nick']))
           $model->model_nick = $_GET['Banners']['model_nick'];*/
     }
     $this->render('index', array('model' => $model));
 }