示例#1
0
    ?>

    <?php 
    if (User::hasPermission('editMedia')) {
        ?>
        <?php 
        echo $form->field($model, 'album_id')->dropDownList(ArrayHelper::merge([NULL => Yii::t('yee', 'Not Selected')], Album::getAlbums(true, true)));
        ?>
        <?php 
        echo $form->field($model, 'title')->textInput(['class' => 'form-control input-sm']);
        ?>
    <?php 
    } else {
        ?>
        <?php 
        echo $form->field($model, 'album_id')->dropDownList(ArrayHelper::merge([NULL => Yii::t('yee', 'Not Selected')], Album::getAlbums(true, true)), ['readonly' => 'readonly']);
        ?>
        <?php 
        echo $form->field($model, 'title')->textInput(['class' => 'form-control input-sm', 'readonly' => 'readonly']);
        ?>
    <?php 
    }
    ?>

<?php 
}
?>

<?php 
if ($model->isImage()) {
    ?>
示例#2
0
?>

<div class="row">
    <div class="col-sm-12">
        <div class="panel panel-default">
            <div style="padding: 5px; height:50px;" class="panel-body">

                <?php 
$form = ActiveForm::begin(['id' => 'gallery', 'action' => Url::to($mode == 'modal' ? ['/media/manage/index'] : ['/media/default/index']), 'method' => 'get', 'class' => 'gridview-filter-form', 'fieldConfig' => ['template' => "{input}\n{hint}\n{error}"]]);
?>
                <table id="gallery-grid-filters" class="table table-striped filters">
                    <thead>
                    <tr id="user-visit-log-grid-filters" class="filters">
                        <td style="width: auto;">
                            <?php 
echo $form->field($searchModel, 'album_id')->dropDownList(ArrayHelper::merge(['' => Yii::t('yee/media', 'All Media Items')], Album::getAlbums(true, true)), ['prompt' => '']);
?>
                        </td>
                        <td style="width: auto;">
                            <?php 
echo $form->field($searchModel, 'title')->textInput(['placeholder' => $searchModel->attributeLabels()['title']]);
?>
                        </td>
                        <td style="width: auto;">
                            <?php 
echo $form->field($searchModel, 'created_at')->widget(DatePicker::className(), ['dateFormat' => 'yyyy-MM-dd', 'options' => ['placeholder' => $searchModel->attributeLabels()['created_at'], 'class' => 'form-control']]);
?>
                        </td>
                        <?php 
if (User::hasPermission('uploadMedia')) {
    ?>