PATH:
home
/
letacommog
/
letaweb
/
admin
/
models
/
subsite_models
/
forms
<?php class ColorForm extends CFormModel { public $id; public $color1; public $color2; public $color3; public $color4; public $color5,$date_modified,$date_added,$author_id,$last_modified_by; public function ColorForm() { } public function rules() { return array( array('id', 'numerical'), array('color1,color2,color3,color4,color5', 'required'), array('date_modified,date_added,author_id,last_modified_by', 'safe'), ); } protected function preProcess() { $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 BColors(); $news->setIsNewRecord(true); $news->id = $news->getMaxId() + 1; $news->date_added = $now; $news->author_id = $this->author_id; } else { $news = BColors::model()->findByPk($this->id); $news->setIsNewRecord(false); if ($news->author_id == 0) { $news->author_id = $this->author_id; } } $news->color1 = $this->color1; $news->color2 = $this->color2; $news->color3 = $this->color3; $news->color4 = $this->color4; $news->color5 = $this->color5; $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]