Ejemplo n.º 1
0
<?php

use yii\bootstrap\ActiveForm;
use yii\helpers\Html;
use backend\widgets\LanguageTabs;
$form = ActiveForm::begin(['id' => "translate-message-" . $key, 'enableClientValidation' => true, 'errorSummaryCssClass' => 'error-summary alert alert-error', 'method' => 'post', 'action' => ['site/save-translation', 'id' => $model->id], 'options' => ['class' => 'translate-message-form']]);
?>
        <div class="row">
            <div class="col-sm-10 no-gutter">
              <?php 
echo LanguageTabs::widget(['form' => $form, 'model' => $model, 'fieldName' => 'translation', 'translations' => $model->initializeTranslations(), 'numberOfRows' => 1, 'showLaguageCodeAsLabel' => true]);
?>
            </div>
            <div class="col-sm-2 no-gutter">
                <?php 
echo Html::submitButton('<i class="glyphicon glyphicon-floppy-disk"></i> ' . Yii::t('app', 'Save'), ['class' => 'btn btn-success btn-translation-save', 'title' => Yii::t('app', 'Save')]);
?>
            </div>
        </div>
        <div class="clearfix"></div>
        <?php 
$model->setLanguage(Yii::$app->params['appMainLanguage']);
?>
        <p><em><?php 
echo Yii::$app->params['supportedLanguages'][Yii::$app->params['appMainLanguage']];
?>
</em>: <?php 
echo $model->translation;
?>
</p>
<?php 
Ejemplo n.º 2
0
?>
        <div class="box-body col-md-7">
            <?php 
echo $form->field($flatPage, 'url')->textInput(['maxlength' => true]);
?>
            <?php 
if (!$flatPage->isNewRecord) {
    ?>
                <?php 
    echo LanguageTabs::widget(['form' => $form, 'model' => $flatPage, 'fieldName' => 'title', 'translations' => $translations]);
    ?>
                <?php 
    echo LanguageTabs::widget(['form' => $form, 'model' => $flatPage, 'fieldName' => 'meta_description', 'translations' => $translations, 'numberOfRows' => 2]);
    ?>
                <?php 
    echo LanguageTabs::widget(['form' => $form, 'model' => $flatPage, 'fieldName' => 'anchor', 'translations' => $translations]);
    ?>
            <?php 
}
?>
        </div>
        <div class="clearfix"></div>
        <div class="box-footer">
            <?php 
echo Html::submitButton('<span class="glyphicon glyphicon-check"></span> ' . ($flatPage->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Save')), ['id' => 'save-' . $flatPage->formName(), 'class' => 'btn btn-success']);
?>
        </div>

        <?php 
ActiveForm::end();
?>
Ejemplo n.º 3
0
echo Yii::t('app', 'Fill Block Data');
?>
</h3>
        </div>
        <?php 
$form = ActiveForm::begin(['id' => 'content', 'enableClientValidation' => true, 'errorSummaryCssClass' => 'error-summary alert alert-error']);
?>
        <div class="box-body col-md-7">
            <?php 
echo $form->field($content, 'flat_page_id')->dropDownList(FlatPage::getMappedArray());
?>
            <?php 
echo $form->field($content, 'name')->textInput(['maxlength' => true]);
?>
            <?php 
echo LanguageTabs::widget(['form' => $form, 'model' => $content, 'fieldName' => 'text', 'translations' => $translations, 'numberOfRows' => 10, 'isHTMLEditor' => true]);
?>
        </div>
         <?php 
//echo $form->errorSummary($content);
?>
        <div class="clearfix"></div>
        <div class="box-footer">
            <?php 
echo Html::submitButton('<span class="glyphicon glyphicon-check"></span> ' . ($content->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Save')), ['id' => 'save-' . $content->formName(), 'class' => 'btn btn-success']);
?>
        </div>

        <?php 
ActiveForm::end();
?>
Ejemplo n.º 4
0
?>
        <div class="box-body col-md-7">
            <?php 
echo $form->field($blogPost, 'blog_category_id')->dropDownList(BlogCategory::getMappedArray());
?>
            <?php 
if (!$blogPost->isNewRecord) {
    ?>
                <?php 
    echo LanguageTabs::widget(['form' => $form, 'model' => $blogPost, 'fieldName' => 'title', 'translations' => $translations]);
    ?>
                <?php 
    echo LanguageTabs::widget(['form' => $form, 'model' => $blogPost, 'fieldName' => 'meta_description', 'translations' => $translations, 'numberOfRows' => 3]);
    ?>
                <?php 
    echo LanguageTabs::widget(['form' => $form, 'model' => $blogPost, 'fieldName' => 'text', 'translations' => $translations, 'numberOfRows' => 10, 'isHTMLEditor' => true, 'allowHTMLEditorToUploadImages' => true, 'uploadImageUrl' => Url::toRoute(['/blog-post/upload-image', 'blogPostId' => $blogPost->id])]);
    ?>
            <?php 
}
?>
            <?php 
echo $form->field($blogPost, 'is_published')->checkbox();
?>
            <?php 
echo $form->field($blogPost, 'uploadedFeaturedImage', ['options' => ['class' => 'col-md-11 image-file-upload']])->widget(FileInput::classname(), ['options' => ['multiple' => false, 'accept' => 'image/*'], 'pluginOptions' => ['defaultPreviewContent' => Html::img($blogPost->getFullUrlFeaturedImage()), 'overwriteInitial' => true, 'showCaption' => false, 'showRemove' => true, 'showUpload' => false, 'showClose' => false, 'browseLabel' => '', 'removeLabel' => '', 'removeIcon' => '<i class="glyphicon glyphicon-remove"></i>', 'layoutTemplates' => ['main2' => '{preview} {browse} {remove}'], 'allowedFileExtensions' => ["jpg", "png", "gif"]]]);
?>
        </div>
        <div class="clearfix"></div>
        <div class="box-footer">
            <?php 
echo Html::submitButton('<span class="glyphicon glyphicon-check"></span> ' . ($blogPost->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Save')), ['id' => 'save-' . $blogPost->formName(), 'class' => 'btn btn-success']);
Ejemplo n.º 5
0
?>
        <div class="box-body col-md-7">
            <?php 
echo $form->field($blogCategory, 'identifier')->textInput();
?>
            <?php 
if (!$blogCategory->isNewRecord) {
    ?>
                <?php 
    echo LanguageTabs::widget(['form' => $form, 'model' => $blogCategory, 'fieldName' => 'name', 'translations' => $translations]);
    ?>
                <?php 
    echo LanguageTabs::widget(['form' => $form, 'model' => $blogCategory, 'fieldName' => 'description', 'translations' => $translations, 'numberOfRows' => 10, 'isHTMLEditor' => true]);
    ?>
                <?php 
    echo LanguageTabs::widget(['form' => $form, 'model' => $blogCategory, 'fieldName' => 'meta_description', 'translations' => $translations]);
    ?>
            <?php 
}
?>
        </div>
        <div class="clearfix"></div>
        <div class="box-footer">
            <?php 
echo Html::submitButton('<span class="glyphicon glyphicon-check"></span> ' . ($blogCategory->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Save')), ['id' => 'save-' . $blogCategory->formName(), 'class' => 'btn btn-success']);
?>
        </div>

        <?php 
ActiveForm::end();
?>
Ejemplo n.º 6
0
}
?>
            <?php 
if (!$flatPage->isNewRecord) {
    ?>
                <?php 
    echo LanguageTabs::widget(['form' => $form, 'model' => $flatPage, 'fieldName' => 'slug', 'translations' => $translations]);
    ?>
            <?php 
}
?>
            <?php 
echo LanguageTabs::widget(['form' => $form, 'model' => $flatPage, 'fieldName' => 'meta_title', 'fieldType' => 'textInput', 'translations' => $translations]);
?>
            <?php 
echo LanguageTabs::widget(['form' => $form, 'model' => $flatPage, 'fieldName' => 'meta_description', 'translations' => $translations, 'numberOfRows' => 2]);
?>
            
            <?php 
echo $form->field($flatPage, 'is_active')->checkbox();
?>
            <?php 
echo $form->field($flatPage, 'display_on_menu')->checkbox();
?>
        </div>
        <div class="clearfix"></div>
        <div class="box-footer">
            <?php 
echo Html::submitButton('<span class="glyphicon glyphicon-check"></span> ' . ($flatPage->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Save')), ['id' => 'save-' . $flatPage->formName(), 'class' => 'btn btn-success']);
?>
        </div>