PATH:
home
/
letacommog
/
letaweb
/
protected
/
modules
/
admin
/
controllers
<?php class CategoryController extends PController { public $layout = 'admin_column'; public function filters() { return array( 'accessControl', ); } public function accessdRules() { $module = $this->getModule(); return array( array('allow', 'actions' => array( 'ajaxupdate','index','create','view','delete','update', ), 'roles' => array($module->templateManagerRole), ), array('deny', // deny all users 'users' => array('*'), ), ); } public function actionIndex() { $model = new WebsiteCategory('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['WebsiteCategory'])) { $model->attributes = $_GET['WebsiteCategory']; } $this->render('index', array( 'model' => $model, )); } public function actionView() { $id = $_REQUEST['id']; $model = WebsiteCategory::model()->findByPk((int) $id); $this->render('view', array('model' => $model)); } public function actionUpdate() { $model = new CategoryForm('update'); if (isset($_POST['CategoryForm'])) { $model->attributes = $_POST['CategoryForm']; 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 = WebsiteCategory::model()->findByPk((int) $id); if ($t == null) { $url = $this->createUrl('index'); $this->redirect($url); } $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 = WebsiteCategory::model()->findByPk((int) $id); if ($t == null) { $url = $this->createUrl('index'); $this->redirect($url); } $t->delete(); echo 1; } public function actionAjaxUpdate() { $act = $_GET['act']; $autoIdAll = $_POST['autoId']; if (count($autoIdAll) > 0) { foreach ($autoIdAll as $autoId) { $model = User::model()->findByPk((int) $autoId); if ($act == 'doDelete') { $model->is_deleted = '1'; } if ($model->save()) { echo 'ok'; } else { throw new Exception('Sorry', 500); } } } } public function actionCreate() { $model = new CategoryForm('create'); if (isset($_POST['CategoryForm'])) { $model->attributes = $_POST['CategoryForm']; 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]