Ejemplo n.º 1
0
?>
</span><br>
            <p><?php 
echo YBoard::t('yboard', 'Banned on: {time}', ['time' => DateTimeCalculation::long($model->banned_on)]);
?>
</p>
            <p><?php 
echo YBoard::t('yboard', 'Ban Type: {type}', ['type' => $isIp ? YBoard::t('yboard', 'IP Ban') : YBoard::t('yboard', 'Member Ban')]);
?>
</p>
            <p><?php 
echo YBoard::t('yboard', 'Reason: {reason}', ['reason' => $model->message]);
?>
</p>                
            <p><?php 
echo YBoard::t('yboard', 'Ban to Lift on: {time}', ['time' => DateTimeCalculation::long($model->expires)]);
?>
</p>                
            <p><?php 
echo YBoard::t('yboard', 'Ban length: {days} days {hours} hours', DateTimeCalculation::getDiff($model->banned_on, $model->expires));
?>
</p>                
            <p><?php 
echo YBoard::t('yboard', 'Remained: {days} days {hours} hours', DateTimeCalculation::getDiff(time(), $model->expires));
?>
</p>                
         </div>
    </div>	
</div>

Ejemplo n.º 2
0
	
	<div class="progress"><div class="progressbar" style="width:<?php 
echo 2 * $count['outbox'];
?>
%"> </div></div>
     
	<div id="yboard-message"></div><br>
    
<?php 
\yii\widgets\Pjax::begin();
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => null, 'id' => 'outbox-grid-box', 'rowOptions' => function ($model, $index, $widget, $grid) {
    return ['class' => $model->read_indicator ? '' : 'unread'];
}, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'sendto', 'value' => function ($model, $key, $index, $column) {
    return $model->receiver == null ? YBoard::t('yboard', 'Management') : $model->receiver->profile->username;
}], 'subject', ['attribute' => 'create_time', 'value' => function ($model, $key, $index, $column) {
    return DateTimeCalculation::long($model->create_time);
}], ['attribute' => 'type', 'value' => function ($model, $key, $index, $column) {
    return $model->type ? Yii::t("app", "notification") : Yii::t("app", "message");
}], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{view}{delete}', 'buttons' => ['view' => function ($url, $model) {
    // return the button HTML code
    $src = $this->context->module->getRegisteredImage('view.png');
    return Html::a(Html::img($src, ['alt' => 'view']), $model->id, ['style' => 'margin-left:5px;', 'onclick' => new JsExpression('
                                viewMessage($(this).attr("href"), "' . Yii::$app->urlManager->createAbsoluteUrl($this->context->module->id . '/message/view') . '");
                                return false; 
                                ')]);
}, 'delete' => function ($url, $model) {
    // return the button HTML code
    $src = $this->context->module->getRegisteredImage('delete.png');
    return Html::a(Html::img($src, ['alt' => 'view']), '#', ['style' => 'margin-left:5px;', 'onclick' => new \yii\web\JsExpression('
                                what = confirm("' . Yii::t('yii', 'Are you sure you want to delete this item?') . '");
                                if(what)