PATH:
home
/
letacommog
/
letaweb
/
admin
/
models
/
subsite_models
/
forms
<?php class SkinForm extends CFormModel { public $id; public $name; public $display_name; public $type; public $format; public $css,$html,$date_modified,$date_added,$author_id,$last_modified_by; public function SkinForm() { } public function rules() { return array( array('id', 'numerical'), array('name', 'required'), array('name', 'length', 'max' => 20), array('id,display_name,type,sub_type,css,html,date_modified,date_added,author_id,last_modified_by', 'safe'), ); } protected function preProcess() { if (!isset($this->id) || $this->id == 0) { $this->scenario = 'create'; } $this->author_id = Yii::app()->user->id; $this->last_modified_by = Yii::app()->user->id; } public function save($item = null) { $this->preProcess(); $now = date('Y-m-d H:i:s'); if ($this->validate()) { if ($this->scenario === 'create' || !isset($this->id) || $this->id == 0) { $news = new BSkins(); $news->setIsNewRecord(true); $news->id = $news->getMaxId() + 1; $news->date_added = $now; $news->author_id = $this->author_id; } else { $news = BSkins::model()->findByPk($this->id); $news->setIsNewRecord(false); if ($news->author_id == 0) { $news->author_id = $this->author_id; } } $news->display_name = $this->display_name; $news->name = $this->name; $news->format = isset($this->format) ? $this->format : 0; $news->css = $this->css; $news->type = $this->type; $news->html = $this->html; $news->last_modified_by = $this->last_modified_by; $news->date_modified = $now; if ($news->save()) { return $news; } else { return false; } } else { return false; } } }
[+]
..
[-] ColorForm.php
[edit]
[-] ProfileResetPassForm.php
[edit]
[-] NewsCommentForm.php
[edit]
[-] SkinForm.php
[edit]
[-] PageForm.php
[edit]
[-] BLoginForm.php
[edit]
[-] UserResetPassForm.php
[edit]
[-] ModuleForm.php
[edit]
[-] NewsForm.php
[edit]
[-] ContributorForm.php
[edit]
[-] News_CategoriesForm.php
[edit]
[-] InviteForm.php
[edit]
[-] NewsTagForm.php
[edit]
[-] DomainForm.php
[edit]