PATH:
home
/
letacommog
/
letaweb
/
protected
/
modules
/
admin
/
controllers
<?php class TemplateController extends PController { public $layout = 'admin_column'; public function filters() { return array( 'accessControl', ); } public function actionIndex() { $this->breadcrumbs = array( Yii::t('admin', 'Template'), ); $model = new Site('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Site'])) { $model->attributes = $_GET['Site']; } $this->render('index', array( 'model' => $model, )); } public function actionUpdate() { $model = new TemplateForm('update'); if (isset($_POST['TemplateForm'])) { $model->attributes = $_POST['TemplateForm']; 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 = Site::model()->findByPk((int) $id); $name = $t->name.'.jpg'; if ($t == null) { $url = $this->createUrl('index'); $this->redirect($url); } $this->breadcrumbs = array( Yii::t('admin', 'Template') => array('template/index'), $t->name, ); $attributes = array(); foreach ($model->getAttributes() as $name => $value) { $model->$name = $t->$name; } $this->render('update', array('model' => $model, 'template' => $t)); } public function actionDelete() { if (!isset($_REQUEST['id'])) { echo 1; return; } $id = $_REQUEST['id']; $t = Site::model()->findByPk((int) $id); if ($t == null) { echo 1; return; } $t->is_template = 0; $t->save(); } public function actionCreate() { $model = new UploadTemplateForm('create'); if (isset($_POST['UploadTemplateForm'])) { $model->attributes = $_POST['UploadTemplateForm']; $model->file = CUploadedFile::getInstance($model,'file'); if (($template =$model->save()) !== false) { $url = $this->createUrl('template/update/id/'.$template->id); $this->redirect($url); } } $this->render('create', array('model' => $model)); } public function actionAjaxUpdate() { $act = $_GET['act']; $autoIdAll = $_POST['autoId']; if (count($autoIdAll) > 0) { foreach ($autoIdAll as $autoId) { $model = Site::model()->findByPk((int) $autoId); if ($act == 'doDelete') { $model->is_template = 0; } if ($model->save()) { echo 'ok'; } else { throw new Exception('Sorry', 500); } } } } }
[+]
..
[-] 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]