PATH:
home
/
letacommog
/
letaweb
/
protected
/
modules
/
admin
/
models
<?php class HostingConfigurationForm extends CFormModel { public $hosting_type; public $hosting_url; public $hosting_port; public $hosting_username; public $hosting_password; public $hosting_predefined_domain; public $hosting_predefined_subdomain; public function rules() { return array( array('hosting_username,hosting_password', 'required'), array('hosting_predefined_domain,hosting_predefined_subdomain,hosting_type,hosting_url,hosting_port,hosting_username,hosting_password', 'safe'), ); } public function save($item = null) { if ($this->validate()) { $attribues = $this->getSafeAttributeNames(); $s = '<?php return array('; $s .= "'class' => 'hostingComponent',"; foreach ($attribues as $attribue) { $s .= "'".str_replace('hosting_', '', $attribue)."'=>".(is_numeric($this->$attribue) ? $this->$attribue : "'".$this->$attribue."'").','; if ($this->isAttributeRequired($attribue)) { continue; } $config = Configuration::model()->find('name=:name', array(':name' => $attribue)); if (!isset($config)) { $config = new Configuration(); } $config->name = $attribue; $config->value = $this->$attribue; $config->save(); } $s .= ');'; $webroot = Yii::getPathOfAlias('webroot'); $filePath = $webroot.DIRECTORY_SEPARATOR.'hosting_config.php'; $out = fopen($filePath, 'wb'); fwrite($out, $s); return true; } else { return false; } } }
[+]
..
[-] DBPageForm.php
[edit]
[-] PlanDescriptionForm.php
[edit]
[-] HostingConfigurationForm.php
[edit]
[-] MailConfigurationForm.php
[edit]
[-] TemplateForm.php
[edit]
[-] ModuleForm.php
[edit]
[-] PageForm.php
[edit]
[-] PaymentConfigurationForm.php
[edit]
[-] CategoryForm.php
[edit]
[-] TermForm.php
[edit]
[-] DbListForm.php
[edit]
[-] ModuleDataForm.php
[edit]
[-] UploadTemplateForm.php
[edit]
[-] PlanConditionForm.php
[edit]
[-] ChangeDomainForm.php
[edit]
[-] LanguageForm.php
[edit]
[-] SkinPresetForm.php
[edit]
[-] PlanForm.php
[edit]
[-] UpgradePageForm.php
[edit]
[-] MailTemplateForm.php
[edit]
[-] ColorForm.php
[edit]
[-] MakeTempleteFromSiteForm.php
[edit]
[-] ResetPassForm.php
[edit]
[-] InterfaceForm.php
[edit]
[-] ContentForm.php
[edit]
[-] UserForm.php
[edit]
[-] ExtendPageForm.php
[edit]
[-] ConfigurationForm.php
[edit]
[-] ModuleCategoryForm.php
[edit]
[-] SocialShareButtonForm.php
[edit]