Ejemplo n.º 1
3
 protected function getApixCheckboxGroupHtml($form, $config, $field)
 {
     $model = $config['model'];
     $fieldHtml = null;
     $fieldOptions = $field->options;
     if (isset($fieldOptions['items'])) {
         $items = $fieldOptions['items'];
         unset($fieldOptions['items']);
         $fieldHtml = Html::checkboxList($model . "[{$field->name}]", null, $items, $field->options);
     } else {
         $fieldHtml = Html::checkboxList($model . "[{$field->name}]", null, [], $field->options);
     }
     if ($config['label']) {
         $fieldHtml = "<div class='frm-field'><label>{$field->label}</label>{$fieldHtml}<span class='error' cmt-error='{$field->name}'></span></div>";
     } else {
         $fieldHtml = "<div class='frm-field'>{$fieldHtml}<span class='error' cmt-error='{$field->name}'></span></div>";
     }
     return $fieldHtml;
 }
Ejemplo n.º 2
2
 public function actionForm()
 {
     echo Html::beginForm();
     echo Html::checkboxList('test', ['value 1' => 'item 1', 'value 2' => 'item 2', 'value 3' => 'item 3'], isset($_POST['test']) ? $_POST['test'] : null, function ($index, $label, $name, $value, $checked) {
         return Html::label($label . ' ' . Html::checkbox($name, $value, $checked), null, ['class' => 'inline checkbox']);
     });
     echo Html::submitButton();
     echo Html::endForm();
     print_r($_POST);
 }
Ejemplo n.º 3
2
 /**
  *
  */
 public function run()
 {
     $view = $this->getView();
     $this->registerScript($view);
     if ($this->hasModel()) {
         $list = Html::activeCheckboxList($this->model, $this->attribute, $this->items, $this->options);
     } else {
         $list = Html::checkboxList($this->name, $this->value, $this->items, $this->options);
     }
     $input = Html::tag('div', $list, $this->containerOptions);
     echo strtr($this->template, ['{input}' => $input]);
 }
Ejemplo n.º 4
2
    public function testCheckboxList()
    {
        $this->assertEquals('<div></div>', Html::checkboxList('test'));
        $expected = <<<EOD
<div><div class="checkbox"><label><input type="checkbox" name="test[]" value="value1"> text1</label></div>
<div class="checkbox"><label><input type="checkbox" name="test[]" value="value2" checked> text2</label></div></div>
EOD;
        $this->assertEqualsWithoutLE($expected, Html::checkboxList('test', ['value2'], $this->getDataItems()));
        $expected = <<<EOD
<div><div class="checkbox"><label><input type="checkbox" name="test[]" value="value1&lt;&gt;"> text1&lt;&gt;</label></div>
<div class="checkbox"><label><input type="checkbox" name="test[]" value="value  2"> text  2</label></div></div>
EOD;
        $this->assertEqualsWithoutLE($expected, Html::checkboxList('test', ['value2'], $this->getDataItems2()));
        $expected = <<<EOD
<input type="hidden" name="test" value="0"><div><div class="checkbox"><label><input type="checkbox" name="test[]" value="value1"> text1</label></div><br>
<div class="checkbox"><label><input type="checkbox" name="test[]" value="value2" checked> text2</label></div></div>
EOD;
        $this->assertEqualsWithoutLE($expected, Html::checkboxList('test', ['value2'], $this->getDataItems(), ['separator' => "<br>\n", 'unselect' => '0']));
        $expected = <<<EOD
<div>0<label>text1 <input type="checkbox" name="test[]" value="value1"></label>
1<label>text2 <input type="checkbox" name="test[]" value="value2" checked></label></div>
EOD;
        $this->assertEqualsWithoutLE($expected, Html::checkboxList('test', ['value2'], $this->getDataItems(), ['item' => function ($index, $label, $name, $checked, $value) {
            return $index . Html::label($label . ' ' . Html::checkbox($name, $checked, ['value' => $value]));
        }]));
    }
Ejemplo n.º 5
2
    <?php 
$form = ActiveForm::begin();
?>

    <div class="tbox">
    	<div class="hd">继承角色:</div>
    	<?php 
$existItems = array_keys($existItems);
echo Html::checkboxList('selectedRoles', $existItems, ArrayHelper::map($allRoles, 'name', 'name'));
?>
    
    </div>
    <div class="tbox">
    	<div class="hd">设置权限:</div>
    	<?php 
echo Html::checkboxList('selectedPermissions', $existItems, ArrayHelper::map($allPermissions, 'name', 'name'));
?>
    </div>
    
  

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

    <?php 
ActiveForm::end();
?>
 /**
  * render the html input for the widget
  */
 protected function renderInput()
 {
     if ($this->hasModel()) {
         $content = Html::activeCheckboxList($this->model, $this->attribute, $this->items, $this->options);
     } else {
         $content = Html::checkboxList($this->name, $this->value, $this->items, $this->options);
     }
     return Html::tag('div', $content, ['id' => $this->widgetId . '-checkbox', 'class' => 'checkbox_button_group' . '_checkbox']);
 }
Ejemplo n.º 7
1
" data-parent="#create-menu-items" data-toggle="collapse"
               class="collapsed" aria-expanded="false">
                <?php 
    echo $postType->post_type_pn;
    ?>

            </a>
        </h4>
    </div>
    <div class="panel-collapse collapse post-type-menu" id="post-type-<?php 
    echo $postType->id;
    ?>
">
        <div class="box-body">
            <?php 
    echo Html::checkboxList('postIds', null, ArrayHelper::map($postType->posts, 'id', 'post_title'), ['class' => 'checkbox post-type-menu-item ', 'separator' => '<br />']);
    ?>

        </div>
        <div class="box-footer">
            <?php 
    echo Html::hiddenInput('type', 'post');
    ?>

            <?php 
    echo Html::submitButton(Yii::t('writesdown', 'Add Menu'), ['class' => 'btn btn-flat btn-primary btn-create-menu-item']);
    ?>

        </div>
    </div>
    <?php 
<?php

use yii\helpers\Html;
use porcelanosa\yii2options\models\OptionsList;
/**
 * @var $optionList          OptionsList
 * @var $option_name         string
 * @var $multipleValuesArray array
 * @var $status_preset_items array
 *
 */
?>

<div style="margin-bottom: 20px; padding: 5px; border: 1px solid rgba(166, 166, 166, 0.71)">
	<label>&nbsp;<?php 
echo $optionList->name;
?>
</label><br>
	<?php 
echo Html::checkboxList($option_name, $multipleValuesArray, $status_preset_items, ['id' => $option_name, 'class' => 'form-control', 'multiple' => 'true', 'itemOptions' => ['class' => 'i-check', 'style' => 'display:inline-block']]);
?>
</div>
Ejemplo n.º 9
1
 /**
  * @param $name
  * @param $value
  * @param $options
  * @return string
  */
 protected function renderCheckboxList($name, $value, $options)
 {
     if (!array_key_exists('unselect', $options)) {
         $options['unselect'] = '';
     }
     $options['item'] = function ($index, $label, $name, $checked, $value) {
         return '<div class="checkbox">' . Html::checkbox($name, $checked, ['label' => $label, 'value' => $value]) . '</div>';
     };
     $input = Html::checkboxList($name, $value, $this->prepareItems($this->items), $options);
     return Html::tag('div', $input, ['class' => 'checkbox-list']);
 }
 protected function renderCheckboxList($name, $value, $options)
 {
     $options['item'] = function ($index, $label, $name, $checked, $value) {
         return '<div class="checkbox">' . Html::checkbox($name, $checked, ['label' => $label, 'value' => $value]) . '</div>';
     };
     $input = Html::checkboxList($name, $value, $this->items, $options);
     return Html::tag('div', $input, ['class' => 'checkbox']);
 }
Ejemplo n.º 11
1
</h1>

    <?php 
$form = ActiveForm::begin();
?>
    <?php 
$existRoles = array_keys($existRoles);
foreach ($allRoles as $group => $roles) {
    ?>
	    <div class="tbox">
	    	<div class="hd"><?php 
    echo $group;
    ?>
</div>
	    	<?php 
    echo Html::checkboxList('selectedRoles', $existRoles, ArrayHelper::map($roles, 'name', 'description'));
    ?>
	    </div>
    <?php 
}
?>
    
 

    <div class="form-group">
        <?php 
echo Html::submitButton('Update', ['class' => 'btn btn-primary', 'name' => 'submit']);
?>
    </div>

    <?php 
Ejemplo n.º 12
1
<?php

use yii\helpers\Html;
use yii\bootstrap\Collapse;
use themes\admin360\widgets\Panel;
use themes\admin360\widgets\Button;
$this->title = 'اعطای دسترسی به کاربر';
$this->params['breadcrumbs'][] = $this->title;
$accordion = [];
foreach ($modules as $moduleId => $title) {
    $accordion[$moduleId]['label'] = $title;
    $accordion[$moduleId]['content'] = Html::checkboxList("permisions", $userPermissions, $allPermissions[$moduleId], ['itemOptions' => ['labelOptions' => ['class' => 'checkbox-inline']]]);
    $accordion[$moduleId]['contentOptions'] = ['class' => 'in'];
}
?>

<div class="row">
    <div class="col-sm-12">
        <?php 
Box::begin(['title' => 'اعطای دسترسی', 'options' => ['class' => 'box-solid box-primary']]);
?>
            <?php 
echo Html::beginForm();
?>
            <?php 
echo Collapse::widget(['items' => $accordion]);
?>
            <?php 
echo Html::submitButton('<i class="fa fa-save"></i> ذخیره', ['class' => 'btn btn-lg btn-flat margin bg-green']);
?>
            <?php 
Ejemplo n.º 13
1
<?php

/* @var $postmsg string */
use yii\bootstrap\ActiveForm;
use yii\helpers\Html;
?>
<div class="pizzamaster">
<h3>Калькулятор пиццы - Шаг 3</h3>
<div class="body_pizzamaster">
<?php 
$form = ActiveForm::begin(['method' => 'post', 'action' => ['']]);
?>
<p>
<label>Дополнительные опции</label>
<?php 
echo Html::checkboxList('optionsPizza', null, $arrOptions);
?>
 
</p>
<p class="submit_button">
<?php 
echo Html::submitButton('Далее', ['type' => 'submit', 'class' => 'btn btn-default']);
?>
</p>
 </div>
 </div>
<?php 
ActiveForm::end();
$session = \Yii::$app->session;
$session['step'] = '3';
/*записываем в сессию данные предыдущего шага*/
Ejemplo n.º 14
1
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <strong>Categories</strong>
                        <?php 
echo Html::a('<i class="glyphicon glyphicon-plus-sign"></i> Add', ['#'], ['class' => 'pull-right', 'data-toggle' => 'modal', 'data-target' => '#myModal']);
?>
                    </div>
                    <div class="panel-body">

                        <div class="categories-wrapper">
                            <?php 
$availableCategories = ArrayHelper::map($categories, 'id', 'name');
$preselectedOptions = ArrayHelper::map(ArrayHelper::toArray($model->terms), 'id', 'term_id');
?>
                            <?php 
echo Html::checkboxList('categories', $preselectedOptions, $availableCategories, ['id' => 'categories-con']);
?>

                        </div>
                    </div>
                </div>
            </div>
        </div>

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

</div>

Ejemplo n.º 15
0
<!--   添加角色  -->
<?php 
$form = \yii\widgets\ActiveForm::begin(['options' => ['class' => 'p20']]);
?>

    <?php 
?>
    <h3><?php 
echo t_arr('app', ['user', 'role', 'edit'], '', ':');
?>
 <?php 
echo $user->username;
?>
</h3>
    <?php 
echo $form->field($model, 'user_id')->textInput(['placeholde' => 'placeholde', 'value' => $user->id]);
?>


    <?php 
echo Html::checkboxList($model->formName() . '[item_name][]', $assignMentSelectArray, $allRolesArray);
?>


    <?php 
echo Html::submitButton(t('app', 'update'), ['class' => 'btn btn-primary']);
?>


<?php 
$form->end();
Ejemplo n.º 16
0
		<div class="control-group">
			<label class="control-label bolder blue">Roles:</label>
			<?php 
echo Html::checkboxList('children', $assigned['Roles'], $avaliable['Roles'], ['unselect' => 'no children', 'item' => function ($index, $label, $name, $checked, $value) {
    return Html::beginTag('div', ['class' => 'checkbox']) . Html::checkbox($name, $checked, ['label' => "<span class='lbl'>&nbsp;" . $label . '</span>', 'class' => 'ace', 'value' => $value]) . Html::endTag('div');
}]);
?>
		</div>
	</div>

	<div class="col-xs-12 col-sm-6">
		<div class="control-group">
			<label class="control-label bolder blue">Permissions:</label>
			<?php 
echo Html::checkboxList('children', $assigned['Permissions'], $avaliable['Permissions'], ['item' => function ($index, $label, $name, $checked, $value) {
    return Html::beginTag('div', ['class' => 'checkbox']) . Html::checkbox($name, $checked, ['label' => "<span class='lbl'>&nbsp;" . $label . '</span>', 'class' => 'ace', 'value' => $value]) . Html::endTag('div');
}]);
?>
		</div>
	</div>
	<div class="col-xs-12 col-sm-6"></div>
</div>
<?php 
//echo Html::checkboxList('children',$assigned['Permissions'],$avaliable['Permissions']);
echo Html::hiddenInput('name', $model->name);
?>

<?php 
echo Html::submitButton('Save', ['class' => 'btn btn-success']);
?>
Ejemplo n.º 17
0
        <div class="box-header with-border">
            <h3 class="box-title"><?php 
    echo $taxonomy->taxonomy_pn;
    ?>
</h3>

            <div class="box-tools pull-right">
                <button data-widget="collapse" class="btn btn-box-tool"><i class="fa fa-minus"></i></button>
            </div>
        </div>

        <div class="box-body">

            <?php 
    if ($taxonomy->taxonomy_hierarchical) {
        echo Html::checkboxList('termIds', ArrayHelper::getColumn($model->terms, 'id'), ArrayHelper::map($taxonomy->terms, 'id', 'term_name'), ['class' => $model->isNewRecord ? 'checkbox' : 'update-taxonomy-hierarchical checkbox', 'data-url' => $model->isNewRecord ? null : Url::to(['/content/term-relationship/ajax-change-hierarchical']), 'data-post_id' => $model->isNewRecord ? null : $model->id, 'separator' => '<br />']);
    } else {
        echo Html::dropDownList('termIds', ArrayHelper::getColumn($model->getTerms()->select(['id'])->where(['taxonomy_id' => $taxonomy->id])->all(), 'id'), ArrayHelper::map($model->getTerms()->select(['id', 'term_name'])->where(['taxonomy_id' => $taxonomy->id])->all(), 'id', 'term_name'), ['class' => 'term-non-hierarchical form-control ' . $taxonomy->taxonomy_name, 'multiple' => 'multiple', 'data' => ['taxonomy_id' => $taxonomy->id]]);
    }
    ?>

        </div>
        <div class="box-footer">

            <?php 
    if ($taxonomy->taxonomy_hierarchical) {
        if (Yii::$app->user->can('editor')) {
            ?>

                    <div class="input-group" data-url="<?php 
            echo Url::to(['/content/term/ajax-create-hierarchical']);
Ejemplo n.º 18
0
">-
							<input type="text" class="size-to2 count_range" value="<?php 
echo $sizes[1];
?>
">
						</div>
					</div>

					<div class="filter_elements">Дата сдачи
						<div class="filter_village">

							<?php 
$readys = ArrayHelper::map(DateReadyDistrict::find()->all(), 'id', 'date');
?>
							<?php 
echo Html::checkboxList('date_ready', $ready, $readys, ['itemOptions' => ['class' => 'selection_checkbox']]);
?>

							<!--							<input type="checkbox" name="date_delivery" value="2014" checked>до 2014 (уже сдан)<br>-->
							<!--							<input type="checkbox" name="date_delivery" value="2015">до осени 2015<br>-->
							<!--							<input type="checkbox" name="date_delivery" value="2016">до осени 2016<br>-->
						</div>
					</div>

					<div class="submit_selection">
						<button class="submit_form" type="submit">Найти</button>
					</div>

				</form>
			</div>
Ejemplo n.º 19
-1
					<div class="col-sm-3 text-right">
						<span id="show-only-selected-routes" class="btn btn-default btn-sm">
							<i class="fa fa-minus"></i> Show only selected
						</span>
						<span id="show-all-routes" class="btn btn-default btn-sm hide">
							<i class="fa fa-plus"></i> Show all
						</span>

					</div>
				</div>

				<hr/>

				<?php 
echo Html::checkboxList('child_routes', ArrayHelper::map($childRoutes, 'name', 'name'), ArrayHelper::map($routes, 'name', 'name'), ['id' => 'routes-list', 'separator' => '<div class="separator"></div>', 'item' => function ($index, $label, $name, $checked, $value) {
    return Html::checkbox($name, $checked, ['value' => $value, 'label' => '<span class="route-text">' . $label . '</span>', 'labelOptions' => ['class' => 'route-label'], 'class' => 'route-checkbox']);
}]);
?>

				<hr/>
				<?php 
echo Html::submitButton('<span class="glyphicon glyphicon-ok"></span> ' . UserManagementModule::t('back', 'Save'), ['class' => 'btn btn-primary btn-sm']);
?>

				<?php 
echo Html::endForm();
?>

			</div>
		</div>
	</div>
Ejemplo n.º 20
-1
?>

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

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

        <div class="form-group">
            <?php 
echo Html::label('Роли пользователя');
?>
            <?php 
echo Html::checkboxList('roles', $user_permit, $roles, ['separator' => '<br>']);
?>
        </div>


        <div class="form-group">
            <?php 
echo Html::submitButton('Сохранить', ['class' => 'btn btn-success']);
?>
        </div>

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

    </div>
Ejemplo n.º 21
-1
 /**
  * @inheritdoc
  */
 public static function checkboxList($name, $selection = null, $items = [], $options = [])
 {
     $options['item'] = function ($index, $label, $name, $checked, $value) {
         return Checkbox::widget(['label' => $label, 'checked' => $checked, 'name' => $name, 'value' => $value]);
     };
     static::addCssClasses($options, ['grouped', 'fields']);
     return Html::checkboxList($name, $selection, $items, $options);
 }
Ejemplo n.º 22
-1
<?php

/* @var $postmsg string */
use yii\bootstrap\ActiveForm;
use yii\helpers\Html;
?>
<div class="pizzamaster">
<h3>Калькулятор пиццы - Шаг 2</h3>
<div class="body_pizzamaster">
<?php 
$form = ActiveForm::begin(['method' => 'post', 'action' => ['']]);
?>
<p>
<label>Начинка пиццы</label>
<?php 
echo Html::checkboxList('fillPizza', null, $arrFill);
?>
 
</p>
<p class="submit_button">
<?php 
echo Html::submitButton('Далее', ['type' => 'submit', 'class' => 'btn btn-default']);
?>
</p>
 </div>
 </div>
<?php 
ActiveForm::end();
$session = \Yii::$app->session;
$session['step'] = '2';
/*записываем в сессию данные 1го шага*/
Ejemplo n.º 23
-1
               class="collapsed" aria-expanded="false">
                <?php 
    echo $taxonomy->taxonomy_pn;
    ?>
            </a>
        </h4>
    </div>

    <div class="panel-collapse collapse" id="taxonomy-<?php 
    echo $taxonomy->id;
    ?>
">

        <div class="box-body">
            <?php 
    echo Html::checkboxList('termIds', null, ArrayHelper::map($taxonomy->terms, 'id', 'term_name'), ['class' => 'checkbox taxonomy-menu-item', 'separator' => '<br />']);
    ?>
        </div>

        <div class="box-footer">
            <?php 
    echo Html::hiddenInput('type', 'taxonomy');
    ?>
            <?php 
    echo Html::submitButton(Yii::t('content', 'Add Menu'), ['class' => 'btn btn-flat btn-primary btn-create-menu-item']);
    ?>
        </div>

    </div>

Ejemplo n.º 24
-1
 /**
  * @inheritdoc
  */
 public function checkboxList($items, $options = [])
 {
     $options = $this->mergeInputOptions($options, ['placeholder' => null]);
     $this->parts['{input}'] = Html::checkboxList($this->attribute, null, $items, $options);
     return $this;
 }
Ejemplo n.º 25
-1
    // si es un array busca la clave "attribute"
    if (is_array($c)) {
        foreach ($c as $key => $value) {
            if ($key == 'attribute') {
                $poSel[] = $i;
                $poItems[$i] = $searchModel->getAttributeLabel($value);
                break;
            }
        }
    } else {
        $poSel[] = $i;
        $poItems[$i] = $searchModel->getAttributeLabel($c);
    }
}
// tiene que estar fuera del Pjax
echo PopoverX::widget(['options' => ['id' => 'popControl'], 'placement' => PopoverX::ALIGN_RIGHT, 'toggleButton' => ['label' => '<i class="glyphicon glyphicon-list"></i> Cols.a exportar', 'class' => 'btn btn-default pull-left'], 'header' => 'Elija las columnas a exportar', 'size' => 'lg', 'content' => Html::checkboxList('exportColumns', $poSel, $poItems, ['class' => 'form-control', 'tag' => false])]);
//}
// Definición de la cantidad de items a paginar
$contentToolbar = \nterms\pagesize\PageSize::widget(['defaultPageSize' => \Yii::$app->params['tiposdoc.defaultPageSize'], 'sizes' => \Yii::$app->params['tiposdoc.sizes'], 'label' => '', 'options' => ['class' => 'btn btn-default', 'title' => 'Cantidad de elementos por página']]);
// Definición del toolbar
//if (\Yii::$app->user->can('PERMISOPARAEXPORTAR')) {
$toolbar = ['{export} ', ['content' => $contentToolbar]];
//} else {
//	$toolbar=[['content'=>$contentToolbar]];
//}
?>

    <?php 
echo GridView::widget(['options' => ['id' => 'gridID'], 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $columns, 'pjax' => true, 'pjaxSettings' => ['neverTimeout' => true], 'condensed' => true, 'layout' => '&nbsp;{toolbar}{summary}{items}{pager}', 'filterSelector' => 'select[name="per-page"]', 'export' => ['label' => 'Exportar', 'fontAwesome' => true, 'showConfirmAlert' => true, 'target' => GridView::TARGET_BLANK], 'toolbar' => $toolbar, 'pager' => ['firstPageLabel' => true, 'lastPageLabel' => true], 'exportConfig' => [GridView::PDF => ['filename' => $this->title, 'config' => ['destination' => 'D', 'methods' => ['SetHeader' => [['odd' => $pdfHeader, 'even' => $pdfHeader]], 'SetFooter' => [['odd' => $pdfFooter, 'even' => $pdfFooter]]], 'options' => ['title' => $this->title, 'subject' => '', 'keywords' => ''], 'contentBefore' => '', 'contentAfter' => '']], GridView::EXCEL => ['filename' => $this->title, 'config' => ['worksheet' => $this->title, 'cssFile' => '']], GridView::CSV => ['filename' => $this->title, 'config' => ['colDelimiter' => ";", 'rowDelimiter' => "\r\n"]]]]);
?>
 
Ejemplo n.º 26
-1
echo Html::beginForm();
?>
        <?php 
echo Html::hiddenInput('enviado', 'true');
?>
        <div class="panel panel-default">
            <div class="panel-heading">

                <h3 class="panel-title"><?php 
echo Html::encode("Roles");
?>
</h3>
            </div>
            <div class="panel-body">
                <?php 
echo Html::checkboxList("roles", $roles_actuales, $lista_roles, ['separator' => Html::tag('br')]);
?>
            </div>
            <div class="panel-footer">
                <div class="form-group">
                    <?php 
echo Html::submitButton('Actualizar roles', ['class' => 'btn btn-sm btn-success']);
?>
                </div>
            </div>
        </div>
        <?php 
echo Html::endForm();
?>
    </div>
Ejemplo n.º 27
-1
 /**
  * Display modal window with form for selecting visible columns.
  */
 public function run()
 {
     $visibleColumns = $this->gridManager->getVisibleColumns($this->gridId);
     if ($visibleColumns === false) {
         $visibleColumns = array_keys($this->columnsList);
     }
     $columnsList = [];
     for ($i = 0; $i != count($visibleColumns); $i++) {
         $key = $visibleColumns[$i];
         if (isset($this->columnsList[$key])) {
             $columnsList[$key] = $this->columnsList[$key];
             unset($this->columnsList[$key]);
         }
     }
     $columnsList = array_merge($columnsList, $this->columnsList);
     $modal = Modal::begin($this->modalOptions);
     echo Html::beginForm($this->actionForm, $this->methodForm, $this->formOptions);
     echo Html::checkboxList('columns', $visibleColumns, $columnsList, ['class' => 'checkbox columns-list']);
     echo Html::beginTag('div', ['class' => 'form-group']);
     echo Html::submitButton($this->submitBtnLabel, $this->submitBtnOptions);
     echo Html::endTag('div');
     echo Html::endForm();
     Modal::end();
     $pluginSortableOptions = Json::encode($this->pluginSortableOptions);
     $this->view->registerJs("jQuery('#{$modal->id} .columns-list').sortable({$pluginSortableOptions});");
 }
Ejemplo n.º 28
-1
                        <div class="panel-heading">
                            <strong>Tags</strong>
                            <?php 
echo Html::a('<i class="glyphicon glyphicon-plus-sign"></i> Add', ['#'], ['class' => 'pull-right', 'data-toggle' => 'modal', 'data-target' => '#myModal']);
?>
                        </div>
                        <div class="panel-body">

                            <div class="row">
                                <?php 
$availableTags = ArrayHelper::map($tags, 'id', 'name');
$preselectedTags = ArrayHelper::map(ArrayHelper::toArray($model->tags), 'name', 'id');
?>
                                <?php 
echo Html::checkboxList('tags', $preselectedTags, $availableTags, ['id' => 'tag-con', 'separator' => '', 'item' => function ($index, $label, $name, $checked, $value) {
    return '<div class="col-md-3">' . Html::checkbox($name, $checked, ['value' => $value, 'label' => $label]) . '</div>';
}]);
?>
                            </div>

                        </div>
                    </div>

                </div>
            </div>


        </div>
        <div class="col-sm-12 col-md-3">

            <div class="form-group">
Ejemplo n.º 29
-1
<div id="post-type-taxonomy-create" class="box box-primary">
    <div class="box-header with-border">
        <h3 class="box-title">
            <?php 
echo Yii::t("writesdown", "Taxonomies");
?>
        </h3>

        <div class="box-tools pull-right">
            <button data-widget="collapse" class="btn btn-box-tool"><i class="fa fa-minus"></i></button>
        </div>
    </div>

    <div class="box-body">
        <?php 
echo Html::checkboxList('taxonomy_ids', $model->isNewRecord ? null : ArrayHelper::getColumn($model->taxonomies, 'id'), $taxonomies, ['separator' => '<br />', 'id' => 'taxonomy_list', 'class' => 'checkbox']);
?>
    </div>

    <?php 
$form = ActiveForm::begin(['id' => 'ajax-create-taxonomy-form', 'action' => Url::to(['/site/forbidden']), 'options' => ['class' => 'ajax-create-taxonomy-create box-footer', 'data-url' => Url::to(['taxonomy/ajax-create'])]]);
?>

    <div class="hint-block form-group">
        <?php 
echo Yii::t('writesdown', 'Please, fill out the form below to create new taxonomy ');
?>
    </div>

    <?php 
echo $form->field($taxonomy, 'taxonomy_name', ['template' => '{input}{error}'])->textInput(['placeholder' => $taxonomy->getAttributeLabel('taxonomy_name')]);
Ejemplo n.º 30
-2
 /**
  * @inheritdoc
  */
 public function renderHtml()
 {
     if ($this->form !== null && $this->model !== null) {
         return $this->form->field($this->model, $this->attribute)->hint($this->hint)->checkboxList($this->items, $this->options);
     }
     if ($this->model !== null) {
         return Html::activeCheckboxList($this->model, $this->attribute, $this->items, $this->options);
     }
     return Html::checkboxList($this->name, $this->value, $this->items, $this->options);
 }