Ejemplo n.º 1
0
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5><?php 
echo Yii::t('common', 'Information');
?>
</h5>
                </div>
                <div class="ibox-content">
                    <?php 
$form = ActiveForm::begin(['id' => 'formDefault', 'layout' => 'horizontal', 'options' => ['enctype' => 'multipart/form-data'], 'fieldConfig' => ['horizontalCssClasses' => ['label' => 'col-sm-2', 'wrapper' => 'col-sm-10', 'error' => 'help-block m-b-none', 'hint' => '']]]);
// Image
$imageConfig = ['options' => ['accept' => 'uploads/*'], 'pluginOptions' => ['previewFileType' => 'image', 'showCaption' => FALSE, 'showRemove' => FALSE, 'showUpload' => FALSE, 'browseClass' => 'btn btn-primary btn-block', 'browseIcon' => '<i class="glyphicon glyphicon-camera"></i> ', 'browseLabel' => 'Select Photo', 'removeClass' => 'btn btn-danger', 'removeLabel' => "Delete", 'removeIcon' => '<i class="glyphicon glyphicon-trash"></i>', 'allowedFileExtensions' => ['jpg', 'gif', 'png', 'jpeg']]];
if (!empty($model->image)) {
    $imageConfig['pluginOptions']['initialPreview'] = [Html::img(LetHelper::getFileUploaded($model->image), ['class' => 'file-preview-image'])];
}
// END Image
$tabs = [['label' => Yii::t('common', 'General information'), 'content' => $form->field($model, 'name')->textInput() . $form->field($model, 'class')->textInput() . $form->field($model, 'skin')->textInput() . $form->field($model, 'image')->widget(FileInput::classname(), $imageConfig) . $form->field($model, 'content')->widget(letyii\tinymce\Tinymce::className(), ['options' => ['style' => 'height: 400px;'], 'configs' => ['plugins' => 'moxiemanager advlist autolink lists link image charmap print preview hr anchor pagebreak ' . 'searchreplace wordcount visualblocks visualchars code fullscreen ' . 'insertdatetime media nonbreaking save table contextmenu directionality ' . 'emoticons template paste textcolor colorpicker textpattern', 'toolbar1' => 'insertfile undo redo | styleselect | fontselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image', 'toolbar2' => 'print preview media | forecolor backcolor emoticons', 'moxiemanager_image_settings' => ['moxiemanager_title' => 'Images', 'moxiemanager_extensions' => 'jpg,png,gif', 'moxiemanager_rootpath' => '/uploads/editor', 'moxiemanager_view' => 'thumbs'], 'external_plugins' => ['moxiemanager' => Url::base() . '/plugins/moxiemanager/plugin.min.js'], 'entity_encoding' => 'raw', 'force_p_newlines' => true, 'force_br_newlines' => false, 'auto_cleanup_word' => false, 'relative_urls' => true, 'convert_urls' => false, 'remove_script_host' => true, 'verify_html' => false, 'forced_root_block' => false, 'content_css' => 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css', 'templates' => Url::to(['template'])]]) . $form->field($model, 'description')->textarea() . $form->field($model, 'promotion')->widget(SwitchInput::className(['type' => SwitchInput::RADIO])) . $form->field($model, 'status')->widget(SwitchInput::className(['type' => SwitchInput::RADIO])), 'active' => true], ['label' => 'Seo', 'content' => $form->field($model, 'slug')->textInput() . $form->field($model, 'slug_prefix')->textInput() . $form->field($model, 'seo_url')->textInput() . $form->field($model, 'seo_title')->textInput() . $form->field($model, 'seo_desc')->textInput(), $form->field($model, 'seo_keyword')->textInput()]];
echo Html::hiddenInput('save_type', 'save');
echo yii\bootstrap\Tabs::widget(['items' => $tabs]);
ActiveForm::end();
?>
                </div>
            </div>
        </div>
    </div>
</div>


Ejemplo n.º 2
0
                                <h1 class="text-center h2">Create New Message</h1>

                                <?php 
$form = ActiveForm::begin(['id' => 'formDefault', 'layout' => 'horizontal', 'options' => ['enctype' => 'multipart/form-data'], 'fieldConfig' => ['horizontalCssClasses' => ['label' => 'col-sm-2', 'wrapper' => 'col-sm-10', 'error' => 'help-block m-b-none', 'hint' => '']]]);
?>
                                <?php 
echo $form->field($model, 'subject');
?>
                                <?php 
echo $form->field($model, 'users')->widget(\kartik\select2\Select2::classname(), ['data' => $model->getUserOptions(), 'options' => ['placeholder' => Yii::t('message', 'Select Users'), 'multiple' => 'multiple'], 'pluginOptions' => ['allowClear' => true, 'minimumInputLength' => 2, 'ajax' => ['url' => Url::to(['user-list']), 'dataType' => 'json', 'data' => new JsExpression('function(params) { return {q:params.term}; }')], 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), 'templateResult' => new JsExpression('function(users) { return users.text; }'), 'templateSelection' => new JsExpression('function (users) { return users.text; }')]]);
?>
                                <?php 
echo $form->field($model, 'category_id')->dropDownList(\app\modules\message\models\Message::getCategoryOptions());
?>
                                <?php 
echo $form->field($model, 'content')->widget(letyii\tinymce\Tinymce::className(), ['options' => ['style' => 'height: 400px;'], 'configs' => ['setup' => new \yii\web\JsExpression('function(editor) { editor.on("change", function() { tinymce.triggerSave(); }); }'), 'plugins' => 'moxiemanager advlist autolink lists link image charmap print preview hr anchor pagebreak ' . 'searchreplace wordcount visualblocks visualchars code fullscreen ' . 'insertdatetime media nonbreaking save table contextmenu directionality ' . 'emoticons template paste textcolor colorpicker textpattern', 'toolbar1' => 'insertfile undo redo | styleselect | fontselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image', 'toolbar2' => 'print preview media | forecolor backcolor emoticons', 'moxiemanager_image_settings' => ['moxiemanager_title' => 'Images', 'moxiemanager_extensions' => 'jpg,png,gif', 'moxiemanager_rootpath' => '/uploads/files', 'moxiemanager_view' => 'thumbs'], 'external_plugins' => ['moxiemanager' => Url::base() . '/plugins/moxiemanager/plugin.min.js']]]);
?>

                                <div class="text-center">
                                    <button type="submit" class="button button-primary button-lg">Send</button>
                                </div>

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

                            </div>
                        </div>
                        <div class="col-xs-12 col-sm-3 col-sm-pull-9 col-sidebar">
                            <?php 
echo $this->render('_sidebar');
Ejemplo n.º 3
0
Archivo: _form.php Proyecto: letyii/cms
use kartik\widgets\SwitchInput;
use app\components\FieldRange;
use kartik\widgets\FileInput;
/**
 * @var yii\web\View $this
 * @var app\modules\article\models\LetArticle $model
 * @var yii\widgets\ActiveForm $form
 */
?>

<?php 
$form = ActiveForm::begin(['id' => 'formDefault', 'options' => ['enctype' => 'multipart/form-data']]);
echo Html::hiddenInput('save_type', 'save');
echo $form->field($model, 'category_id')->widget(\app\components\FieldCategory::className());
echo $form->field($model, 'title')->textInput(['maxlength' => 255]);
echo $form->field($model, 'content')->widget(letyii\tinymce\Tinymce::className(), ['options' => ['id' => 'testid', 'class' => 'abc'], 'configs' => ['selector' => 'textarea#testid', 'link_list' => [['title' => 'My page 1', 'value' => 'http://www.tinymce.com'], ['title' => 'My page 2', 'value' => 'http://www.tinymce.com']]]]);
echo FieldRange::widget(['form' => $form, 'model' => $model, 'useAddons' => false, 'label' => 'Time range', 'attribute1' => 'from_time', 'attribute2' => 'to_time', 'type' => FieldRange::INPUT_DATETIME]);
//echo $form->field($model, 'from_time')->widget(DateTimePicker::className([
//    'type' => DateTimePicker::TYPE_INPUT,
//    'pluginOptions' => [
//        'autoclose'=>true,
//        'format' => 'dd-mm-yyyy hh:ii'
//    ]
//]));
echo $form->field($model, 'promotion')->widget(SwitchInput::className(['type' => SwitchInput::RADIO]));
echo $form->field($model, 'status')->widget(SwitchInput::className(['type' => SwitchInput::RADIO]));
$imageConfig = ['options' => ['accept' => 'uploads/*'], 'pluginOptions' => ['previewFileType' => 'image', 'showCaption' => FALSE, 'showRemove' => FALSE, 'showUpload' => FALSE, 'browseClass' => 'btn btn-primary btn-block', 'browseIcon' => '<i class="glyphicon glyphicon-camera"></i> ', 'browseLabel' => 'Select Photo']];
if (!empty($model->image)) {
    $imageConfig['pluginOptions']['initialPreview'] = Html::img(LetHelper::getFileUploaded($model->image), ['class' => 'file-preview-image']);
}
echo $form->field($model, 'image')->widget(FileInput::classname(), $imageConfig);
Ejemplo n.º 4
0
                                                <?php 
                    }
                    ?>
                                            </td>
                                        <?php 
                }
                ?>
                                    </tr>
                                    </tbody>
                                </table>
                            <?php 
            }
            ?>
                        </div>
                    </div>

                <?php 
        } elseif ($val->type == 'wysiwyg') {
            $model->wysiwyg = html_entity_decode($val->value);
            ?>
                    <?php 
            echo $form->field($model, 'wysiwyg')->widget(letyii\tinymce\Tinymce::className(), ['options' => ['id' => 'fields[' . $val->id . ']', 'name' => 'fields[' . $val->id . ']'], 'configs' => ['plugins' => ["advlist autolink lists link image charmap print preview anchor", "searchreplace visualblocks code fullscreen", "insertdatetime media table contextmenu paste"], 'language' => 'ru', 'relative_urls' => false, 'toolbar' => "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"]])->label(false);
            $model->wysiwyg = null;
            ?>
                <?php 
        }
        ?>
        </div>
    <?php 
    }
}
Ejemplo n.º 5
0
?>

    <?php 
echo $form->field($model, 'menu_type')->dropDownList(["doeuvres" => "D'oeuvres", "reseption" => "Reseption"]);
?>

    <?php 
echo $form->field($model, 'menu_price')->textInput();
?>
    
    <?php 
echo $form->field($model, 'menu_limit')->textInput();
?>
    
    <?php 
echo $form->field($model, 'menu_desc')->widget(letyii\tinymce\Tinymce::className(), []);
?>
    
    

    <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();
?>

</div>
Ejemplo n.º 6
0
</center>

</br>
</br>

    <?php 
$form = ActiveForm::begin(['action' => ['backend/email/send2']]);
?>
    <?php 
echo $form->field($email, 'id_event')->dropDownList(ArrayHelper::map($data, 'id', 'nama'))->label('Seminar yang tersedia');
?>
	<?php 
echo $form->field($email, 'subject')->textInput(['maxlength' => true]);
?>
	<!-- <?php 
echo $form->field($email, 'content')->textArea(['maxlength' => true, 'rows' => 10]);
?>
 -->
    <?php 
echo $form->field($email, 'content')->widget(letyii\tinymce\Tinymce::className(), ['options' => ['rows' => 15]]);
?>
    <p>Autotag yang dapat digunakan: {nama}, {nama_seminar}, {jadwal}.</p>
	<div class="form-group">
        <?php 
echo Html::submitButton('Send', ['class' => 'btn btn-success']);
?>
    </div>


    <?php 
ActiveForm::end();