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); } }
public function init() { if (is_string($this->users)) { $this->users = explode(',', $this->users); } $this->htmlOptions['class'] = 'user-label ' . $this->htmlOptions['class']; $this->htmlOptions['target'] = '_blank'; parent::init(); }
public function init() { if ($this->htmlOptions['id'] == null) { $this->htmlOptions['id'] = $this->getId(); } parent::init(); if (!isset($this->options['colors'])) { $this->options['colors'] = $this->_defaultColors; } if (!isset($this->options['tooltip'])) { $this->options['tooltip'] = true; } }
public function init() { $this->scriptFile = '//swfobject.js'; if (!is_array($this->data)) { throw new CException('数据错误!'); } $this->htmlTags = ''; foreach ($this->data as $item) { $this->linkOptions['tag'] = $item; $this->htmlTags .= CHtml::link($item, $this->linkOptions, array('style' => 'font-size:' . rand(10, 14) . 'px;')); } parent::init(); }
/** * ### .init() * * Initializes the widget. */ public function init() { $classes = array('calendar', 'table-condensed'); if ($this->htmlOptions['id'] == null) { $this->htmlOptions['id'] = $this->getId(); } if (!empty($classes)) { $classes = implode(' ', $classes); if (isset($this->htmlOptions['class'])) { $this->htmlOptions['class'] .= ' ' . $classes; } else { $this->htmlOptions['class'] = $classes; } } parent::init(); }
public function init() { parent::init(); if (!isset($this->treeId)) { $this->treeId = $this->getId(); } echo CHtml::tag('div', array('id' => $this->treeId), ''); if ($this->imagePath) { } else { $this->imagePath = Yii::app()->td->getAssetsUrl() . '/img/dynatree/org/'; } foreach ($this->events as $event) { if (!isset($this->eventHandler[$event])) { $this->eventHandler[$event] = 'null'; } } }
public function init() { parent::init(); if (!isset($this->htmlOptions['id'])) { $this->htmlOptions['id'] = $this->id; } $classes = array('table'); if (is_string($this->tableType)) { $this->tableType = explode(' ', $this->tableType); } foreach ($this->tableType as $type) { $classes[] = 'table-' . $type; } if (isset($this->tableHtmlOptions['class'])) { $this->tableHtmlOptions['class'] .= implode(' ', $classes); } else { $this->tableHtmlOptions['class'] = implode(' ', $classes); } if (isset($this->tableHtmlOptions['style'])) { $this->tableHtmlOptions['style'] .= ';margin-bottom: 6px;'; } else { $this->tableHtmlOptions['style'] = 'margin-bottom: 6px;'; } $this->registerCss(); $this->registerJs(); if (!$this->urlParams) { $this->urlParams = array(); } foreach ($this->rows as &$row) { foreach ($row['items'] as $item) { if ($item['active'] == true) { $this->_selectedCondition[] = $item; $row['selected'] = true; $this->urlParams[$row['name']] = $item['value']; } } } if (empty($this->_selectedCondition)) { $this->_show = $this->defaultShow; } else { $this->_show = true; } }
public function init() { parent::init(); if (!isset($this->htmlOptions['id'])) { $this->htmlOptions['id'] = $this->getId(); } if (isset($this->htmlOptions['class'])) { $this->htmlOptions['class'] = 'td-nav' . $this->htmlOptions['class']; } else { $this->htmlOptions['class'] = 'td-nav'; } if ($this->editTitle) { if (!isset($this->model)) { throw new CException('Model不能为空!'); } } $this->renderHeader(); $this->renderContentBegin(); }
public function init() { if ($this->type == null) { throw new CException('系统代码类型必须设置'); } if ($this->name == null) { throw new CException('名称必须设置'); } $this->_curPath = Yii::app()->controller->module->getId() . '/' . Yii::app()->controller->getId() . '/' . Yii::app()->controller->getAction()->getId(); if (!isset($this->defaultOptions['All']['data-url'])) { $this->defaultOptions['All']['data-url'] = Yii::app()->createUrl($this->_curPath); } if (!isset($this->events['change'])) { $this->events['change'] = 'js:CodeFilterUtil.changeUrl'; } if (!isset($this->htmlOptions['style'])) { $this->htmlOptions['style'] = 'width:120px;'; } parent::init(); }
public function init() { parent::init(); $this->tagArray = TUtil::texplode($this->data); }
/** * 初始化 * @see CJuiWidget::init() */ public function init() { if (isset($this->cssFileUser) && is_array($this->cssFileUser)) { foreach ($this->cssFileUser as $cssFile) { $this->cssFile[] = $cssFile; } } if (!isset($this->treeId)) { $this->treeId = $this->getId(); } $this->options['treeId'] = $this->treeId; $this->htmlOptions['id'] = $this->treeId; $this->htmlOptions['class'] = 'ztree ' . $this->htmlOptions['class']; if ($this->asyncUrl != null) { $this->options['async'] = array('enable' => true, 'url' => $this->asyncUrl, 'type' => 'post', 'autoParam' => 'js:["id", "name"]'); if (isset($this->ayncParams)) { $this->options['async'] = array_merge($this->options['async'], $this->ayncParams); } $this->options['async']['autoParam'] = new CJavaScriptExpression($this->options['async']['autoParam']); if ($this->options['async']['otherParam']) { $this->options['async']['otherParam'] = new CJavaScriptExpression($this->options['async']['otherParam']); } } if ($this->model || $this->data) { $this->options['data']['simpleData']['enable'] = true; if ($this->treeNodeKey !== null) { $this->options['data']['simpleData']['treeNodeKey'] = $this->treeNodeKey; } if ($this->treeNodeParentKey !== null) { $this->options['data']['simpleData']['treeNodeParentKey'] = $this->treeNodeParentKey; } } //右键菜单 if (sizeof($this->contextMenu) > 0) { if (!isset($this->contextMenuId)) { $this->contextMenuId = $this->treeId . '_contextmenu'; } $userRightClick = '""'; if (isset($this->callback['onRightClick'])) { $userRightClick = new CJavaScriptExpression($this->callback['onRightClick']); } elseif (isset($this->options['callback']['onRightClick'])) { $userRightClick = new CJavaScriptExpression($this->options['callback']['onRightClick']); } $this->callback['onRightClick'] = 'js:function(event, treeId, treeNode){if(treeNode && typeof(treeNode.noclick) == "undefined"){TTreeUtil.contextMenu("' . $this->contextMenuId . '", ' . $userRightClick . ', event, treeId, treeNode);}}'; } if (!empty($this->callback)) { if (is_array($this->options['callback'])) { $this->options['callback'] = array_merge($this->options['callback'], $this->callback); } else { $this->options['callback'] = $this->callback; } } parent::init(); }
public function init() { parent::init(); $this->htmlOptions = array_merge($this->htmlOptions, array('data-width' => 600, 'data-height' => 200)); }
public function init() { $this->controllerId = $this->getController()->id; if (in_array(strtolower($this->type), array('user'))) { // $this->showOtherOrg = User::isInterfaceUser() && User::isIndependentUser() && !in_array($this->controllerId, Yii::app()->params['filter_models']) ? true : false; $this->showOtherOrg = User::isInterfaceUser() && Yii::app()->user->independent && !in_array($this->controllerId, Yii::app()->params['filter_models']) ? true : false; } switch (strtolower($this->type)) { case 'otherorg': $this->modal_id = 'selectotherorg'; $this->header = '选择外部组织机构'; $this->view_name = 'core.views.selector.otherorg'; $this->scriptFile = 'selector/otherorg.js'; break; case 'user': $this->modal_id = $this->single == false ? 'selectuser' : 'selectsingleuser'; $this->header = '选择人员'; $this->placeholder = '按名字或者拼音缩写搜索...'; $this->view_name = $this->single == false ? 'core.views.selector.user' : 'core.views.selector.singleuser'; $this->scriptFile = $this->single == false ? 'selector/user.js' : 'selector/singleuser.js'; break; case 'wfuser': $this->modal_id = 'selectwfuser'; $this->header = '选择人员'; $this->placeholder = '按名字或者拼音缩写搜索...'; $this->view_name = 'core.views.selector.wfuser'; $this->scriptFile = 'selector/wfuser.js'; break; case 'org': $this->modal_id = $this->single == false ? 'selectorg' : 'selectsingleorg'; $this->header = '选择部门'; $this->placeholder = '搜索部门'; $this->view_name = $this->single == false ? 'core.views.selector.org' : 'core.views.selector.singleorg'; $this->scriptFile = $this->single == false ? 'selector/org.js' : 'selector/singleorg.js'; break; case 'role': $this->modal_id = 'selectrole'; $this->header = '选择角色'; $this->placeholder = '搜索角色'; $this->view_name = 'core.views.selector.role'; $this->scriptFile = 'selector/role.js'; break; case 'table': $this->modal_id = 'selecttable'; $this->header = '选择表'; $this->placeholder = '搜索表名'; $this->view_name = 'core.views.selector.table'; $this->scriptFile = 'selector/table.js'; break; case 'form': $this->modal_id = 'selectform'; $this->header = '选择表单'; $this->placeholder = '搜索表单'; $this->view_name = 'core.views.selector.form'; $this->scriptFile = 'selector/form.js'; break; case 'wfdf': $this->modal_id = 'selectwfdf'; $this->header = '选择流程'; $this->placeholder = '搜索流程'; $this->view_name = 'core.views.selector.wfdf'; $this->scriptFile = 'selector/wfdf.js'; break; case 'doctype': $this->modal_id = 'selectdoctype'; $this->header = '选择公文类型'; $this->placeholder = '搜索公文类型'; $this->view_name = 'core.views.selector.doctype'; $this->scriptFile = 'selector/doctype.js'; break; case 'address': $this->modal_id = 'selectaddress'; $this->header = '选择通讯录人员'; $this->placeholder = '搜索通讯录人员'; $this->view_name = 'core.views.selector.address'; $this->scriptFile = 'selector/address.js'; break; case 'parase': $this->modal_id = 'selectparase'; $this->header = '选择常用语'; $this->placeholder = '搜索常用语'; $this->view_name = 'core.views.selector.parase'; $this->scriptFile = 'selector/parase.js'; break; case 'opinion': $this->modal_id = 'selectopinion'; $this->header = '选择流程意见'; $this->placeholder = '搜索流程意见'; $this->view_name = 'core.views.selector.opinion'; $this->scriptFile = 'selector/opinion.js'; break; default: break; } parent::init(); }
public function run() { parent::run(); $this->renderHeader(); $this->renderSection(); }
/** * ### .init() * * Initializes the widget. */ public function init() { $classes = array(); $classes[] = $this->defaultCss; $classes[] = 'panel'; $validTypes = array(self::TYPE_PRIMARY, self::TYPE_SUCCESS, self::TYPE_INFO, self::TYPE_WARNING, self::TYPE_DANGER); if (!isset($this->type)) { $this->type = self::TYPE_INFO; } if (isset($this->type) && in_array($this->type, $validTypes)) { $classes[] = 'panel-' . $this->type; } if (!empty($classes)) { $classes = implode(' ', $classes); if (isset($this->htmlOptions['class'])) { $this->htmlOptions['class'] .= ' ' . $classes; } else { $this->htmlOptions['class'] = $classes; } } if (!isset($this->title)) { $this->title = '温馨提示'; } if (!isset($this->footer)) { $this->footer = ''; } if (isset($this->icon)) { if (strpos($this->icon, 'icon') === false) { $this->icon = 'icon-' . implode(' icon-', explode(' ', $this->icon)); } $this->title = '<i class="' . $this->icon . '"></i> ' . $this->title; } else { $this->title = '<i class="icon-info"></i> ' . $this->title; } if ($this->htmlOptions['id'] == null) { $this->htmlOptions['id'] = $this->getId(); } parent::init(); }
public function init() { parent::init(); $this->_model = $this->model->owner->tableName(); $this->_pk = $this->model->owner->attributes[$this->pkName]; }