Esempio n. 1
0
	<div id="yboard-message"></div><br>
    <p class="pull-right pad5-right"><?php 
echo Html::button(YBoard::t('yboard', 'New message'), ['class' => 'btn btn-default btn-md', 'style' => 'cursor:pointer;', 'onclick' => 'sendPm(' . Yii::$app->user->id . '); return false;']);
?>
</p>
 
    <?php 
\yii\widgets\Pjax::begin();
?>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => null, 'id' => 'inbox-grid-box', 'rowOptions' => function ($model, $index, $widget, $grid) {
    return ['class' => $model->read_indicator ? '' : 'unread', 'id' => 'msg_id_' . $model->id];
}, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'sendfrom', 'value' => function ($model, $key, $index, $column) {
    return $model->sender->profile->username;
}], 'subject', ['attribute' => 'create_time', 'value' => function ($model, $key, $index, $column) {
    return DateTimeCalculation::short($model->create_time);
}], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{view}{reply}{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']), '#', ['style' => 'margin-left:5px;', 'onclick' => new JsExpression('
                                viewMessage("' . $model->id . '", "' . Yii::$app->urlManager->createAbsoluteUrl($this->context->module->id . '/message/view', ['id' => $model->id]) . '");
                                return false; 
                                ')]);
}, 'reply' => function ($url, $model) {
    // return the button HTML code
    $src = $this->context->module->getRegisteredImage('reply.png');
    return Html::a(Html::img($src, ['alt' => 'reply']), '#', ['style' => 'margin-left:5px;', 'onclick' => new JsExpression('
                                replyMessage(' . $model->sendfrom . ')
                                return false; 
                                ')]) . ' ';
}, 'delete' => function ($url, $model) {
Esempio n. 2
0
                <div class="forum-cell col-md-3 last-cell">
                    <div class="hidden-xs"> 
                        <?php 
    if ($forum->last_post_id && $forum->lastPost) {
        echo Html::a(Html::encode($forum->lastPost->topic->title), ['topic', 'id' => $forum->lastPost->topic_id]);
        echo '<br>' . YBoard::t('yboard', 'Last post by') . ' ' . Html::encode($forum->lastPost->poster->profile->username);
        echo Html::a(Html::img($this->context->module->getRegisteredImage('next.png'), ['style' => 'margin-left:5px;', 'title' => YBoard::t('yboard', 'view last post')]), ['topic', 'id' => $forum->lastPost->topic_id, 'nav' => 'last']);
        echo '<br>';
        echo ' ' . YBoard::t('yboard', 'on') . ' ' . DateTimeCalculation::medium($forum->lastPost->create_time);
    } else {
        echo YBoard::t('yboard', 'No posts');
    }
    ?>
                    </div>
                    
                    <div class="visible-xs">
                        <?php 
    echo YBoard::t('yboard', '{topics, plural, =0{No Topic} =1{One Topic} other{# Topics}}. Last Post {time}', ['topics' => $forum->num_topics == null ? 0 : $forum->num_topics, 'time' => DateTimeCalculation::short($forum->lastPost == null ? 0 : $forum->lastPost->create_time)]);
    ?>
                    </div>
                </div>
            </div>
        <?php 
}
?>
        <!-- /do render forums here-->
    </div>
    
</div> 

Esempio n. 3
0
<div class="row topic visible-xs"> 
    <div class="col-xs-2 forum-cell <?php 
echo $this->context->topicIcon($model);
?>
"> </div>
    
    <div class="col-xs-10 forum-cell main"> 
        <div class="header3">
            <?php 
echo Html::a(Html::encode($model->title) . ' ' . ($model->approved == 0 ? YBoard::t('yboard', '[Pending]') : ''), ['topic', 'id' => $model->id], ['class' => $model->hasPostedClass()]);
?>
        </div>
        <div>
            <?php 
echo YBoard::t('yboard', '{replies, plural, =0{No Reply} =1{One Reply} other{# Replies}}. Last: {user} {time}', ['replies' => $model->num_replies, 'user' => Html::encode($model->lastPost->poster->profile->username), 'time' => DateTimeCalculation::short($model->lastPost->create_time)]);
?>
        </div>
    </div>
</div>

<div class="row topic hidden-xs">  
    <div class="col-md-1 forum-cell <?php 
echo $this->context->topicIcon($model);
?>
">
    </div>
    
    <div class="forum-cell main col-md-4">
        <div class="row">
            <div class="col-md-12 header2">
Esempio n. 4
0
?>

<div class="yboard-ban-index">

    <p class="header2"><?php 
echo Html::encode($this->title);
?>
</p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'user_id', 'value' => function ($model, $index, $dataColumn) {
    return $model->member->profile->username;
}], ['attribute' => 'banned_by', 'value' => function ($model, $index, $dataColumn) {
    return $model->banner->profile->username;
}], ['attribute' => 'expires', 'format' => 'raw', 'value' => function ($model, $index, $dataColumn) {
    return Editable::widget(['value' => DateTimeCalculation::short($model->expires), 'name' => 'expires', 'options' => ['name' => 'expires'], 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_DATETIME, 'formOptions' => ['action' => url::to(['moderator/change-ban-period', 'id' => $model->id])]]);
}], 'ip', 'email:email', ['class' => 'yii\\grid\\ActionColumn', 'template' => '{lift} {reason}', 'buttons' => ['lift' => function ($url, $model, $key) {
    return Html::a('<span class="glyphicon glyphicon-tint"></span>', '#', ['title' => YBoard::t('yboard', 'Lift Ban'), 'onclick' => 'if(confirm("' . YBoard::t('yboard', 'Do you really Lift this Ban') . '")) { banLift("' . Yii::$app->urlManager->createAbsoluteUrl([$this->context->module->id . '/moderator/ban-lift', 'id' => $model->id]) . '"); }return false; ']);
}, 'reason' => function ($url, $model, $key) {
    return Html::a('<span class="glyphicon glyphicon-envelope"></span>', '#', ['title' => YBoard::t('yboard', 'Ban Reason'), 'onclick' => 'banMessage(\'' . $model->message . '\')']);
}]]]]);
?>

</div>

<?php 
Dialog::begin(['id' => 'dlgBanMsg', 'clientOptions' => ['modal' => true, 'title' => YBoard::t('yboard', 'Ban Reason'), 'autoOpen' => false, 'modal' => true, 'height' => 'auto', 'min-height' => 100, 'width' => 200, 'buttons' => [['text' => YBoard::t('yboard', 'close'), 'class' => 'btn btn-sm btn-danger', 'click' => new \yii\web\JsExpression(' function() { $( this ).dialog( "close" ); }')]]]]);
?>
    
    <div id="dlgBanMsgText" class="alert alert-warning panel"></div>
    
 /** Change Ban Time
  */
 public function actionChangeBanPeriod($id)
 {
     if (!Yii::$app->user->can('app.forum.moderator.change-ban-period')) {
         throw new ForbiddenHttpException(YBoard::t('yboard', 'You have no enough permission to access this page! If you think its a mistake, please consider reporting to us.'));
     }
     if (!Yii::$app->request->isAjax) {
         Yii::$app->end();
     }
     if (isset($_POST['hasEditable']) && isset($_POST['expires'])) {
         $attrib = $_POST['expires'];
         $attrib = strtotime($attrib);
         $model = YBoardBan::findOne($id);
         if ($model == null) {
             echo json_encode(['output' => '', 'message' => 'Could Not Update Field']);
             Yii::$app->end();
         }
         $model->expires = $attrib;
         if (!$model->save()) {
             // validation error
             echo json_encode(['output' => '', 'message' => 'Could Not Update Field']);
         } else {
             // read or convert your posted information
             $value = DateTimeCalculation::short($model->expires);
             echo json_encode(['output' => $value, 'message' => '']);
         }
     } else {
         throw new ForbiddenHttpException(YBoard::t('yboard', 'This Action is forbidden!'));
     }
 }