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'));
     }
 }
示例#2
0
文件: index.php 项目: wanyos2005/hsbf
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 
示例#3
0
文件: _form.php 项目: wanyos2005/hsbf
<?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'));