예제 #1
0
    <input type="submit" name="changedefaultvisitorsgroup" value="Update"/>
    <?php 
echo \mpf\web\helpers\Form::get()->closeForm();
?>
</div>
<div class="forum-default-group-line">
    <span>Default Members Group:</span>
    <a href="#"><?php 
echo \mpf\modules\forum\models\ForumSection::findByPk($this->sectionId)->defaultMembersGroup->full_name;
?>
</a>
    <?php 
echo \mpf\web\helpers\Form::get()->openForm(['method' => 'post', 'style' => 'display:none;']);
?>
    <?php 
echo \mpf\web\helpers\Form::get()->select('group', \mpf\helpers\ArrayHelper::get()->transform(\mpf\modules\forum\models\ForumUserGroup::findAllByAttributes(['section_id' => $this->sectionId]), ['id' => 'full_name']));
?>
    <input type="submit" name="changedefaultmembersgroup" value="Update"/>
    <?php 
echo \mpf\web\helpers\Form::get()->closeForm();
?>
</div>


<?php 
\mpf\widgets\datatable\Table::get(['dataProvider' => $model->getDataProvider($this->sectionId), 'columns' => ['full_name', 'html_class', 'admin' => ['class' => 'YesNo'], 'moderator' => ['class' => 'YesNo'], 'newthread' => ['class' => 'YesNo'], 'threadreply' => ['class' => 'YesNo'], 'canread' => ['class' => 'YesNo'], ['class' => 'Actions', 'buttons' => ['delete' => ['class' => 'Delete', 'iconSize' => 22, 'url' => $this->getUrlForDatatableAction('delete')], 'edit' => ['class' => 'Edit', 'iconSize' => 22, 'url' => $this->getUrlForDatatableAction('editGroup')]]]]])->display();
?>
<script>
    $(document).ready(function () {
        $('.forum-default-group-line a').click(function () {
            $(this).hide();
예제 #2
0
 /**
  * @return array
  */
 public function getGroupFields()
 {
     $groups = ForumUserGroup::findAllByAttributes(['section_id' => $this->section_id]);
     $fields = [];
     foreach ($groups as $group) {
         $fields[] = ['name' => 'groupRights[' . $group->id . ']', 'type' => 'select', 'htmlOptions' => ['multiple' => 'multiple', 'style' => 'height:85px;'], 'options' => ['admin' => 'Admin', 'moderator' => 'Moderator', 'newthread' => 'Can Start a New Thread', 'threadreply' => 'Can Reply to an open Thread', 'canread' => 'Can View Threads'], 'label' => $group->full_name];
     }
     return $fields;
 }