Пример #1
0
 public function run()
 {
     parent::run();
     AdminFormAsset::register($this->view);
     if ($this->useAjaxSubmit) {
         $this->registerJs();
     }
     if ($this->usePjax) {
         Pjax::end();
     }
 }
Пример #2
0
$this->registerJs(<<<JS
sx.classes.CreateOrder = sx.classes.Component.extend({
    _onDomReady: function()
    {
        $('#shop-create-order').submit();
    }
});
JS
)
?>
                            <a href="#" class="btn btn-primary btn-lg btn-block size-15" onclick="<?php 
echo new \yii\web\JsExpression(<<<JS
new sx.classes.CreateOrder(); return false;
JS
);
?>
">
                                <i class="fa fa-mail-forward"></i> Оформить
                            </a>
                        </div>
                    </div>
                </div>

            </div>
        <? endif; ?>

        <? \skeeks\cms\modules\admin\widgets\Pjax::end() ?>


    </div>
</section>
Пример #3
0
<?php

/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 02.06.2015
 */
/* @var $this yii\web\View */
/* @var $searchModel \skeeks\cms\models\Search */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>

<? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?>

    <?php 
echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
?>

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => $pjax, 'adminController' => \Yii::$app->controller, 'columns' => ['id', ['attribute' => 'site_code', 'class' => \skeeks\cms\grid\SiteColumn::className()], ['attribute' => 'active', 'class' => \skeeks\cms\grid\BooleanColumn::className()], 'name', 'base_rate']]);
?>

<? $pjax::end(); ?>
Пример #4
0
 public function init()
 {
     parent::init();
     $this->pjaxClassName = Pjax::className();
 }
Пример #5
0
    /**
     * @inheritdoc
     */
    public function run()
    {
        echo "<div class='row'>";
        echo "<div class='col-md-6'>";
        if ($this->hasModel()) {
            echo Html::activeListBox($this->model, $this->attribute, $this->items, $this->options);
        } else {
            echo Html::listBox($this->name, $this->value, $this->items, $this->options);
        }
        echo "</div>";
        echo "<div class='col-md-6'>";
        $createUrl = (string) \skeeks\cms\helpers\UrlHelper::construct($this->controllerRoute . '/' . $this->createAction)->setSystemParam(\skeeks\cms\modules\admin\Module::SYSTEM_QUERY_EMPTY_LAYOUT, 'true')->setSystemParam(\skeeks\cms\modules\admin\Module::SYSTEM_QUERY_NO_ACTIONS_MODEL, 'true')->enableAdmin()->toString();
        $updateUrl = (string) \skeeks\cms\helpers\UrlHelper::construct($this->controllerRoute . '/' . $this->updateAction)->setSystemParam(\skeeks\cms\modules\admin\Module::SYSTEM_QUERY_EMPTY_LAYOUT, 'true')->setSystemParam(\skeeks\cms\modules\admin\Module::SYSTEM_QUERY_NO_ACTIONS_MODEL, 'true')->enableAdmin()->toString();
        $create_w = \Yii::t('app', 'Create');
        $edit_w = \Yii::t('app', 'Edit');
        echo <<<HTML
            <a href="{$createUrl}" class="btn btn-default sx-btn-create sx-btn-controll" ><span class="glyphicon glyphicon-plus"></span> {$create_w}</a>
            <a href="{$updateUrl}" class="btn btn-default sx-btn-update sx-btn-controll" ><span class="glyphicon glyphicon-pencil"></span> {$edit_w}</a>
HTML;
        echo "</div>";
        echo "</div>";
        Pjax::end();
        $options = ['multiple' => (int) $this->multiple];
        $optionsString = Json::encode($options);
        $this->view->registerJs(<<<JS
        (function(sx, \$, _)
        {
            sx.classes.FormElementEditedSelect = sx.classes.Widget.extend({

                _init: function()
                {},

                getWrapper: function()
                {
                    return \$(this._wrapper);
                },

                _onDomReady: function()
                {
                    var self = this;

                    \$(this.getWrapper()).on('change', 'select', function()
                    {
                        self.updateButtons();
                    });

                    \$(this.getWrapper()).on('click', '.sx-btn-create', function()
                    {
                        var windowWidget = new sx.classes.Window(\$(this).attr('href'));

                        windowWidget.bind('close', function(e, data)
                        {
                            self.reload();
                        });

                        windowWidget.open();

                        return false;
                    });

                    \$(this.getWrapper()).on('click', '.sx-btn-update', function()
                    {
                        var windowWidget = new sx.classes.Window(\$(this).attr('href') + '&pk=' + \$('select', self.getWrapper()).val());

                        windowWidget.bind('close', function(e, data)
                        {
                            self.reload();
                        });

                        windowWidget.open();

                        return false;
                    });

                    self.updateButtons();
                },

                _onWindowReady: function()
                {},


                updateButtons: function()
                {
                    var self = this;

                    if (!self.get('multiple'))
                    {
                        if (\$('select', this.getWrapper()).val())
                        {
                            self.showUpdateControll();
                        } else
                        {
                            self.hideUpdateControll();
                        }
                    } else
                    {
                        self.hideUpdateControll();
                    }

                    return this;

                },

                /**
                *
                * @returns {sx.classes.FormElementEditedSelect}
                */
                hideUpdateControll: function()
                {
                    \$('.sx-btn-update', this.getWrapper()).hide();
                    return this;
                },

                /**
                *
                * @returns {sx.classes.FormElementEditedSelect}
                */
                showUpdateControll: function()
                {
                    \$('.sx-btn-update', this.getWrapper()).show();
                    return this;
                },

                reload: function()
                {
                    var self = this;

                    \$.pjax.reload("#" + this.getWrapper().attr('id'), {});

                    _.delay(function()
                    {
                        self.updateButtons();
                    }, 500);
                }
            });

            new sx.classes.FormElementEditedSelect('#{$this->_pjaxId}', {$optionsString});
        })(sx, sx.\$, sx._);
JS
);
    }
Пример #6
0
<?php

/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 31.05.2015
 */
use skeeks\cms\modules\admin\widgets\Pjax;
?>

<?php 
Pjax::begin(['id' => 'sx-pjax-tree', 'blockPjaxContainer' => false, 'blockContainer' => '.sx-panel']);
?>
<div class="col-md-8">
<?php 
echo \skeeks\cms\modules\admin\widgets\Tree::widget(["models" => $models]);
?>
</div>

<?php 
Pjax::end();