/**
  * Manages all models.
  */
 public function actionManage()
 {
     $model = new Articles('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Articles'])) {
         $model->attributes = $_GET['Articles'];
     }
     $columnTemp = array();
     if (isset($_GET['GridColumn'])) {
         foreach ($_GET['GridColumn'] as $key => $val) {
             if ($_GET['GridColumn'][$key] == 1) {
                 $columnTemp[] = $key;
             }
         }
     }
     $columns = $model->getGridColumn($columnTemp);
     if (isset($_GET['category'])) {
         $category = ArticleCategory::model()->findByPk($_GET['category']);
         $title = ': ' . Phrase::trans($category->name, 2);
     } else {
         $title = '';
     }
     $this->pageTitle = Yii::t('phrase', 'View Articles') . $title;
     $this->pageDescription = Yii::t('phrase', 'Use this page to search for and manage article entries. To Approve or Feature an article, just click on the icon, it will automate turn on and off per that setting. To edit, delete, or manage an article, please login as that user, and perform your actions.');
     $this->pageMeta = '';
     $this->render('admin_manage', array('model' => $model, 'columns' => $columns));
 }
Exemplo n.º 2
0
 /**
  * Lists all models.
  */
 public function actionIndex()
 {
     $model = new Articles('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Articles'])) {
         $model->attributes = $_GET['Articles'];
     }
     $this->render('index', array('model' => $model, 'actions' => $this->listActionsCanAccess));
 }
Exemplo n.º 3
0
 public function actionList_articles()
 {
     if (Yii::app()->user->isGuest) {
         $this->redirect($this->createAbsoluteUrl('default/index'));
     }
     $model = new Articles('search');
     $model->unsetAttributes();
     if (isset($_GET['Articles'])) {
         $model->setAttributes($_GET['Articles'], false);
     }
     $category = Categorys::getAllCategories();
     $menus = Mainmenu::model()->getDropDownMenu();
     $this->render('articles/list_articles', array('model' => $model, 'menus' => $menus, 'category' => $category));
 }
Exemplo n.º 4
0
	/**
	 * Manages all models.
	 */
	public function actionAdmin()
	{
        if(Yii::app()->user->checkAccess('admin')){
            $model=new Articles('search');
            $model->unsetAttributes();  // clear any default values
            if(isset($_GET['Articles']))
                $model->attributes=$_GET['Articles'];

            $this->render('admin',array(
                'model'=>$model,
            ));
        } else {
            $this->redirect('/admin/user/login');
        }

	}
Exemplo n.º 5
0
 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     $model = new Articles('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Articles'])) {
         $model->attributes = $_GET['Articles'];
     }
     $this->render('admin', array('model' => $model));
 }