PATH:
home
/
letacommog
/
letaweb
/
admin
/
models
/
mainsite_models
<?php class Template extends Site { /** * Returns the static model of the specified AR class. * * @return CActiveRecord the static model class */ public static function model($className = __CLASS__) { return parent::model($className); } /** * @return string the associated database table name */ public function tableName() { return '{{template}}'; } public function getUniqueString() { return 'template'.$this->id; } public function rules() { return array( array('category', 'numerical', 'integerOnly' => true), array('priority', 'numerical', 'integerOnly' => true), array('is_active', 'in' , 'range' => array(0,1)), array('name', 'length', 'max' => 100), array('name', 'required'), array('display_name', 'length', 'max' => 100), array('display_name', 'required'), array('id, name,display_name,description, preview,blog,ecommerce,priority, language, is_active, category', 'safe'), ); } public function relations() { // NOTE: you may need to adjust the relation name and the related // class name for the relations automatically generated below. return array( 'website_category' => array(self::BELONGS_TO, 'WebsiteCategory', 'category'), 'website_language' => array(self::BELONGS_TO, 'Language', 'language'), 'db' => array(self::BELONGS_TO, 'DbList', 'db_id'), ); } public function search() { $criteria = new CDbCriteria(); $criteria->compare('id', $this->id); $criteria->compare('name', $this->name, true); $criteria->compare('display_name', $this->display_name, true); $criteria->compare('is_active', $this->is_active); $criteria->compare('category', $this->category); $criteria->compare('language', $this->language); $criteria->compare('priority', $this->priority); return new CActiveDataProvider('Template', array( 'criteria' => $criteria, 'sort'=>array( 'defaultOrder'=>'id desc', ), )); } public function getPhysicalLocation() { $website_directory = isset(Yii::app()->params['template_directory']) ? Yii::app()->params['template_directory'] : ''; $app_root = Yii::app()->baseUrl; $basePath = $_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR.$app_root.DIRECTORY_SEPARATOR; $dir = $basePath.$website_directory.DIRECTORY_SEPARATOR.$this->getHost(); return $dir; } public function getEditSiteURL() { $template_directory = isset(Yii::app()->params['template_directory']) ? Yii::app()->params['template_directory'] : ''; $app_root = Yii::app()->baseUrl; $template_directory = $app_root.'/'.$template_directory.'/'.$this->name.'/admin.php'; return $template_directory; } public function getViewSiteURL() { return 'site/view_template?id='.$this->id; } public function getSiteURL() { return $this->getEditSiteURL(); } public function getMaxUploadSize() { $mb = 20; return $mb * 1024 * 1024; } public function checkExpiredPage() { return false; } }
[+]
..
[-] Ticket.php
[edit]
[-] Configuration.php
[edit]
[-] PlanCondition.php
[edit]
[-] ModuleCategory.php
[edit]
[-] SamplePageCategory.php
[edit]
[-] Page_Type.php
[edit]
[-] Zone_Templates.php
[edit]
[-] User_Data.php
[edit]
[-] PlanDescription.php
[edit]
[-] UserData.php
[edit]
[-] Purchase.php
[edit]
[-] WebUser.php
[edit]
[-] Term.php
[edit]
[-] Type.php
[edit]
[-] Template.php
[edit]
[-] Site.php
[edit]
[-] Payment.php
[edit]
[+]
forms
[-] Language.php
[edit]
[-] AuthItem.php
[edit]
[-] MailTemplate.php
[edit]
[-] TicketForm.php
[edit]
[-] ModuleData.php
[edit]
[-] UserIdentity.php
[edit]
[-] Popup_Script.php
[edit]
[-] UserRecoverPassword.php
[edit]
[-] HelpCategory.php
[edit]
[-] Color.php
[edit]
[-] PlanAddition.php
[edit]
[-] Plan.php
[edit]
[-] IPNLogMessage.php
[edit]
[-] Subscription.php
[edit]
[-] SamplePage.php
[edit]
[-] ModuleList.php
[edit]
[-] User.php
[edit]
[-] Page_Domain.php
[edit]
[-] Payment_Method.php
[edit]
[-] YiiLog.php
[edit]
[-] User_Session.php
[edit]
[-] SkinPreset.php
[edit]
[-] Page_Installation.php
[edit]
[-] SiteData.php
[edit]
[-] Content.php
[edit]
[-] Library_Script.php
[edit]
[-] WebsiteCategory.php
[edit]