public function renderHeader() { echo CHtml::openTag('header', array('id' => 'header')); echo CHtml::openTag('div', array('class' => 'navbar navbar-fixed-top')); echo CHtml::openTag('div', array('class' => 'navbar-inner')); echo CHtml::openTag('a', array('class' => 'brand', 'style' => 'font-size:14px;margin-top:5px;margin-bottom:0px;padding-top:0px;padding-bottom:0px;')); echo $this->model->getAttributeLabel('title'); echo CHtml::textField('title', $this->model->title, array('style' => 'margin-left:36px;margin-bottom:0px;')); echo CHtml::closeTag('a'); echo CHtml::openTag('a', array('class' => 'brand', 'style' => 'font-size:14px;margin-top:5px;margin-bottom:0px;padding-top:0px;padding-bottom:0px;')); echo $this->model->getAttributeLabel('main_id') . ' '; $this->widget('core.widgets.TTreeDropdown', array('treeId' => 'main_id', 'data' => HelpCategory::getHelpTree(), 'options' => array('view' => array('showLine' => false, 'showIcon' => true)), 'defaultText' => $this->model->main->name ? $this->model->main->name : '未分类', 'selectNode' => $this->model->main_id ? $this->model->main_id : '')); echo CHtml::closeTag('a'); //置顶 echo CHtml::openTag('a', array('class' => 'brand', 'style' => 'font-size:14px;margin-top:5px;margin-right:0px;margin-bottom:0px;padding-top:0px;padding-bottom:0px;')); echo CHtml::checkBox('top', $checked = $this->model->top ? true : false, array('style' => 'margin-left:36px;margin-bottom:0px;margin-right:0px')); echo CHtml::closeTag('a'); echo CHtml::openTag('a', array('class' => 'brand', 'style' => 'font-size:14px;margin-top:8px;margin-left:0px;margin-bottom:0px;padding-top:0px;padding-bottom:0px;')); echo $this->model->getAttributeLabel('top'); echo CHtml::closeTag('a'); $this->controller->widget('bootstrap.widgets.TbButton', array('label' => '关闭', 'type' => 'primary', 'htmlOptions' => array('class' => 'pull-right', 'style' => 'margin-left:6px;', 'id' => 'btnCancel'))); $this->controller->widget('bootstrap.widgets.TbButton', array('label' => '保存', 'type' => 'danger', 'htmlOptions' => array('style' => 'margin-left:6px;', 'class' => 'pull-right', 'id' => 'btnSave'))); $this->controller->widget('bootstrap.widgets.TbButton', array('label' => '预览', 'htmlOptions' => array('class' => 'pull-right', 'id' => 'btnPrev'))); echo CHtml::closeTag('div'); echo CHtml::closeTag('div'); echo CHtml::closeTag('header'); }
echo CHtml::encode($this->pageTitle); ?> </h3></div> <div class="widget-content"> <?php if (Acl::hasPrivilege($this->privileges, $this->resource, Acl::ACTION_VIEW, FALSE)) { $this->renderPartial('//documentation/_tab'); } ?> <div class="row-fluid"> <div class="span12"> <?php echo CHtml::beginForm(Yii::app()->createUrl($this->route), 'get', array('class' => 'form-search', 'id' => 'cat-filter')); ?> <?php echo CHtml::dropDownList('cat_id', isset($_GET['cat_id']) ? $_GET['cat_id'] : '', CHtml::listData(array_merge(array(array('id' => '', 'name' => 'All')), HelpCategory::model()->getData('id,name')), 'id', 'name'), array('class' => 'span12', 'onchange' => 'MyUtils.triggerSubmit("cat-filter")')); ?> <?php echo CHtml::endForm(); ?> </div> </div> <?php if (!empty($data)) { ?> <ol class="doc-list"> <?php foreach ($data as $row) { ?> <li> <h4><?php
public function actionDeleteHelpCategory($id) { Acl::hasPrivilege($this->privileges, $this->resource, Acl::ACTION_DELETE); HelpCategory::model()->loadModel($id)->delete(); if (!isset($_GET['ajax'])) { $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('helpCategory')); } }
<?php Yii::import('ext.redactor.ImperaviRedactorWidget'); $this->widget('ImperaviRedactorWidget', array('selector' => '.redactor', 'options' => array('imageUpload' => $this->createUrl('uploadRedactor'), 'wym' => false, 'plugins' => array('fullscreen'), 'imageUploadErrorCallback' => new CJavaScriptExpression('function(obj,json) { alert(json.error); console.log(json.error);}')))); $form_id = 'help-topic-form'; $form = $this->beginWidget('CActiveForm', array('id' => $form_id, 'enableAjaxValidation' => false, 'htmlOptions' => array('class' => 'form-horizontal'))); echo $form->errorSummary($model, '', '', array('class' => 'alert alert-error')); ?> <div class="control-group"> <?php echo $form->labelEx($model, 'category_id', array('class' => 'control-label')); ?> <div class="controls"> <?php echo $form->dropDownList($model, 'category_id', CHtml::listData(array_merge(array(array('id' => '', 'name' => '--select-')), HelpCategory::model()->getData('id,name')), 'id', 'name'), array('class' => 'span8 chzn-select')); ?> </div> </div> <div class="control-group"> <?php echo $form->labelEx($model, 'topic', array('class' => 'control-label')); ?> <div class="controls"> <?php echo $form->textField($model, 'topic', array('class' => 'span8', 'maxlength' => 128)); ?> </div> </div> <div class="control-group"> <?php echo $form->labelEx($model, 'body', array('class' => 'control-label'));