当前位置: 首页>>代码示例>>PHP>>正文


PHP Comment::getStatuses方法代码示例

本文整理汇总了PHP中Comment::getStatuses方法的典型用法代码示例。如果您正苦于以下问题:PHP Comment::getStatuses方法的具体用法?PHP Comment::getStatuses怎么用?PHP Comment::getStatuses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Comment的用法示例。


在下文中一共展示了Comment::getStatuses方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionUpdateStatus

 public function actionUpdateStatus()
 {
     $ids = Yii::app()->request->getPost('ids');
     $status = Yii::app()->request->getPost('status');
     $models = Comment::model()->findAllByPk($ids);
     if (!array_key_exists($status, Comment::getStatuses())) {
         throw new CHttpException(404, Yii::t('CommentsModule.admin', 'Ошибка проверки статуса.'));
     }
     if (!empty($models)) {
         foreach ($models as $comment) {
             $comment->status = $status;
             $comment->save();
         }
     }
     echo Yii::t('CommentsModule', 'Статус успешно изменен');
 }
开发者ID:kolbensky,项目名称:rybolove,代码行数:16,代码来源:CommentsController.php

示例2: array

            <div class="col-md-11 col-sm-10">
            <?php echo $form->textArea($model, 'text', 
                array(
                    'class'=>'form-control',
                    'rows'=>5,
                    'placeholder'=>'Отзыв'
                )); 
                ?>

            </div>
        </div> <!-- / .form-group -->
        <div class="form-group">
                <?php echo $form->label($model, 'status',  array('class'=>'col-md-1 col-sm-2 control-label')); ?>
                <div class="col-md-11 col-sm-10">
                <?php
                echo $form->dropDownList($model, 'status', Comment::getStatuses(), array(
                        'encode'=>false,
                       // 'empty'=>'Выбрать',
                        'class'=>'form-control',    
                ));

                ?>
                </div>
        </div>
  

       

<div style="margin-bottom: 0;" class="form-group">
            <div class="col-md-offset-1 col-md-11 col-sm-offset-2 col-sm-10">
                <button class="btn btn-primary" type="submit"><?php echo $model->isNewRecord ? 'Создать' : 'Сохранить'; ?></button>
开发者ID:Aplay,项目名称:Fastreview_site,代码行数:31,代码来源:_form.php

示例3: Comment

<?php

/**
 * Product comments
 *
 * @var $model StoreProduct
 */
Yii::import('comments.models.Comment');
$module = Yii::app()->getModule('comments');
$comments = new Comment('search');
if (!empty($_GET['Comment'])) {
    $comments->attributes = $_GET['Comment'];
}
$comments->class_name = 'application.modules.store.models.StoreProduct';
$comments->object_pk = $model->id;
// Fix sort url
$dataProvider = $comments->search();
$dataProvider->pagination->pageSize = Yii::app()->settings->get('core', 'productsPerPageAdmin');
$dataProvider->sort->route = 'applyCommentsFilter';
$dataProvider->pagination->route = 'applyCommentsFilter';
$this->widget('ext.sgridview.SGridView', array('dataProvider' => $dataProvider, 'id' => 'productCommentsListGrid', 'filter' => $comments, 'ajaxUrl' => Yii::app()->createUrl('/store/admin/products/applyCommentsFilter', array('id' => $model->id)), 'enableHistory' => false, 'columns' => array(array('class' => 'CCheckBoxColumn'), array('class' => 'SGridIdColumn', 'name' => 'id'), array('name' => 'name', 'type' => 'raw', 'value' => 'CHtml::link(CHtml::encode($data->name), array("/comments/admin/comments/update", "id"=>$data->id))'), array('name' => 'email'), array('name' => 'text', 'value' => 'Comment::truncate($data, 100)'), array('name' => 'status', 'filter' => Comment::getStatuses(), 'value' => '$data->statusTitle'), array('name' => 'created'), array('class' => 'CButtonColumn', 'updateButtonUrl' => 'Yii::app()->createUrl("/comments/admin/comments/update", array("id"=>$data->id))', 'deleteButtonUrl' => 'Yii::app()->createUrl("/comments/admin/comments/delete", array("id"=>$data->id))', 'template' => '{update}{delete}'))));
开发者ID:kolbensky,项目名称:rybolove,代码行数:21,代码来源:_comments.php

示例4: array

		 /* array(
			'name'  => 'name',
			'type'  => 'raw',
			'value' => 'CHtml::link(CHtml::encode($data->name), array("update", "id"=>$data->id))',
		),
		array(
			'name'=>'email',
		), */
		array(
			'header' => 'Отзыв',
			'name'=>'text',
			// 'value'=>'Comment::truncate($data, 100)'
		),
		array(
			'name'=>'status',
			'filter'=>Comment::getStatuses(),
			'value'=>'$data->statusTitle',
		),

		
		array(
			'header' => 'Объект',
            'type'=>'raw',
			'value'=>'CHtml::link($data->getOwner_title(), $data->getViewUrlAdmin(), array("target"=>"_blank"))',
			'filter'=>false
		),

		array(
			'header' => 'Дата',
			'name'=>'created',
			'filter'=>false
开发者ID:Aplay,项目名称:Fastreview_site,代码行数:31,代码来源:index.php

示例5: array

<?php

/**
 * Display comments list
 *
 * @var $model Comment
 **/
Yii::app()->clientScript->registerScriptFile($this->module->assetsUrl . '/admin/comments.index.js');
$this->pageHeader = Yii::t('CommentsModule.core', 'Комментарии');
$this->breadcrumbs = array('Home' => $this->createUrl('/admin'), Yii::t('CommentsModule.core', 'Комментарии'));
$this->widget('ext.sgridview.SGridView', array('dataProvider' => $dataProvider, 'id' => 'commentsListGrid', 'filter' => $model, 'customActions' => array(array('label' => Yii::t('CommentsModule.core', 'Подтвержден'), 'url' => '#', 'linkOptions' => array('onClick' => 'return setCommentsStatus(1, this);')), array('label' => Yii::t('CommentsModule.core', 'Ждет одобрения'), 'url' => '#', 'linkOptions' => array('onClick' => 'return setCommentsStatus(0, this);')), array('label' => Yii::t('CommentsModule.core', 'Спам'), 'url' => '#', 'linkOptions' => array('onClick' => 'return setCommentsStatus(2, this);'))), 'columns' => array(array('class' => 'CCheckBoxColumn'), array('class' => 'SGridIdColumn', 'name' => 'id'), array('name' => 'name', 'type' => 'raw', 'value' => 'CHtml::link(CHtml::encode($data->name), array("update", "id"=>$data->id))'), array('name' => 'email'), array('name' => 'text', 'value' => 'Comment::truncate($data, 100)'), array('name' => 'status', 'filter' => Comment::getStatuses(), 'value' => '$data->statusTitle'), array('name' => 'owner_title', 'filter' => false), 'ip_address', array('name' => 'created'), array('class' => 'CButtonColumn', 'template' => '{update}{delete}'))));
开发者ID:kolbensky,项目名称:rybolove,代码行数:11,代码来源:index.php

示例6: array

<?php

/**
 * Comment form
 */
Yii::import('zii.widgets.jui.CJuiDatePicker');
return array('id' => 'commentUpdateForm', 'elements' => array('tab1' => array('type' => 'form', 'title' => '', 'elements' => array('status' => array('type' => 'dropdownlist', 'items' => Comment::getStatuses()), 'name' => array('type' => 'text'), 'email' => array('type' => 'text'), 'text' => array('type' => 'textarea', 'style' => 'height:200px'), 'created' => array('type' => 'CJuiDatePicker', 'options' => array('dateFormat' => 'yy-mm-dd ' . date('H:i:s'))), 'updated' => array('type' => 'CJuiDatePicker', 'options' => array('dateFormat' => 'yy-mm-dd ' . date('H:i:s')))))));
开发者ID:kolbensky,项目名称:rybolove,代码行数:7,代码来源:commentForm.php


注:本文中的Comment::getStatuses方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。