PATH:
home
/
letacommog
/
letaweb
/
admin
/
models
/
mainsite_models
/
forms
<?php class PageCreationForm extends CFormModel { public $id; public $template_id; public $name; public function rules() { return array( array('template_id,name', 'required'), array('name', 'unique','className' => 'Site'), ); } public function save($item = null) { $this->name = trim($this->name); $this->name = strtolower($this->name); if ($this->validate()) { $now = date('Y-m-d H:i:s'); $site = new Site(); $site->date_added = $now; $site->owner_id = Yii::app()->user->id; $site->name = $this->name; $site->template = $this->template_id; $site->is_created_complete = 0; $site->can_expire = 0; $site->last_modified_id = Yii::app()->user->id; $site->date_modified = $now; if ($site->save()) { $installation = new PageInstallationForm(); $installation->page_id = $site->id; $installation->user_id = Yii::app()->user->id; $installation->is_complete = 0; $installation->step = 0; $installation->is_active = 1; return $installation->save(); } else { return false; } } else { return false; } } }
[+]
..
[-] PageCreationForm.php
[edit]
[-] InstallForm.php
[edit]
[-] ForgotPasswordForm.php
[edit]
[-] LoginForm.php
[edit]
[-] SignupForm.php
[edit]
[-] RecoverPasswordForm.php
[edit]
[-] ResentActiveMailForm.php
[edit]
[-] PageInstallationForm.php
[edit]