本文整理汇总了PHP中Logs::getLogType方法的典型用法代码示例。如果您正苦于以下问题:PHP Logs::getLogType方法的具体用法?PHP Logs::getLogType怎么用?PHP Logs::getLogType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Logs
的用法示例。
在下文中一共展示了Logs::getLogType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
/**
* Вьюшка деталей записи системного лога
*/
/**
* @author Craft-Soft Team
* @package CS:Bans
* @version 1.4.0
* @copyright (C)2016 Craft-Soft.ru. Все права защищены.
* @link http://craft-soft.ru/
* @license http://creativecommons.org/licenses/by-nc-sa/4.0/deed.ru «Attribution-NonCommercial-ShareAlike»
*/
$this->pageTitle = Yii::app()->name . ' :: Админцентр - Системный лог';
$this->breadcrumbs = array('Logs' => array('index'), $model->id);
$this->menu = array(array('label' => 'Все записи', 'url' => array('admin')));
$this->renderPartial('/admin/mainmenu', array('active' => 'site', 'activebtn' => 'logs'));
?>
<h2>Запись №<?php
echo $model->id;
?>
</h2>
<?php
$this->widget('bootstrap.widgets.TbDetailView', array('data' => $model, 'attributes' => array('id', array('name' => 'timestamp', 'type' => 'datetime', 'value' => $model->timestamp), 'ip', 'username', array('name' => 'action', 'value' => Logs::getLogType($model->action)), array('name' => 'remarks', 'type' => 'raw', 'value' => CHtml::decode($model->remarks)))));
示例2: array
*/
$this->pageTitle = Yii::app()->name . ' :: Админцентр - Системный лог';
$this->breadcrumbs = array('Админцентр' => array('/admin/index'), 'Системный лог');
$this->menu = array(array('label' => 'Удалить все записи', 'url' => '#', 'linkOptions' => array('id' => 'clearLog')));
Yii::app()->clientScript->registerScript('', '
$("a#clearLog").click(function(){
if(!confirm("Удалить все записи лога?"))
return false;
var ret = "";
$.post("", {"clearlog": 1}, function(data){
jQuery("#logs-grid").yiiGridView("update");
alert("Лог очищен");
});
return false;
});
function reinstallDatePicker(id, data) {
$("#timestamp").datepicker(jQuery.extend({showMonthAfterYear:false},jQuery.datepicker.regional["ru"],{"showAnim":"fold"}));
}
');
$this->renderPartial('/admin/mainmenu', array('active' => 'site', 'activebtn' => 'logs'));
?>
<h2>Системный лог</h2>
<?php
$criteria = new CDbCriteria();
$criteria->group = 'username';
$this->widget('bootstrap3.widgets.BsGridView', array('id' => 'logs-grid', 'type' => 'bordered', 'enableHistory' => true, 'dataProvider' => $model->search(), 'filter' => $model, 'afterAjaxUpdate' => 'reinstallDatePicker', 'columns' => array(array('name' => 'timestamp', 'type' => 'datetime', 'value' => '$data->timestamp', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'id' => 'timestamp', 'attribute' => 'timestamp', 'language' => 'ru', 'i18nScriptFile' => 'jquery-ui-i18n.min.js', 'htmlOptions' => array('id' => 'timestamp', 'size' => '10', 'class' => 'form-control'), 'options' => array('showAnim' => 'fold')), true)), array('name' => 'username', 'filter' => CHtml::listData(Logs::model()->findAll($criteria), 'username', 'username')), array('name' => 'action', 'value' => 'Logs::getLogType($data->action)', 'filter' => Logs::getLogType(FALSE, TRUE)), array('class' => 'bootstrap3.widgets.BsButtonColumn', 'template' => '{view} {delete}'))));