Пример #1
0
 public function run()
 {
     $form = \yii\widgets\ActiveForm::begin(['id' => 'simple-search-form', 'action' => [$this->options['action']], 'enableAjaxValidation' => false]);
     echo Html::textInput('search', null, ['class' => 'form-control', 'hint' => YBoard::t('yboard', 'Search')]);
     echo Html::hiddenInput('type', '0');
     echo Html::hiddenInput('choice', '0');
     Html::submitButton('Submit', ['class' => 'small-search-button']);
     \yii\widgets\ActiveForm::end();
 }
Пример #2
0
<?php 
/* @var $this ForumController */
/* @var $choiceProvider ActiveDataProvider */
use yii\helpers\Html;
use yii\widgets\ListView;
echo Html::beginForm('', 'post', array('id' => 'yboard-poll-form'));
echo Html::hiddenInput('poll_id', $this->context->poll->id);
echo ListView::widget(['id' => 'yboardPoll', 'dataProvider' => $choiceProvider, 'itemView' => '_pollChoice', 'summary' => false]);
echo '<div>';
echo Html::button(YBoard::t('yboard', 'Vote'), ['class' => 'btn btn-default btn-sm', 'onclick' => 'vote("' . Yii::$app->urlManager->createAbsoluteUrl($this->context->module->id . '/forum/vote') . '");']);
echo '</div>';
echo Html::endForm();
Пример #3
0
use yii\helpers\Html;
use yii\widgets\DetailView;
/**
 * @var yii\web\View $this
 * @var app\modules\yboard\models\YBoardForum $model
 */
$this->title = $model->name;
$this->params['breadcrumbs'] = [['label' => YBoard::t('yboard', 'Forums'), 'url' => ['forum/index']], ['label' => YBoard::t('yboard', 'YBoard Forums'), 'url' => ['index']], $this->title];
?>
<div class="yboard-forum-view">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a(YBoard::t('yboard', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
        <?php 
echo Html::a(YBoard::t('yboard', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => YBoard::t('yboard', 'Are you sure you want to delete this item?'), 'method' => 'post']]);
?>
    </p>

    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'cat_id', 'name', 'subtitle', 'type', 'public', 'locked', 'moderated', 'sort', 'num_posts', 'num_topics', 'last_post_id', 'poll', 'membergroup_id']]);
?>

</div>
Пример #4
0
 /**
  * Declares customized attribute labels.
  * If not declared here, an attribute would have a label that is
  * the same as its name with the first letter in upper case.
  */
 public function attributeLabels()
 {
     return array('subject' => YBoard::t('yboard', 'Subject'));
 }
Пример #5
0
    <?php 
// echo $form->field($model, 'num_topics')
?>

    <?php 
// echo $form->field($model, 'last_post_id')
?>

    <?php 
// echo $form->field($model, 'poll')
?>

    <?php 
// echo $form->field($model, 'membergroup_id')
?>

    <div class="form-group">
        <?php 
echo Html::submitButton(YBoard::t('yboard', 'Search'), ['class' => 'btn btn-primary']);
?>
        <?php 
echo Html::resetButton(YBoard::t('yboard', 'Reset'), ['class' => 'btn btn-default']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>
Пример #6
0
echo $form->field($model, 'read_indicator')->textInput();
?>

    <?php 
echo $form->field($model, 'type')->textInput();
?>

    <?php 
echo $form->field($model, 'inbox')->textInput();
?>

    <?php 
echo $form->field($model, 'outbox')->textInput();
?>

    <?php 
echo $form->field($model, 'post_id')->textInput(['maxlength' => 10]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? YBoard::t('yboard', 'Create') : YBoard::t('yboard', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>
Пример #7
0
echo YBoardMember::find()->count();
?>
</div>
			</div>
            
            <div class="row">
				<div class="col-md-6"><?php 
echo YBoard::t('yboard', 'Newest member');
?>
</div>
                <div class="col-md-6"> <?php 
$member = YBoardMember::find()->newestScope()->one();
echo $member === null ? '&nbsp;' . YBoard::t('yboard', 'No new member yet') : Html::a($member->profile->username, ['member/view', 'id' => $member->id]);
?>
</div>
			</div>
            
            <div class="row">
				<div class="col-md-6"><?php 
echo YBoard::t('yboard', 'Visitors today');
?>
</div>
                <div class="col-md-6"><?php 
echo YBoardSession::find()->count();
?>
</div>
			</div>             
		</div>
</div>  
<?php 
echo $this->render('_changeForum');
Пример #8
0
 * @var yii\data\ActiveDataProvider $dataProvider
 * @var app\modules\yboard\models\YBoardMessageSearch $searchModel
 */
$this->title = YBoard::t('yboard', 'YBoard Messages');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="yboard-message-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <?php 
echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a(YBoard::t('yboard', 'Create {modelClass}', ['modelClass' => 'YBoard Message']), ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo ListView::widget(['dataProvider' => $dataProvider, 'itemOptions' => ['class' => 'item'], 'itemView' => function ($model, $key, $index, $widget) {
    return Html::a(Html::encode($model->id), ['view', 'id' => $model->id]);
}]);
?>

</div>
Пример #9
0
<?php

use yii\helpers\Html;
/**
 * @var yii\web\View $this
 * @var app\modules\yboard\models\YBoardMessage $model
 */
$this->title = YBoard::t('yboard', 'Update {modelClass}: ', ['modelClass' => 'YBoard Message']) . ' ' . $model->id;
$this->params['breadcrumbs'][] = ['label' => YBoard::t('yboard', 'YBoard Messages'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = YBoard::t('yboard', 'Update');
?>
<div class="yboard-message-update">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <?php 
echo $this->render('_form', ['model' => $model]);
?>

</div>
Пример #10
0
?>
 &nbsp;
        <?php 
echo Html::activeHiddenInput($poll, 'expire_date', ['id' => 'expire_date']);
?>
    
        <strong>
            <?php 
echo YBoard::t('yboard', 'Poll expires');
?>
:
        </strong>

        
        <?php 
echo \yii\jui\DatePicker::widget(['name' => 'expiredate', 'dateFormat' => 'yyyy-MM-dd', 'clientOptions' => ['defaultDate' => $poll->expire_date, 'showAnim' => 'fold', 'onSelect' => new \yii\web\JsExpression('function(date, picker){
                    $("#expire_date").val(date);
                }')]]);
?>
 
    </div>
    <div class="form-group">
           <?php 
echo Html::submitButton(YBoard::t('yboard', 'Save'), ['class' => 'btn btn-primary btn-md']);
?>
    </div>
    <?php 
ActiveForm::end();
?>
</div><!-- form -->
Пример #11
0
<?php

/* @var $this ForumController */
/* @var $model YBoardChoice */
$percentage = $this->context->poll->votes ? $model->votes / $this->context->poll->votes * 100 : 0;
$percentage = round($percentage);
use yii\jui\ProgressBar;
?>

<div class="poll">
    <?php 
echo $model->choice . ' (' . $model->votes . ' ' . YBoard::t('yboard', 'votes') . ' ' . $percentage . '%)';
?>
    <?php 
echo ProgressBar::widget(['class' => 'poll-progress', 'clientOptions' => ['value' => $percentage]]);
?>
</div>