function run() { parent::run(); $wid = $this->options['id']; echo Html::activeHiddenInput($this->model, $this->attribute); echo Html::beginTag('div', ['id' => $wid . '-buttons', 'class' => 'input-group btn-group']); $items = PublishBehavior::getPublishedOptions(); $colors = PublishBehavior::getPublishedColors(); foreach ($items as $key => $item) { echo Html::button($item, ['data' => ['value' => $key], 'class' => $key == $this->model->{$this->attribute} ? 'btn btn-' . $colors[$key] . ' active' : 'btn btn-default']); } echo Html::endTag('div'); $js_colors = Json::encode($colors); $js = <<<JS \$('#{$wid}-buttons').find('button').each(function(){ \$(this).on('click',function(){ \$('#{$wid}-buttons').find('button').each(function(){ \$(this).removeClass('btn-danger btn-warning btn-success btn-info active'); \$(this).addClass('btn-default'); }); var color={$js_colors}; \$(this).removeClass('btn-default'); \$(this).addClass('btn-'+color[\$(this).data('value')]+' active'); \$('#{$wid}').val(\$(this).data('value')) }); }); JS; $this->view->registerJs($js); }
$properties = Property::getForGroupId($group->id); ?> <?php foreach ($properties as $property) { ?> <?php if ($propertyValues = $review->submission->getPropertyValuesByPropertyId($property->id)) { ?> <?php echo Html::beginTag('div', ['class' => 'col-md-8']); ?> <?php echo $property->handler('form', $review->submission->abstractModel, $propertyValues, 'backend_render_view'); ?> <?php echo Html::endTag('div'); ?> <?php } ?> <?php } ?> <?php } ?> </div> </div> <div class="jarviswidget"> <header></header> <div class="widget-body">
<?php use kartik\helpers\Html; use yii\bootstrap\ActiveForm; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ $form = ActiveForm::begin(['id' => 'user-form', 'layout' => 'inline', 'method' => 'POST']); $ka = $rowNr; echo Html::beginTag('table'); echo Html::beginTag('tr', ['data-row' => '1']); echo Html::tag('td', $form->field($auth, '[' . $ka . ']type')->dropDownList($auth->getTypeArr(), ['style' => 'width:120px;', 'prompt' => '--'])); echo Html::tag('td', $form->field($auth, '[' . $ka . ']allowFrom')->textInput(['style' => 'width:120px;'])); echo Html::tag('td', $form->field($auth, '[' . $ka . ']allowTo')->textInput(['style' => 'width:120px;'])); echo Html::endTag('tr'); echo Html::endTag('table'); $form->end();
<th style="width:170px;"></th> </tr> </thead> <tbody> <?php if ($model->isNewRecord === TRUE) { $model->auth = [0]; } // Anzeigen der gespeicherten Logins ------------------- foreach ($model->auth as $i => $authData) { $auth = new Auth($authData); echo Html::beginTag('tr'); echo Html::tag('td', $form->field($auth, '[' . $i . ']type')->dropDownList($auth->getTypeArr(), ['style' => 'width:120px;', 'prompt' => '--'])); echo Html::tag('td', $form->field($auth, '[' . $i . ']allowFrom')->textInput(['style' => 'width:120px;'])); echo Html::tag('td', $form->field($auth, '[' . $i . ']allowTo')->textInput(['style' => 'width:120px;'])); echo Html::endTag('tr'); #$ka++; } ?> </tbody> </table> </div> </div> <?php $js = <<<JS var ka = "{$ka}";\t \$(document).on('click','#btn-newauth',function(){ \tka++;\t \t\$.ajax({ \t\turl:'index.php?r=users/newauthrow&rnr='+ka, \t\tdataType:'JSON',