PATH:
home
/
letacommog
/
letaweb
/
protected
/
modules
/
admin
/
controllers
<?php class ContentController extends PController { public $layout = 'admin_column'; public function filters() { return array( 'accessControl', ); } public function accesssRules() { $module = $this->getModule(); return array( array('allow', 'actions' => array( 'ajaxupdate','index','create','view','delete','update','category','addcategory','synctofile','createStructure', ), 'roles' => array($module->languageManagerRole), ), array('deny', // deny all users 'users' => array('*'), ), ); } public function actionIndex() { $this->breadcrumbs = array( Yii::t('admin', 'Content'), ); $model = new Content('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Content'])) { $model->attributes = $_GET['Help']; } $this->render('index', array( 'model' => $model, )); } public function actionUpdate() { $model = new ContentForm('update'); if (isset($_POST['ContentForm'])) { $model->attributes = $_POST['ContentForm']; if ($model->save()) { $url = $this->createUrl('index'); $this->redirect($url); } } if (!isset($_REQUEST['id'])) { $url = $this->createUrl('index'); $this->redirect($url); } $id = $_REQUEST['id']; $t = Content::model()->findByPk($id); if ($t == null) { $url = $this->createUrl('index'); $this->redirect($url); } $this->breadcrumbs = array( Yii::t('admin', 'Content') => array('content/index'), $t->name, ); $attributes = array(); foreach ($model->getAttributes() as $name => $value) { $model->$name = $t->$name; } $this->render('update', array('model' => $model)); } public function actionDelete() { if (!isset($_REQUEST['id'])) { $url = $this->createUrl('index'); $this->redirect($url); } $id = $_REQUEST['id']; $t = Content::model()->findByPk($id); if ($t == null) { $url = $this->createUrl('index'); $this->redirect($url); } } public function actionAjaxUpdate() { $act = $_GET['act']; $autoIdAll = $_POST['autoId']; if (count($autoIdAll) > 0) { foreach ($autoIdAll as $autoId) { $model = Content::model()->findByPk($autoId); if ($act == 'doDelete') { $model->is_deleted = '1'; } if ($model->save()) { echo 'ok'; } else { throw new Exception('Sorry', 500); } } } } public function actionCreate() { $this->breadcrumbs = array( Yii::t('admin', 'Content') => array('content/index'), Yii::t('admin', 'Create'), ); $model = new ContentForm('create'); if (isset($_POST['ContentForm'])) { $model->attributes = $_POST['ContentForm']; if ($model->save()) { $url = $this->createUrl('index'); $this->redirect($url); } } $this->render('create', array('model' => $model)); } }
[+]
..
[-] TemplateController.php
[edit]
[-] PlanController.php
[edit]
[-] DomainController.php
[edit]
[-] WebsiteController.php
[edit]
[-] ConfigController.php
[edit]
[-] TransactionController.php
[edit]
[-] MailtemplateController.php
[edit]
[-] DefaultController.php
[edit]
[-] CategoryController.php
[edit]
[-] DashboardController.php
[edit]
[-] UserController.php
[edit]
[-] LanguageController.php
[edit]
[-] ModuleController.php
[edit]
[-] ModulecategoryController.php
[edit]
[-] PlanDescriptionController.php
[edit]
[-] TermController.php
[edit]
[-] SubscriptionController.php
[edit]
[-] InterfaceController.php
[edit]
[-] ColorController.php
[edit]
[-] ShareButtonController.php
[edit]
[-] SkinpresetController.php
[edit]
[-] ContentController.php
[edit]
[-] LogController.php
[edit]
[-] ProfileController.php
[edit]