コード例 #1
1
ファイル: _form.php プロジェクト: fbarrento/yii2-content
    </div>

    <?php 
echo $form->field($model, 'media_excerpt')->textarea(['rows' => 6]);
?>

    <?php 
echo $form->field($model, 'media_content')->widget(TinyMce::className(), ['compressorRoute' => 'helper/tiny-mce-compressor', 'settings' => ['menubar' => false, 'skin_url' => Yii::$app->urlManager->baseUrl . '/editor-skins/content', 'toolbar_items_size' => 'medium', 'toolbar' => "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | code fullscreen", 'formats' => ['alignleft' => ['selector' => 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', 'classes' => 'align-left'], 'aligncenter' => ['selector' => 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', 'classes' => 'align-center'], 'alignright' => ['selector' => 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', 'classes' => 'align-right'], 'alignfull' => ['selector' => 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', 'classes' => 'align-full']]], 'options' => ['style' => 'height:250px;']]);
?>

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

    <?php 
echo $form->field($model, 'media_post_id')->widget(SelectizeDropDownList::className(), ['items' => $model->mediaPost ? [$model->mediaPost->id => $model->mediaPost->post_title] : [], 'value' => $model->media_post_id, 'clientOptions' => ['valueField' => 'id', 'labelField' => 'post_title', 'searchField' => 'post_title', 'load' => new JsExpression('function (query, callback) {
                if (!query.length) return callback();
                $.ajax({
                url: "' . Url::to(['/post/ajax-search']) . '",
                    type: "POST",
                    dataType: "json",
                    data: {
                        post_title: query,
                        _csrf: yii.getCsrfToken()
                    },
                    error: function() {
                        callback();
                    },
                    success: function(response) {
                        callback(response);
                    }
コード例 #2
0
ファイル: _fields.php プロジェクト: slavam/placement
        'searchField' => ['fullName'],
    ],
]);*/
?>

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

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

<?php 
echo $form->field($model, 'date')->widget(\dosamigos\datepicker\DatePicker::className(), ['language' => 'ru', 'options' => ['class' => 'form-control', 'autocomplete' => 'off'], 'clientOptions' => ['forceParse' => true, 'todayBtn' => true, 'clearBtn' => true, 'autoclose' => true, 'todayHighlight' => true, 'format' => 'dd.mm.yyyy']]);
?>

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

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

<?php 
echo $form->field($model, 'who_give')->widget(\dosamigos\selectize\SelectizeDropDownList::className(), ['items' => \yii\helpers\ArrayHelper::map(\app\models\DocMigration::find()->select(['who_give'])->active()->distinct()->orderBy('who_give asc')->asArray()->all(), 'who_give', 'who_give'), 'options' => ['multiple' => false, 'class' => 'form-control', 'prompt' => ''], 'clientOptions' => ['selectOnTab' => true, 'openOnFocus' => false, 'persist' => false, 'maxItems' => 1, 'create' => true, 'valueField' => 'who_give', 'labelField' => 'who_give', 'searchField' => ['who_give']]]);
?>

<?php 
echo $form->field($model, 'note')->textarea(['rows' => 6]);
コード例 #3
0
ファイル: _form.php プロジェクト: writesdown/app-cms
?>

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

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

    <?php 
echo $form->field($model, 'description')->textarea(['rows' => 6]);
?>

    <?php 
echo $form->field($model, 'icon')->widget(SelectizeDropDownList::className(), ['items' => Fa::getConstants()])->hint(Yii::t('writesdown', 'The icon use {FontAwesome} and appears on admin side menu', ['FontAwesome' => Html::a('FontAwesome', 'http://www.fontawesome.com/', ['target' => 'blank'])]));
?>

    <?php 
$role = ArrayHelper::map(Yii::$app->authManager->getRoles(), 'name', 'name');
if (Yii::$app->user->can('administrator') && !Yii::$app->authManager->checkAccess(Yii::$app->user->id, 'superadmin')) {
    unset($role['superadmin']);
}
echo $form->field($model, 'permission')->dropDownList($role);
?>

    <?php 
echo $form->field($model, 'menu_builder')->checkbox(['uncheck' => 0]);
?>

    <?php 
コード例 #4
0
ファイル: _fields_main.php プロジェクト: slavam/placement
            'create' => false,
//            'plugins' => ['remove_button'],
            'valueField' => 'id',
            'labelField' => 'fullName',
            'searchField' => ['fullName'],
        ],
    ])->hint('');
    */
?>

<?php 
//echo $form->field($model, 'professions')->dropDownList(ArrayHelper::map(\app\models\Profession::find()->active()->all(), 'id', 'name'), ['prompt' => '', 'multiple' => true])
?>

<?php 
echo $form->field($model, 'professions')->widget(\dosamigos\selectize\SelectizeDropDownList::className(), ['items' => ArrayHelper::map(\app\models\Profession::find()->active()->all(), 'id', 'name'), 'options' => ['multiple' => true, 'class' => 'form-control'], 'clientOptions' => ['persist' => false, 'maxItems' => null, 'create' => false, 'plugins' => ['remove_button'], 'valueField' => 'id', 'labelField' => 'name', 'searchField' => ['name']]])->hint('Use commas to separate tags');
?>

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

<?php 
echo $form->field($model, 'note')->textarea(['rows' => 6]);
?>

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

<?php 
コード例 #5
0
ファイル: _form.php プロジェクト: alexsynytskiy/Dynamomania
    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => 255]);
?>
    
    <?php 
$availableChampionships = [];
if (!$model->isNewRecord) {
    $championship = Championship::findOne($model->championship_id);
    if (isset($championship->id)) {
        $availableChampionships = [$championship->id => $championship->name];
    }
}
echo $form->field($model, 'championship_id')->widget(SelectizeDropDownList::classname(), ['loadUrl' => Url::to(['championship/championship-part-list']), 'items' => $availableChampionships, 'options' => ['multiple' => false], 'clientOptions' => ['valueField' => 'value', 'labelField' => 'text', 'persist' => false]]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Добавить' : 'Изменить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

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

</div>
コード例 #6
0
ファイル: _form.php プロジェクト: alexsynytskiy/Dynamomania
            <div id="source-url"><?php 
echo $model->source_url;
?>
</div>
        </div>
    </div>
    

    <?php 
$availableTags = [];
if (isset($tags)) {
    foreach ($tags as $tag) {
        $availableTags[$tag->id] = $tag->name;
    }
}
echo $form->field($model, 'tags')->widget(SelectizeDropDownList::classname(), ['loadUrl' => '/admin/tag/tag-list', 'items' => $availableTags, 'options' => ['multiple' => true], 'clientOptions' => ['delimiter' => ',', 'valueField' => 'value', 'labelField' => 'text', 'persist' => false, 'createOnBlur' => true, 'maxItems' => 10, 'create' => new JsExpression('function(input) { return { value: "{new}" + input, text: input } }')]]);
?>

    <?php 
echo $form->field($model, 'content_category_id')->dropDownList($model::categoryDropdown());
?>

    <?php 
$pluginOptions = ['showUpload' => false, 'showRemove' => false, 'overwriteInitial' => true, 'browseLabel' => "Обзор...", 'allowedFileExtensions' => ['jpg', 'jpeg', 'gif', 'png']];
if (isset($image) && $image->getFileUrl()) {
    $pluginOptions['initialPreview'] = [Html::img($image->getFileUrl())];
}
echo $form->field($model, 'image')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*', 'multiple' => false], 'pluginOptions' => $pluginOptions]);
?>

    <?php 
コード例 #7
0
 public function init()
 {
     parent::init();
     $this->clientOptions = ['options' => $this->makeReadyForSelectize(), 'items' => is_array($this->selectedItems) ? $this->selectedItems : [$this->selectedItems], 'valueField' => $this->valueField, 'labelField' => $this->labelField, 'searchField' => is_array($this->searchField) ? $this->searchField : [$this->searchField]];
 }
コード例 #8
0
ファイル: create.php プロジェクト: alexsynytskiy/Dynamomania
use dosamigos\selectize\SelectizeDropDownList;
use yii\helpers\Url;
use kartik\select2\Select2;
use yii\helpers\ArrayHelper;
use common\models\Amplua;
/* @var $this yii\web\View */
/* @var $model common\models\Composition */
$this->title = 'Добавить игрока в состав';
$this->params['breadcrumbs'][] = ['label' => 'Составы команд матчей', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="composition-create">

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

    <?php 
$form = ActiveForm::begin(['id' => 'team' . $model->command_id . '-player-add-form']);
echo $form->field($contractModel, 'player_id')->widget(SelectizeDropDownList::classname(), ['loadUrl' => Url::to(['player/player-list']), 'options' => ['multiple' => false], 'clientOptions' => ['valueField' => 'value', 'labelField' => 'text', 'persist' => false]]);
echo $form->field($contractModel, 'amplua_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Amplua::find()->all(), 'id', 'name'), 'language' => 'ru', 'options' => ['placeholder' => 'Выберите амплуа...'], 'pluginOptions' => ['allowClear' => true]]);
echo $form->field($contractModel, 'number')->textInput();
echo $form->field($model, 'is_basis')->widget(CheckboxX::classname(), ['pluginOptions' => ['threeState' => false], 'options' => ['id' => 'team' . $model->command_id . '-create-is_basis']]);
echo $form->field($model, 'is_captain')->widget(CheckboxX::classname(), ['pluginOptions' => ['threeState' => false], 'options' => ['id' => 'team' . $model->command_id . '-create-is_captain']]);
echo Html::submitButton('Добавить', ['class' => 'btn btn-primary']);
ActiveForm::end();
?>

</div>
コード例 #9
0
ファイル: general.php プロジェクト: fbarrento/yii2-content
    unset($role['administrator']);
}
?>
                <?php 
echo Html::dropDownList('Option[default_role][option_value]', $model->default_role->option_value, $role, ['id' => 'option-default_role', 'class' => 'form-control']);
?>
            </div>
        </div>

        <div class="form-group">
            <?php 
echo Html::label(Yii::t('content', 'Time Zone'), 'option-time_zone', ['class' => 'col-sm-2 control-label']);
?>
            <div class="col-sm-7">
                <?php 
echo SelectizeDropDownList::widget(['name' => 'Option[time_zone][option_value]', 'value' => $model->time_zone->option_value, 'items' => TimeZoneHelper::listTimeZone(), 'options' => ['class' => 'form-control', 'id' => 'option-time_zone']]);
?>
                <p class="description"><?php 
echo Yii::t('content', 'Choose a city in the same timezone as you.');
?>
</p>
            </div>
        </div>

        <div class="form-group">
            <?php 
echo Html::label(Yii::t('content', 'Date Format'), null, ['class' => 'col-sm-2 control-label']);
?>
            <div class="col-sm-7">
                <?php 
echo Html::radioList('radio-date_format', $model->date_format->option_value, ['F d, Y' => date('F d, Y'), 'M d, Y' => date('M d, Y'), 'Y-m-d' => date('Y-m-d'), 'm/d/Y' => date('m/d/Y'), 'custom' => Yii::t('content', 'Custom: ') . Html::textInput('Option[date_format][option_value]', $model->date_format->option_value, ['class' => 'value-date_format', 'readonly' => 'readonly'])], ['separator' => '<br />', 'encode' => false, 'class' => 'radio', 'itemOptions' => ['class' => 'radio-date_format']]);
コード例 #10
0
ファイル: _form.php プロジェクト: alexsynytskiy/Dynamomania
    <?php 
$form = ActiveForm::begin();
?>
    
    <div class="row">
        <div class="col-sm-6">
        <?php 
$availableTeams = [];
if (!$model->isNewRecord) {
    $team = $model->team;
    if (isset($team->id)) {
        $availableTeams = [$team->id => $team->name];
    }
}
echo $form->field($model, 'command_id')->widget(SelectizeDropDownList::classname(), ['loadUrl' => Url::to(['team/team-list']), 'items' => $availableTeams, 'options' => ['multiple' => false, 'placeholder' => 'Выберите команду...'], 'clientOptions' => ['valueField' => 'value', 'labelField' => 'text', 'persist' => false]]);
?>
        </div>
        
        <div class="col-sm-6">
        <?php 
echo $form->field($model, 'championship_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Championship::find()->all(), 'id', 'name'), 'language' => 'ru', 'options' => ['placeholder' => 'Выберите чемпионат...'], 'pluginOptions' => ['allowClear' => true]]);
?>
        </div>
    </div>
    
    <div class="row">
        <div class="col-sm-6">
        <?php 
echo $form->field($model, 'league_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(League::find()->all(), 'id', 'name'), 'language' => 'ru', 'options' => ['placeholder' => 'Выберите лигу...'], 'pluginOptions' => ['allowClear' => true]]);
?>
コード例 #11
0
ファイル: _form_short.php プロジェクト: slavam/placement
  ]);*/
?>

    <?php 
echo $form->field($model, 'firm')->widget(\dosamigos\selectize\SelectizeDropDownList::className(), ['items' => \yii\helpers\ArrayHelper::map(\app\models\Experience::find()->select(['firm'])->active()->distinct()->orderBy('firm asc')->asArray()->all(), 'firm', 'firm'), 'options' => ['multiple' => false, 'class' => 'form-control', 'prompt' => ''], 'clientOptions' => ['selectOnTab' => true, 'openOnFocus' => false, 'persist' => false, 'maxItems' => 1, 'create' => true, 'valueField' => 'firm', 'labelField' => 'firm', 'searchField' => ['firm']]]);
?>


    <?php 
//echo $form->field($model, 'profession_id')->textInput()
?>
    <?php 
//echo $form->field($model, 'profession_id',['inputOptions' => ['class' => 'form-control']])->dropDownList(ArrayHelper::map(\app\models\Profession::find()->active()->all(), 'id', 'name'), ['prompt' => ''])
?>
    <?php 
echo $form->field($model, 'profession_id')->widget(\dosamigos\selectize\SelectizeDropDownList::className(), ['items' => ArrayHelper::map(\app\models\Profession::find()->active()->all(), 'id', 'name'), 'options' => ['multiple' => false, 'class' => 'form-control', 'prompt' => ''], 'clientOptions' => ['openOnFocus' => false, 'persist' => false, 'maxItems' => 1, 'create' => false, 'valueField' => 'id', 'labelField' => 'name', 'searchField' => ['name']]]);
?>

    <?php 
//echo= $form->field($model, 'city_id')->textInput()
?>

    <?php 
echo $form->field($model, 'date_start')->widget(\dosamigos\datepicker\DatePicker::className(), ['language' => 'ru', 'options' => ['class' => 'form-control', 'autocomplete' => 'off'], 'clientOptions' => ['forceParse' => true, 'todayBtn' => true, 'clearBtn' => true, 'autoclose' => true, 'todayHighlight' => true, 'format' => 'dd.mm.yyyy']]);
?>

    <?php 
echo $form->field($model, 'date_end')->widget(\dosamigos\datepicker\DatePicker::className(), ['language' => 'ru', 'options' => ['class' => 'form-control', 'autocomplete' => 'off'], 'clientOptions' => ['forceParse' => true, 'todayBtn' => true, 'clearBtn' => true, 'autoclose' => true, 'todayHighlight' => true, 'format' => 'dd.mm.yyyy']]);
?>

    <?php 
コード例 #12
0
ファイル: _form.php プロジェクト: alexsynytskiy/Dynamomania
    }
}
echo $form->field($model, 'arbiter_assistant_4_id')->widget(SelectizeDropDownList::classname(), ['loadUrl' => Url::to(['arbiter/arbiter-list']), 'items' => $availableArbiters, 'options' => ['multiple' => false], 'clientOptions' => ['valueField' => 'value', 'labelField' => 'text', 'persist' => false]]);
?>
        </div>
        
        <div class="col-sm-6">
            <?php 
$availableArbiters = [];
if (!$model->isNewRecord) {
    $arbiter = Arbiter::findOne($model->arbiter_reserve_id);
    if (isset($arbiter->id)) {
        $availableArbiters = [$arbiter->id => $arbiter->name];
    }
}
echo $form->field($model, 'arbiter_reserve_id')->widget(SelectizeDropDownList::classname(), ['loadUrl' => Url::to(['arbiter/arbiter-list']), 'items' => $availableArbiters, 'options' => ['multiple' => false], 'clientOptions' => ['valueField' => 'value', 'labelField' => 'text', 'persist' => false]]);
?>
        </div>
    </div>

    <?php 
echo $form->field($model, 'announcement')->widget(\vova07\imperavi\Widget::className(), ['settings' => ['lang' => 'ru', 'minHeight' => 200, 'plugins' => ['fullscreen', 'table', 'video', 'fontcolor']]]);
?>

    <?php 
echo $form->field($model, 'is_visible')->widget(CheckboxX::classname(), ['pluginOptions' => ['threeState' => false]]);
?>
    
    <?php 
echo $form->field($model, 'is_finished')->widget(CheckboxX::classname(), ['pluginOptions' => ['threeState' => false]]);
?>
コード例 #13
0
ファイル: _form.php プロジェクト: alexsynytskiy/Dynamomania
/* @var $this yii\web\View */
/* @var $model common\models\SelectedBlog */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="selected-blog-form">

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

    <?php 
$availablePost = [];
if (isset($model->post)) {
    $availablePost[$model->post->id] = $model->post->title;
}
echo $form->field($model, 'post_id')->widget(SelectizeDropDownList::classname(), ['loadUrl' => '/admin/post/blog-list', 'items' => $availablePost, 'options' => ['multiple' => false], 'clientOptions' => ['delimiter' => ',', 'persist' => false, 'createOnBlur' => false, 'maxItems' => 1]]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Добавить' : 'Изменить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

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

</div>
コード例 #14
0
?>

    <?php 
echo $form->field($model, 'text')->widget(Redactor::className(), ['options' => ['minHeight' => 400, 'imageUpload' => Url::to(['/admin/redactor/upload', 'dir' => 'article'], true), 'fileUpload' => Url::to(['/admin/redactor/upload', 'dir' => 'article'], true), 'plugins' => ['fullscreen']]]);
?>

    <?php 
echo $form->field($model, 'time')->widget(DateTimePicker::className());
?>

    <?php 
echo '';
?>

    <?php 
echo $form->field($model, 'categoryIds')->widget(SelectizeDropDownList::className(), ['options' => ['multiple' => true], 'items' => ArrayHelper::map(Category::find()->all(), 'category_id', 'title')]);
?>

    <?php 
if ($this->context->module->settings['enableTags']) {
    ?>
        <?php 
    echo $form->field($model, 'tagNames')->widget(TagsInput::className());
    ?>
    <?php 
}
?>

    <?php 
if (IS_ROOT) {
    ?>