Do not use BaseHtml. Use [[Html]] instead.
Since: 2.0
Author: Qiang Xue (qiang.xue@gmail.com)
 public function actionGetTypeValues($param, $link_category = false)
 {
     if ($link_category) {
         $params = \app\models\GoodsParams::find()->where('goods_params_name_id=:goods_params_name_id AND link_category=:link_category', [':goods_params_name_id' => $param, ':link_category' => $link_category])->orderBy('sort ASC')->all();
     } else {
         $params = \app\models\GoodsParams::find()->where('goods_params_name_id=:goods_params_name_id', [':goods_params_name_id' => $param])->orderBy('sort ASC')->all();
     }
     $arParams = ['' => ' - Выбрать значение - '];
     foreach ($params as $param) {
         $arParams[$param->id] = $param->value;
     }
     print \yii\helpers\BaseHtml::dropDownList('listValues', '', $arParams);
 }
 public function run()
 {
     $this->view->registerAssetBundle(MultiSelectAsset::className());
     $options = $this->options;
     if (isset($options['id'])) {
         $id = $options['id'];
     } else {
         $id = BaseHtml::getInputId($this->model, $this->attribute);
     }
     if (isset($options['name'])) {
         $name = $options['name'];
     } elseif ($this->hasModel()) {
         $name = BaseHtml::getInputName($this->model, $this->attribute);
     } else {
         $name = $this->name;
     }
     //        if (isset($options['value'])) {
     //            $value = $options['value'];
     //        } elseif ($this->hasModel()) {
     //            $value = BaseHtml::getAttributeValue($this->model, $this->attribute);
     //        } else {
     //            $value = $this->value;
     //        }
     $len = strlen($this->attribute);
     $widget = Html::beginTag('div', ['id' => $id, 'name' => $name]);
     foreach ($this->model as $k => $v) {
         if (substr($k, 0, $len + 1) == $this->attribute . '_') {
             $widget .= Html::activeCheckbox($this->model, $k, ['labelOptions' => ['class' => 'checkbox-inline']]);
         }
     }
     $widget .= Html::endTag('div');
     echo $widget;
 }
Exemple #3
0
    /**
     * @param array $options
     * @param bool|TRUE $enclosedByLabel
     * @param string $on_label
     * @param string $off_label
     *
     * @return $this
     */
    public function toggle($options = [], $enclosedByLabel = TRUE, $on_label = 'ON', $off_label = 'OFF')
    {
        if (isset($options['label']) && !isset($this->parts['{label}'])) {
            $this->parts['{label}'] = $options['label'];
            if (!empty($options['labelOptions'])) {
                $this->labelOptions = $options['labelOptions'];
            }
        }
        if ($enclosedByLabel) {
            $this->labelOptions = ['class' => 'c006-block'];
            $this->parts['{input}'] = '
<div class="c006-activeform-toggle-container ' . BaseHtml::getInputId($this->model, $this->attribute) . '" >
    <span class="c006-activeform-toggle-on c006-activeform-on" ><span>' . $on_label . '</span></span>
    <span class="c006-activeform-toggle-off c006-activeform-off"><span>' . $off_label . '</span></span>
    ' . Html::activeHiddenInput($this->model, $this->attribute, $this->inputOptions) . '
</div>
';
        } else {
            unset($options['labelOptions']);
            $options['label'] = NULL;
            $this->parts['{input}'] = '
<div class="c006-activeform-toggle-container ' . BaseHtml::getInputId($this->model, $this->attribute) . '" " >
<div class="table">
    <span class="c006-activeform-toggle-on c006-activeform-on" ><span>ON</span></span>
    <span class="c006-activeform-toggle-off c006-activeform-off"><span>OFF</span></span>
    ' . Html::activeHiddenInput($this->model, $this->attribute, $this->inputOptions) . '
</div>
</div>
';
        }
        $this->adjustLabelFor($options);
        return $this;
    }
Exemple #4
0
 public function init()
 {
     parent::init();
     mt_srand((double) microtime() * 10000);
     $this->id = $this->id ? $this->id : 'files' . strtoupper(md5(uniqid(mt_rand(), true)));
     //var_dump($this->id);
     $this->name = isset($this->model) ? Html::getInputName($this->model, $this->attribute) : $this->id;
     if (isset($this->attribute)) {
         $this->pure_attribute = BaseHtml::getAttributeName($this->attribute);
     }
     if (!$this->file_id) {
         if (isset($this->attribute)) {
             $this->file_id = $this->model[$this->pure_attribute];
         } else {
             $this->file_id = -1;
         }
     }
     if (!$this->options) {
         $this->options = [];
     }
     if (!$this->select_callback) {
         $this->select_callback = false;
     }
     if (!$this->caption) {
         $this->caption = false;
     }
 }
 public function run()
 {
     $options = $this->options;
     if (isset($options['id'])) {
         $id = $options['id'];
     } else {
         $id = 'editor';
     }
     if (isset($options['name'])) {
         $name = $options['name'];
     } elseif ($this->hasModel()) {
         $name = BaseHtml::getInputName($this->model, $this->attribute);
     } else {
         $name = $this->name;
     }
     if (isset($options['value'])) {
         $value = $options['value'];
     } elseif ($this->hasModel()) {
         $value = BaseHtml::getAttributeValue($this->model, $this->attribute);
     } else {
         $value = $this->value;
     }
     echo Html::beginTag('script', ['id' => $id, 'type' => 'text/plain', 'name' => $name, 'style' => "height:{$this->height}"]);
     echo $value;
     echo Html::endTag('script');
     if (!isset($options['config'])) {
         $options['config'] = [];
     }
     $ueditorConfig = ArrayHelper::merge(['serverUrl' => Url::to(['ueditor/controller'])], $options['config']);
     $config = Json::encode($ueditorConfig);
     $view = $this->getView();
     UEditorAsset::register($view);
     $view->registerJs("var ue = UE.getEditor('{$id}', {$config});");
 }
 /**
  * @inheritdoc
  */
 public function clientValidateAttribute($model, $attribute, $view)
 {
     $id = BaseHtml::getInputId($model, $attribute);
     $options['id'] = $id;
     $options['min'] = $this->min;
     $options['tooLess'] = $this->tooLess;
     $options['max'] = $this->max;
     $options['tooMore'] = $this->tooMore;
     return 'yii.validation.multiselect(value, messages, ' . json_encode($options, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . ');';
 }
Exemple #7
0
 /**
  * Creates button with FontAwesome icon.
  * @param string $text    Button text.
  * @param string $fa      Icon name.
  * @param array  $options Additional options.
  * @return string
  */
 public static function buttonFa($text, $fa, $options = [])
 {
     $icon = self::tag('i', '', ['class' => 'fa fa-' . $fa . ' margin']);
     if (isset($options['raw']) and $options['raw'] == true) {
         unset($options['raw']);
         return parent::button($icon . $text, $options);
     } else {
         unset($options['raw']);
         return parent::button($icon . Yii::t('app', $text), $options);
     }
 }
 public function renderDataCellContent($model, $key, $index)
 {
     // Set the attribute in a nice variable that we can use
     $sAttribute = $this->attribute;
     // Does the field have the unset value
     if ($model->{$sAttribute} == $this->unsetValue) {
         return BaseHtml::checkbox('actionColumChecbox', false, ['data-id' => $model->id, 'class' => 'checkActionColumn', 'data-saveurl' => $this->setUrl]);
     }
     $this->setContent = Yii::$app->formatter->asDatetime($model->{$sAttribute}, 'medium');
     // Return the set content
     return strtr($this->setTemplate, ['{check}' => $this->setCheck, '{content}' => $this->setContent]);
 }
    public function clientValidateAttribute($model, $attribute, $view)
    {
        /* @var $model \yii\db\ActiveRecord */
        // Register asset
        PasswordStrengthAsset::register($view);
        $selector = '#' . BaseHtml::getInputId($model, $attribute);
        $message = Json::encode($this->message);
        $options = Json::encode(['message' => $message]);
        $view->registerJs("\$('{$selector}').passwordStrength({$options});", \yii\web\View::POS_READY);
        return <<<JS
\$('{$selector}').passwordStrength('handeValidation', value, messages);
JS;
    }
Exemple #10
0
 /**
  * @inheritDoc
  */
 public static function radio($name, $checked = false, $options = [])
 {
     if (!isset($options['id'])) {
         $options['id'] = Widget::$autoIdPrefix . Widget::$counter++;
     }
     $content = parent::radio($name, $checked, array_merge($options, ['label' => null]));
     if (isset($options['label'])) {
         $label = $options['label'];
         $for = $options['id'];
         $labelOptions = isset($options['labelOptions']) ? $options['labelOptions'] : [];
         unset($options['label'], $options['labelOptions']);
         $content .= parent::label($label, $for, $labelOptions);
     }
     return $content;
 }
 public function run()
 {
     $data = $this->model[$this->attribute];
     //определяем картинку в зависимости от типа входных данных стринг/массив
     $imgSrc = '';
     $coords = 'null';
     if (is_array($data)) {
         if (array_key_exists('imgSrc', $data)) {
             $imgSrc = $data['imgSrc'];
         }
         if (array_key_exists('x1', $data) && $data['x1'] != '' && array_key_exists('y1', $data) && $data['y1'] != '' && array_key_exists('x2', $data) && $data['x2'] != '' && array_key_exists('y2', $data) && $data['y2'] != '') {
             $x1 = $data['x1'];
             $y1 = $data['y1'];
             $x2 = $data['x2'];
             $y2 = $data['y2'];
             $coords = '{"x1":' . $x1 . ',"y1":' . $y1 . ',"x2":' . $x2 . ',"y2":' . $y2 . '}';
         }
     } elseif (!empty($data)) {
         $imgSrc = $data;
     }
     //рендерим блок с картинкой
     $previewId = $this->id . '_preview_img';
     $previewImgClass = 'form-img-preview-crop-image';
     $inputId = BaseHtml::getInputId($this->model, $this->attribute);
     if (empty($imgSrc)) {
         $preview = "<div id='{$previewId}'></div>";
     } else {
         $preview = Html::tag('div', Html::img($imgSrc, ['class' => $previewImgClass . ' crop-image', 'data-forinput' => $inputId, 'data-coords' => $coords]), ['id' => $previewId]);
     }
     $this->template = strtr($this->template, ['{preview}' => $preview]);
     //рендерим инпуты
     $inputs = Html::activeTextInput($this->model, $this->attribute . '[imgSrc]', $this->options);
     $inputs .= Html::activeTextInput($this->model, $this->attribute . '[x1]', ['type' => 'hidden']);
     $inputs .= Html::activeTextInput($this->model, $this->attribute . '[y1]', ['type' => 'hidden']);
     $inputs .= Html::activeTextInput($this->model, $this->attribute . '[x2]', ['type' => 'hidden']);
     $inputs .= Html::activeTextInput($this->model, $this->attribute . '[y2]', ['type' => 'hidden']);
     $this->template = strtr($this->template, ['{inputs}' => $inputs]);
     parent::run();
     //css и js
     $view = $this->getView();
     //подключаем ресурсы
     CropImageAsset::register($view);
     //стили для отображения картинки
     $view->registerCss(".{$previewImgClass} {max-width:{$this->imgMaxWidth}; max-height:{$this->imgMaxHeight}}");
     //подключаем файловый менеджер сервера
     $view->registerJs("mihaildev.elFinder.register(" . Json::encode($this->options['id']) . ",\n            function(file, id){\n                UnInitImageAreaSelect('{$inputId}');\n                \$('#' + id).val(file.url);\n                \$('#{$previewId}').html('<img class=\"{$previewImgClass} crop-image\" src=\"'+file.url+'\" data-forinput=\"{$inputId}\" >');\n                \$('#{$previewId} .{$previewImgClass}').load(function(){ InitImageAreaSelect() });\n                return true;}); ");
 }
Exemple #12
0
 protected function renderFooterCellContentJS($model)
 {
     $key = '';
     if ($this->value !== null) {
         if (is_string($this->value)) {
             return ArrayHelper::getValue($model, $this->value);
         } else {
             return call_user_func($this->value, $model, '', '', $this);
         }
     } elseif ($this->attribute !== null) {
         $html = '<a id="thumb-image-\'+data.id+\'" class="img-thumbnail" href="/index.php?r=catalog%2Fadmin%2Fupdate&amp;id=17" data-toggle="image">';
         $html .= Html::img(\andreosoft\image\Image::thumb($model[$this->attribute], 100, 100), ['data-placeholder' => \andreosoft\image\Image::thumb('', 100, 100)]);
         $html .= '</a>';
         $html .= '<input type="hidden" id="input-image-\'+data.id+\'" name="' . \yii\helpers\BaseHtml::getInputName($model, $this->attribute) . '">';
         return $html;
     }
     return null;
 }
Exemple #13
0
 public function init()
 {
     parent::init();
     if (!$this->params) {
         $this->params = ['id' => 'files' . time() . rand(1, 100)];
     } else {
         $this->params = $this->params;
     }
     $sql = 'select * from fajl where vladelec = :user_id';
     $polzovatel_id = ApiGlobals::getPolzovatelId();
     if (isset($this->attribute)) {
         $pureAttrbiute = BaseHtml::getAttributeName($this->attribute);
         $this->params['pureAttribute'] = $pureAttrbiute;
     }
     if (!$polzovatel_id) {
         throw new \Exception();
     }
     if ($res = \Yii::$app->db->createCommand($sql)->bindValue(':user_id', $polzovatel_id)->queryAll()) {
         $files = array();
         foreach ($res as $k => $v) {
             $files[$v['id']] = $v;
         }
         $this->params['files'] = $files;
     } else {
         $this->params['files'] = array();
     }
     if (isset($pureAttrbiute) && isset($this->model[$pureAttrbiute]) && $this->model[$pureAttrbiute] && $this->params['files'][$this->model[$pureAttrbiute]]['vneshnee_imya_fajla']) {
         $this->params['btn-text'] = $this->params['files'][$this->model[$pureAttrbiute]]['vneshnee_imya_fajla'];
     }
     if (!isset($this->params['btn-text'])) {
         $this->params['btn-text'] = 'Выбрать файл';
     }
     $this->params['name'] = isset($this->model) ? Html::getInputName($this->model, $this->attribute) : $this->params['id'];
     //if (!isset($this->params['selected'])) $this->params['selected'] = null;
     //else $this->params['btn-text'] = $this->params['files'][$this->params['selected']]
     //var_dump($this->params['files']);
 }
Exemple #14
0
    } else {
        ?>
                        text += '{"key": "' + addslashes($(inputs[0]).val()) + '", "value": "' + addslashes($(inputs[1]).val()) + '"},';
                    <?php 
    }
    ?>
                }

                <?php 
    if ($widget->unique) {
        ?>
                    text = (text == '' ? '{}' : "{" + text.substr(0, text.length-1) + '}');
                <?php 
    } else {
        ?>
                    text = (text == '' ? '[]' : "[" + text.substr(0, text.length-1) + ']');
                <?php 
    }
    ?>

                $('#<?php 
    echo BaseHtml::getInputId($widget->model, $widget->attribute);
    ?>
').val(text);
            });
        <?php 
}
?>
    });
</script>
Exemple #15
0
 public static function input($type = '', $model, $attribute, $labels, $options = [], $errors = [])
 {
     $type = $type == '' ? 'text' : $type;
     if (empty($options)) {
         $options = ['class' => 'form-control'];
     }
     $value = is_object($model) && isset($model->{$attribute}) ? $model->attribute : '';
     $html = '<div class="form-group">';
     $html .= '<label class="control-label">' . (isset($labels[$attribute]) ? $labels[$attribute] : '') . '</label><br>';
     $html .= parent::input($type, $attribute, $value, $options);
     $html .= self::errorBlock(isset($errors[$attribute]) ? $errors[$attribute] : []);
     $html .= '</div>';
     return $html;
 }
 public function actionLoadchain()
 {
     Yii::$app->response->format = Response::FORMAT_JSON;
     $model = new Restaurant();
     $map = new \common\models\ResMap();
     if ($model->load(Yii::$app->request->post())) {
         $chaindata = $model->chainCity;
         $chainmapstatus = $chaindata->chainFieldStatusMaps;
         \yii::trace(print_r($chainmapstatus, true));
         $finalmap = [];
         foreach ($model->chainFieldMap() as $map) {
             $map['id'] = \yii\helpers\BaseHtml::getInputId($model, $map['id']);
             $map['lock'] = $chainmapstatus->{$map['value']};
             $map['value'] = $chaindata->{$map['value']};
             $finalmap[] = $map;
         }
         return ['responce' => ['map' => $finalmap]];
     } else {
         return ['responce' => 'false'];
     }
 }
 /**
  * @inheritdoc
  */
 public function render($content = null)
 {
     if ($content === null) {
         if ($this->enableLabel === false) {
             $this->parts['{label}'] = '';
             $this->parts['{beginLabel}'] = '';
             $this->parts['{labelTitle}'] = '';
             $this->parts['{endLabel}'] = '';
         } elseif (!isset($this->parts['{beginLabel}'])) {
             $this->renderLabelParts();
         }
         if ($this->enableError === false || !$this->model->getFirstError(BaseHtml::getAttributeName($this->attribute))) {
             $this->parts['{error}'] = '';
         }
         if ($this->inputTemplate) {
             $input = isset($this->parts['{input}']) ? $this->parts['{input}'] : Html::activeTextInput($this->model, $this->attribute, $this->inputOptions);
             $this->parts['{input}'] = strtr($this->inputTemplate, ['{input}' => $input]);
         }
     }
     return parent::render($content);
 }
Exemple #18
0
 public function run()
 {
     echo Html::a(Html::img(\andreosoft\image\Image::thumb($this->model[$this->attribute], 100, 100), ['data-placeholder' => \andreosoft\image\Image::thumb('', 100, 100)]), "", ['id' => 'thumb-image', 'data-toggle' => 'image', 'class' => 'img-thumbnail']);
     echo Html::hiddenInput(\yii\helpers\BaseHtml::getInputName($this->model, $this->attribute), $this->model[$this->attribute], ['id' => 'input-image']);
 }
 /**
  * @inheritdoc
  */
 public static function activeDropDownList($model, $attribute, $items, $options = [])
 {
     Select2Asset::register(\Yii::$app->view);
     self::addCssClass($options, self::CLASS_SELECT2ME);
     self::addData($options, 'placeholder', '-');
     return parent::activeDropDownList($model, $attribute, $items, $options);
 }
Exemple #20
0
use yii\web\Response;
use yii\helpers\BaseHtml;
//use yii\widgets\ActiveForm;
use yii\bootstrap\ActiveForm;
use yii\authclient\widgets\AuthChoice;
/* @var $this yii\web\View */
/* @var $form yii\widgets\ActiveForm */
/* @var $modelAcceder \app\modules\micuenta\models\AccesoForm() */
/* @var $modelRegistrarse \app\modules\micuenta\models\CrearCuentaForm() */
/* @var $tabs array */
$inputOpciones = ['template' => "<div class=\"col-xs-12\">\n{input}\n{error}\n{hint}\n</div>", 'options' => ['class' => 'form-group m-b-3']];
$url_terminos = Yii::$app->urlManagerMicuenta->createUrl(['/terminos-de-uso']);
$url_politica = Yii::$app->urlManagerMicuenta->createUrl(['/politica-privacidad']);
$texto_condiciones = BaseHtml::a('términos de uso', $url_terminos);
$texto_condiciones .= Yii::t('app', ' y la ');
$texto_condiciones .= BaseHtml::a('política de privacidad.', $url_politica);
$checkOpciones = ['template' => "<div class=\"col-xs-12\"><div class=\"checkbox checkbox-custom\">\n{input}\n{beginLabel}\n{labelTitle} {$texto_condiciones} \n{endLabel}\n{error}\n{hint}\n</div></div>", 'options' => ['class' => 'form-group']];
?>



<div class="cd-user-modal"> <!-- this is the entire modal form, including the background -->
    <div class="cd-user-modal-container"> <!-- this is the container wrapper -->
        <ul class="cd-switcher">
            <li><a href="#0"><?php 
echo $tabs['acceder'];
?>
</a></li>
            <li><a href="#0"><?php 
echo $tabs['registrarse'];
?>
Exemple #21
0
">

        <?php 
echo $form->field($model, 'equipment')->checkboxList(['проектор' => 'Проектор', 'экран' => 'Экран']);
?>

    </div>

    <p class="lead">Абоненты / Переговорные комнаты</p>

    <?php 
if ($model->hasErrors('participantsId')) {
    ?>

        <?php 
    echo BaseHtml::error($model, 'participantsId', ['class' => 'alert alert-danger']);
    ?>

    <?php 
}
?>

    <div id="participants-container">

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

    </div>

    <?php 
Exemple #22
0
use yii\helpers\BaseHtml;
$form = ActiveForm::begin(['id' => $model->formName()]);
?>
 <?php 
echo $form->field($model, 'CUST_KD')->textInput(['value' => $id, 'disabled' => true]);
?>

   <?php 
echo $form->field($model, 'ALAMAT')->textInput(['readonly' => true]);
?>

   <?php 
echo BaseHtml::activeHiddenInput($model, 'MAP_LAT');
?>

   <?php 
echo BaseHtml::activeHiddenInput($model, 'MAP_LNG');
?>

     <?php 
echo \pigolab\locationpicker\LocationPickerWidget::widget(['options' => ['style' => 'width: 100%; height: 400px'], 'clientOptions' => ['location' => ['latitude' => -6.1783, 'longitude' => 106.6319], 'radius' => 300, 'inputBinding' => ['latitudeInput' => new JsExpression("\$('#customers-map_lat')"), 'longitudeInput' => new JsExpression("\$('#customers-map_lng')"), 'locationNameInput' => new JsExpression("\$('#customers-alamat')")]]]);
?>

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

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

            </div>

            <div class="col-lg-7">

                <div class="row">

                    <?php 
echo BaseHtml::activeCheckboxList($model, 'participantsId', ArrayHelper::map($participants, function ($item) {
    /** @var $item \common\models\vks\Participant */
    return (string) $item->primaryKey;
}, 'name'), ['item' => function ($index, $label, $name, $checked, $value) use($participants) {
    /** @var Participant $participant */
    $participant = $participants[$index];
    $defaultOptions = ['value' => $value, 'data' => ['company-id' => (string) $participant->companyId]];
    $label .= $participant->ahuConfirmation ? '&nbsp;<span class="glyphicon glyphicon-star text-warning"></span>' : '';
    $options = array_merge_recursive($defaultOptions, $participant->isBusy ? ['label' => $label . '<p><small>занято с ' . MinuteFormatter::asString($participant->busyFrom) . ' до ' . MinuteFormatter::asString($participant->busyTo) . '</small></p>', 'labelOptions' => ['class' => 'disabled'], 'disabled' => true] : ['label' => $label, 'data' => ['name' => $participant->name, 'short-name' => $participant->shortName, 'company-name' => $participant->company->name, 'contact' => $participant->contact, 'ip-address' => $participant->ipAddress]]);
    $tooltip = $participant->ahuConfirmation ? ['data' => ['toggle' => 'tooltip', 'html' => true, 'placement' => 'top', 'container' => '#vks-participants', 'title' => Html::tag('div', 'Бронь необходимо согласовать с') . Html::tag('div', $participant->confirmPerson->fullName) . Html::tag('div', $participant->confirmPerson->post) . Html::tag('div', 'тел: ' . $participant->confirmPerson->phone . ', ' . $participant->confirmPerson->email)]] : [];
    return Html::beginTag('div', array_merge(['class' => 'col-lg-4 vks-room', 'style' => 'display:none'], $tooltip)) . Html::checkbox($name, $checked, $options) . Html::endTag('div');
}]);
?>

                </div>

            </div>

        </div>

    </div>
Exemple #24
0
$other_errors = '';
//echo print_r($model->errors);
if ($model->hasErrors()) {
    echo \kartik\growl\Growl::widget(['type' => \kartik\growl\Growl::TYPE_DANGER, 'title' => 'Ошибки в резюме:', 'icon' => 'glyphicon glyphicon-exclamation-sign', 'body' => \yii\helpers\BaseHtml::errorSummary($model, ['header' => '']), 'showSeparator' => true, 'delay' => 100, 'pluginOptions' => ['placement' => ['from' => 'top', 'align' => 'right']]]);
    $main_err = $model->hasErrors('salary') + 0;
    $model_errors = $main_err ? ' <span title="Количество ошибок" style="margin-left: 10px;" class="label label-danger pull-right" > ' . $main_err . '</span>' : '';
    $other_errors = count($model->errors) > $main_err ? ' <span title="Количество ошибок" style="margin-left: 10px;" class="label label-danger pull-right" > ' . (count($model->errors) - $main_err) . '</span>' : '';
    if ($active_tab == 0 && $main_err > 0) {
        $active_tab = 1;
    }
    if ($active_tab == 0 && count($model->errors) > $main_err) {
        $active_tab = 2;
    }
}
if ($person->hasErrors() || $person_address->hasErrors()) {
    echo \kartik\growl\Growl::widget(['type' => \kartik\growl\Growl::TYPE_DANGER, 'title' => 'Ошибки в личных данных соискателя:', 'icon' => 'glyphicon glyphicon-exclamation-sign', 'body' => \yii\helpers\BaseHtml::errorSummary($person, ['header' => '']) . \yii\helpers\BaseHtml::errorSummary($person_address, ['header' => '']), 'showSeparator' => true, 'delay' => 1100, 'pluginOptions' => ['placement' => ['from' => 'top', 'align' => 'right']]]);
    $person_errors = count($person->errors) || count($person_address->errors) ? ' <span title="Количество ошибок" style="margin-left: 10px;" class="label label-danger pull-right" > ' . (count($person->errors) + count($person_address->errors)) . '</span>' : '';
    if ($active_tab != 1) {
        $active_tab = 3;
    }
}
?>

<div class="resume-form">

<?php 
$form = ActiveForm::begin(['enableClientValidation' => true, 'validateOnSubmit' => false, 'options' => ['class' => 'form-horizontal'], 'fieldConfig' => ['template' => "{label}\n<div class=\"col-lg-4\">{input}</div>\n<div class=\"col-lg-6\">{error}</div>", 'labelOptions' => ['class' => 'col-lg-2 control-label']]]);
?>

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

    <?php 
echo $form->field($model, 'place_type')->dropDownList($model->getPlaceTypeOptions(), ['prompt' => 'What type of place is this?'])->label('Type of Place');
?>
            
    <?php 
echo $form->field($model, 'notes')->textArea();
?>

    <?php 
echo BaseHtml::activeHiddenInput($model, 'lat');
?>
    <?php 
echo BaseHtml::activeHiddenInput($model, 'lng');
?>

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

</div> <!-- end col 1 --><div class="col-md-6">
<div id="preSearch" class="center">
<p><br /></p>    <?php 
echo Html::a('Lookup Location', ['lookup'], ['class' => 'btn btn-success', 'onclick' => "javascript:beginSearch();return false;"]);
?>
 
</div>
Exemple #26
0
<div class="password-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo Html::button('Generate Password', array('id' => 'generate_password'));
?>
    <?php 
echo Html::button('Toggle Password', array('id' => 'toggle_password'));
?>

    <p>
        <?php 
echo BaseHtml::hiddenInput('Password[id]', $model->id);
?>

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

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

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

        <?php 
Exemple #27
0
 /**
  * @inheritdoc
  */
 public static function activeDropDownList($model, $attribute, $items, $options = [])
 {
     if (array_key_exists('select2me', $options) && $options['select2me'] == false) {
     } else {
         Select2Asset::register(\Yii::$app->view);
         self::addCssClass($options, self::CLASS_SELECT2ME);
     }
     self::addData($options, 'placeholder', '-');
     return parent::activeDropDownList($model, $attribute, $items, $options);
 }
echo BaseHtml::activeHiddenInput($model, 'name');
?>
    <?php 
echo BaseHtml::activeHiddenInput($model, 'google_place_id');
?>
    <?php 
echo BaseHtml::activeHiddenInput($model, 'location');
?>
    <?php 
echo BaseHtml::activeHiddenInput($model, 'website');
?>
    <?php 
echo BaseHtml::activeHiddenInput($model, 'vicinity');
?>
    <?php 
echo BaseHtml::activeHiddenInput($model, 'full_address');
?>

    <?php 
echo $form->field($model, 'place_type')->dropDownList($model->getPlaceTypeOptions(), ['prompt' => 'What type of place is this?'])->label('Type of Place');
?>

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

    <?php 
ActiveForm::end();
?>
Exemple #29
0
echo $form->field($model, 'rec_status_id')->radioList(ArrayHelper::map(\app\models\RecStatus::find()->active()->all(), 'id', 'name'), ['class' => 'btn-group', 'data-toggle' => 'buttons', 'unselect' => null, 'item' => function ($index, $label, $name, $checked, $value) {
    return '<label class="btn btn-default' . ($checked ? ' active' : '') . '">' . Html::radio($name, $checked, ['value' => $value, 'class' => 'project-status-btn']) . $label . '</label>';
}]);
?>

    <?php 
echo $form->field($model, 'user_id')->dropDownList(ArrayHelper::map(\app\models\User::find()->active()->all(), 'id', 'name'), ['prompt' => '']);
?>

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

    <div class="form-group">
        <div class="col-lg-offset-2 col-lg-10">
            <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Save') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
        </div>
    </div>

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

</div>

<?php 
if ($model->hasErrors()) {
    echo \kartik\growl\Growl::widget(['type' => \kartik\growl\Growl::TYPE_DANGER, 'title' => 'Необходимо исправить следующие ошибки:', 'icon' => 'glyphicon glyphicon-exclamation-sign', 'body' => \yii\helpers\BaseHtml::errorSummary($model, ['header' => '']), 'showSeparator' => true, 'delay' => 10, 'pluginOptions' => ['placement' => ['from' => 'top', 'align' => 'right']]]);
}
Exemple #30
0
    <div id="preSearch" class="center">
    <p><br /></p>  <?php 
echo Html::a('IN', ['lookup'], ['class' => 'btn btn-success', 'onclick' => "javascript:beginSearch();return false;"]);
?>
    </div>

    <?php 
echo BaseHtml::activeHiddenInput($model, 'LAT');
?>

    <?php 
echo BaseHtml::activeHiddenInput($model, 'LAG');
?>

    <?php 
echo BaseHtml::activeHiddenInput($model, 'RADIUS');
?>

    <div id="searchArea" class="hidden">
    <div id="autolocateAlert">
    </div> <!-- end autolocateAlert -->
    <p> your location...<span id="status"></span></p>
    <article>
    </article>
    <div class="form-actions hidden" id="actionBar">
      </div> <!-- end action Bar-->
  </div>   <!-- end searchArea -->
  </div> <!-- end col 2 -->