public function end()
 {
     if ($this->formConfig['enableClientScript'] && !$this->form && !empty($this->formConfig['options']['id'])) {
         $view = \Yii::$app->getView();
         $clientOptions = $this->getClientOptions();
         if ($clientOptions) {
             ActiveFormAsset::register($view);
             $attribute = Json::encode($clientOptions);
             $view->registerJs("jQuery('#{$this->formConfig['options']['id']}').yiiActiveForm('add', {$attribute});");
         }
     }
     return parent::end();
 }
Esempio n. 2
0
 public function run()
 {
     if (!empty($this->_fields)) {
         throw new InvalidCallException('Each beginField() should have a matching endField() call.');
     }
     if ($this->enableClientScript) {
         $id = $this->options['id'];
         $options = Json::encode($this->getClientOptions());
         $attributes = Json::encode($this->attributes);
         $view = $this->getView();
         ActiveFormAsset::register($view);
         $view->registerJs("jQuery('#{$id}').yiiActiveForm({$attributes}, {$options});");
     }
     echo '</div>';
     echo '</div>';
     echo Html::endForm();
 }
Esempio n. 3
0
use yii\helpers\Html;
use yii\widgets\ActiveFormAsset;
use yii\widgets\Pjax;
use yii\bootstrap\Modal;
use yii\grid\GridViewAsset;
use kartik\date\DatePickerAsset;
use kartik\select2\Select2;
use kartik\touchspin\TouchSpinAsset;
use app\modules\plan_prospekt\Asset;
/**
 * @var $this View
 * @var $actionSubview string
 * @var $actionParams array
 * @var $gridParams array
 */
ActiveFormAsset::register($this);
TouchSpinAsset::register($this);
DatePickerAsset::register($this);
GridViewAsset::register($this);
Asset::register($this);
echo Html::beginTag('div', ['class' => 'planprospekt planprospekt-editor']);
echo Html::tag('h3', 'План проспект ' . Yii::$app->request->get('year'));
// workaround for kratik-select2 pjax loading bug
echo Html::tag('div', Select2::widget(['name' => 'stub']), ['class' => 'hidden']);
Modal::begin(['id' => 'modal-action', 'header' => '<h4></h4>']);
$this->registerJs('mybriop.planProspektEditor.modalDynamicOptionsInit("#modal-action");');
Pjax::begin(['id' => 'pjax-action', 'timeout' => 3500]);
if (isset($actionSubview) && isset($actionParams)) {
    $indexUrl = $actionParams['indexUrl'];
    $modalMethod = $actionParams['model'] !== null ? "show" : "hide";
    $this->registerJs('mybriop.planProspektEditor.modalHiddenHandlerInit("#modal-action", "#pjax-grid", "' . $indexUrl . '");');
Esempio n. 4
0
 /**
  * Runs the widget.
  * This registers the necessary javascript code and renders the form close tag.
  */
 public function run()
 {
     echo Html::endTag('div');
     echo $this->renderActions(self::BUTTONS_POSITION_BOTTOM);
     if (!empty($this->attributes)) {
         $id = $this->options['id'];
         $options = Json::encode($this->getClientOptions());
         $attributes = Json::encode($this->attributes);
         $view = $this->getView();
         ActiveFormAsset::register($view);
         $view->registerJs("jQuery('#{$id}').yiiActiveForm({$attributes}, {$options});");
     }
     if ($this->fake) {
         echo Html::endTag('div');
     } else {
         echo Html::endForm();
     }
 }
Esempio n. 5
0
 /**
  * Runs the widget.
  * This registers the necessary javascript code and renders the form close tag.
  */
 public function run()
 {
     if (!empty($this->attributes)) {
         $id = $this->options['id'];
         $options = Json::encode($this->getClientOptions());
         $attributes = Json::encode($this->attributes);
         $view = $this->getView();
         ActiveFormAsset::register($view);
         $view->registerJs("jQuery('#{$id}').yiiActiveForm({$attributes}, {$options});");
     }
     echo Html::endForm();
 }
Esempio n. 6
0
<?php

use common\components\DataInformer;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\Menu;
use yii\widgets\ActiveForm;
use roman444uk\magnificPopup\MagnificPopup;
use common\models\Advert;
$isGuest = Yii::$app->user->isGuest;
$actionId = Yii::$app->controller->action->id;
$dataInformer = Yii::$app->dataInformer;
$isLoginMenuItemVisible = $isGuest && !in_array($actionId, ['registration', 'login']);
if ($isLoginMenuItemVisible) {
    \yii\validators\ValidationAsset::register($this);
    \yii\widgets\ActiveFormAsset::register($this);
}
?>

<div id="block-header">
    
    <!-- Choose language section -->
    <!--<div class="lang-choose">
        <?php 
echo Html::a(Yii::t('app', 'rus'), '', ['class' => "selected"]);
?>
        <span>|</span>
        <?php 
echo Html::a(Yii::t('app', 'ukr'));
?>
    </div>-->