public function init() { parent::init(); if (isset($this->params['op'])) { $this->op = $this->params['op']; } if (isset($this->params['fileName'])) { $this->fileName = $this->params['fileName']; } if (isset($this->params['fileExtName'])) { $this->fileExtName = $this->params['fileExtName']; } $this->version = self::NTKO_VERSION; $this->productCaption = self::NTKO_PRODUCT_CAPTION; $this->productKey = self::NTKO_PRODUCT_KEY; $this->name = self::NTKO_NAME; $this->clsid = self::NTKO_CLSID; $params = SysParams::getParams(array('ntko_standalone', 'ntko_name', 'ntko_clsid', 'ntko_version', 'ntko_product_caption', 'ntko_product_key')); if ($params['ntko_standalone'] && $params['ntko_name'] && $params['ntko_version'] && $params['ntko_product_caption'] && $params['ntko_product_key']) { $this->version = $params['ntko_version']; $this->productCaption = $params['ntko_product_caption']; $this->productKey = $params['ntko_product_key']; $this->name = $params['ntko_name']; if ($params['ntko_clsid']) { $this->clsid = $params['ntko_clsid']; } } if (!Yii::app()->storage->isFileExists(Yii::app()->basePath . "/../static/activex/" . $this->name)) { throw new Exception("控件配置错误,请检查系统参数设置!", 404); } }
/** * @return string the page title. Defaults to the controller name and the action name. */ public function getPageTitle() { if ($this->_pageTitle) { return $this->_pageTitle; } else { $browserTitle = SysParams::getParams('browser_title'); return $this->_pageTitle = ($browserTitle ? $browserTitle : Yii::app()->name) . (isset($this->title) ? '-' . $this->title : ''); } }
/** * Renders a text field. * @return string the rendered content */ protected function textField() { $this->setPlaceholder(); echo $this->getPrepend(); echo $this->form->textField($this->model, $this->attribute, $this->htmlOptions); //检查是否支持多语言输入字段 $attributes = $this->model->behaviors()['TranslationBehavior']['attributes']; if (!empty($attributes) && !$this->model->isNewRecord) { $isMultiLang = SysParams::getParams('multi_language'); if ($isMultiLang && in_array($this->attribute, $attributes)) { $this->widget('core.widgets.TTranslate', array('model' => $this->model, 'attribute' => $this->attribute)); } } echo $this->getAppend(); }