コード例 #1
0
ファイル: ActionColumn.php プロジェクト: tqsq2005/dotplant2
 /**
  * Creates a URL for the given action and model.
  * This method is called for each button and each row.
  * @param string $action the button name (or action ID)
  * @param \yii\db\ActiveRecord $model the data model
  * @param mixed $key the key associated with the data model
  * @param integer $index the current row index
  * @param bool $appendReturnUrl custom return url for each button
  * @param string $url_append custom append url for each button
  * @param string $keyParam custom param if $key is string
  * @param array $attrs list of model attributes used in route params
  * @return string the created URL
  */
 public function createUrl($action, $model, $key, $index, $appendReturnUrl = null, $url_append = null, $keyParam = 'id', $attrs = [])
 {
     if ($this->urlCreator instanceof Closure) {
         return call_user_func($this->urlCreator, $action, $model, $key, $index);
     } else {
         $params = [];
         if (is_array($key)) {
             $params = $key;
         } else {
             if (is_null($keyParam) === false) {
                 $params = [$keyParam => (string) $key];
             }
         }
         $params[0] = $this->controller ? $this->controller . '/' . $action : $action;
         foreach ($attrs as $attrName) {
             if ($attrName === 'model') {
                 $params['model'] = $model;
             } elseif ($attrName === 'mainCategory.category_group_id' && $model->getMainCategory()) {
                 $params['category_group_id'] = $model->getMainCategory()->category_group_id;
             } else {
                 $params[$attrName] = $model->getAttribute($attrName);
             }
         }
         if (is_null($appendReturnUrl) === true) {
             $appendReturnUrl = $this->appendReturnUrl;
         }
         if (is_null($url_append) === true) {
             $url_append = $this->url_append;
         }
         if ($appendReturnUrl) {
             $params['returnUrl'] = Helper::getReturnUrl();
         }
         return Url::toRoute($params) . $url_append;
     }
 }
コード例 #2
0
ファイル: OptionGenerate.php プロジェクト: tqsq2005/dotplant2
 public function run()
 {
     $this->genButton = Html::a(Icon::show('edit') . Yii::t('app', 'Generate'), '#', ['class' => 'btn btn-success', 'id' => 'btn-generate']);
     $parent_id = $this->model->main_category_id;
     $owner_id = $this->model->id;
     $this->addButton = Html::a(Icon::show('plus') . Yii::t('app', 'Add'), Url::toRoute(['/shop/backend-product/edit', 'parent_id' => $parent_id, 'owner_id' => $owner_id, 'returnUrl' => \app\backend\components\Helper::getReturnUrl()]), ['class' => 'btn btn-success', 'id' => 'btn-add']);
     if (!empty($this->footer)) {
         $this->footer = Html::tag('div', $this->addButton . ' ' . $this->genButton, ['class' => 'widget-footer']);
     }
     $this->object = Object::getForClass(get_class($this->model));
     $rest_pg = (new Query())->select('id, name')->from(PropertyGroup::tableName())->where(['object_id' => $this->object->id])->orderBy('sort_order')->all();
     $this->property_groups_to_add = [];
     foreach ($rest_pg as $row) {
         $this->property_groups_to_add[$row['id']] = $row['name'];
     }
     $optionGenerate = Json::decode($this->model->option_generate);
     if (null === PropertyGroup::findOne($optionGenerate['group'])) {
         $this->model->option_generate = $optionGenerate = null;
     }
     $groupModel = null;
     if (isset($optionGenerate['group'])) {
         $groupModel = PropertyGroup::findOne($optionGenerate['group']);
         $properties = Property::getForGroupId($optionGenerate['group']);
     } else {
         $group_ids = array_keys($this->property_groups_to_add);
         $group_id = array_shift($group_ids);
         $groupModel = PropertyGroup::findOne($group_id);
         $properties = Property::getForGroupId($group_id);
     }
     if (is_null($groupModel)) {
         $groupModel = new PropertyGroup();
     }
     return $this->render($this->viewFile, ['model' => $this->model, 'form' => $this->form, 'groups' => $this->property_groups_to_add, 'groupModel' => $groupModel, 'properties' => $properties, 'optionGenerate' => $optionGenerate, 'footer' => $this->footer]);
 }
コード例 #3
0
ファイル: ErrorImage.php プロジェクト: tqsq2005/dotplant2
 protected function getProductLinks($id)
 {
     $model = Product::findById($id, null);
     if (is_null($model)) {
         return false;
     }
     $this->frontendLink = Html::a($model->name, ['@product', 'model' => $model, 'category_group_id' => isset($model->category) ? $model->category->category_group_id : null]);
     $this->backendLink = Html::a($model->name, ['/shop/backend-product/edit', 'id' => $model->id, 'returnUrl' => Helper::getReturnUrl()]);
 }
コード例 #4
0
ファイル: ActionColumn.php プロジェクト: heartshare/dotplant2
 /**
  * Creates a URL for the given action and model.
  * This method is called for each button and each row.
  * @param string $action the button name (or action ID)
  * @param \yii\db\ActiveRecord $model the data model
  * @param mixed $key the key associated with the data model
  * @param integer $index the current row index
  * @return string the created URL
  */
 public function createUrl($action, $model, $key, $index)
 {
     if ($this->urlCreator instanceof Closure) {
         return call_user_func($this->urlCreator, $action, $model, $key, $index);
     } else {
         $params = is_array($key) ? $key : ['id' => (string) $key];
         $params[0] = $this->controller ? $this->controller . '/' . $action : $action;
         if ($this->appendReturnUrl) {
             $params['returnUrl'] = Helper::getReturnUrl();
         }
         return Url::toRoute($params) . $this->url_append;
     }
 }
コード例 #5
0
ファイル: configure-json.php プロジェクト: tqsq2005/dotplant2
<?php

/** @var null|\yii\base\Model $configurationModel */
/** @var \app\extensions\DefaultTheme\models\ThemeWidgets $widget */
/** @var boolean $isAjax */
/** @var \yii\web\View $this */
/** @var \app\extensions\DefaultTheme\models\ThemeActiveWidgets $model */
use kartik\widgets\ActiveForm;
echo \app\widgets\Alert::widget();
$form = ActiveForm::begin(['id' => 'configure-widget-json-form', 'type' => ActiveForm::TYPE_HORIZONTAL]);
echo $form->field($configurationModel, 'header');
echo $form->field($configurationModel, 'displayHeader')->checkbox();
if (!empty($widget->configuration_view)) {
    ?>
    <?php 
    echo $this->render($widget->configuration_view, ['form' => $form, 'configurationModel' => $configurationModel, 'widget' => $widget, 'isAjax' => $isAjax, 'model' => $model]);
} else {
    ?>
    <?php 
    echo $form->field($configurationModel, 'configuration_json')->widget(\devgroup\jsoneditor\Jsoneditor::className());
}
echo \app\backend\components\Helper::saveButtons($model, 'index', 'configure-json', $isAjax);
ActiveForm::end();
コード例 #6
0
ファイル: index.php プロジェクト: tqsq2005/dotplant2
use kartik\helpers\Html;
use kartik\dynagrid\DynaGrid;
use kartik\icons\Icon;
use yii\helpers\Url;
$this->params['breadcrumbs'][] = $this->title = Yii::t('app', 'Views');
?>

<?php 
echo app\widgets\Alert::widget(['id' => 'alert']);
?>

<div class="row">
    <div class="col-md-12">
        <?php 
$this->beginBlock('add-button');
?>
        <?php 
echo \yii\helpers\Html::a(Icon::show('plus') . Yii::t('app', 'Add'), ['/backend/view/add', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']);
?>
        <?php 
echo \app\backend\widgets\RemoveAllButton::widget(['url' => '/backend/view/remove-all', 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']]);
?>
        <?php 
$this->endBlock();
?>
        <?php 
echo DynaGrid::widget(['options' => ['id' => 'views-grid'], 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'id'], 'name', 'view', 'category', 'internal_name', ['class' => 'app\\backend\\components\\ActionColumn', 'options' => ['width' => '95px']]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => '<h3 class="panel-title">' . $this->title . '</h3>', 'after' => $this->blocks['add-button']]]]);
?>
    </div>
</div>
コード例 #7
0
ファイル: index.php プロジェクト: Emericanec/dotplant2
<div class="row">
    <div class="col-md-4">
        <?php 
echo TreeWidget::widget(['treeDataRoute' => ['getTree', 'selected_id' => $parent_id], 'changeParentAction' => 'move', 'reorderAction' => 'reorder', 'doubleClickAction' => ContextMenuHelper::actionUrl(['/page/backend/edit']), 'contextMenuItems' => ['edit' => ['label' => 'Edit', 'icon' => 'fa fa-pencil', 'action' => ContextMenuHelper::actionUrl(['/page/backend/edit'])], 'show' => ['label' => 'Show pages inside this page', 'icon' => 'fa fa-folder-o', 'action' => ContextMenuHelper::actionUrl(['/page/backend/index'], ['parent_id' => 'id'])], 'create' => ['label' => 'Create', 'icon' => 'fa fa-plus-circle', 'action' => ContextMenuHelper::actionUrl(['/page/backend/edit'], ['parent_id' => 'id'])], 'delete' => ['label' => 'Delete', 'icon' => 'fa fa-trash-o', 'action' => new \yii\web\JsExpression("function(node) {\n                            jQuery('#delete-confirmation')\n                                .attr('data-url', '/page/backend/delete?id=' + jQuery(node.reference[0]).data('id'))\n                                .attr('data-items', '')\n                                .modal('show');\n                            return true;\n                        }")]]]);
?>
    </div>
    <div class="col-md-8" id="jstree-more">

        <?php 
$this->beginBlock('buttonGroup');
?>
        <div class="btn-toolbar" role="toolbar">
            <div class="btn-group">
                <?php 
echo \yii\helpers\Html::a(Icon::show('plus') . Yii::t('app', 'Add'), ['/page/backend/edit', 'parent_id' => is_object($model) ? $model->id : 0, 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']);
?>
            </div>
            <?php 
echo \app\backend\widgets\RemoveAllButton::widget(['url' => \yii\helpers\Url::toRoute(['/page/backend/remove-all', 'parent_id' => is_object($model) ? $model->id : 0]), 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']]);
?>
        </div>
        <?php 
$this->endBlock();
?>

        <?php 
echo DynaGrid::widget(['options' => ['id' => 'page-grid'], 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'id'], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'title'], 'slug', ['class' => 'app\\backend\\columns\\BooleanStatus', 'attribute' => 'published'], ['class' => 'app\\backend\\components\\ActionColumn', 'buttons' => [['url' => 'edit', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')], ['url' => 'clone', 'icon' => 'copy', 'class' => 'btn-success', 'label' => Yii::t('app', 'Clone')], ['url' => 'delete', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => Yii::t('app', 'Delete'), 'options' => ['data-action' => 'delete']]], 'url_append' => '&parent_id=' . (is_object($model) ? $model->id : 0)]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => '<h3 class="panel-title">' . $this->title . '</h3>', 'after' => $this->blocks['buttonGroup']]]]);
?>
    </div>
</div>
コード例 #8
0
<?php

/**
 * @var yii\web\View $this
 * @var yii\data\ActiveDataProvider $dataProvider
 * @var \app\models\Form $searchModel
 */
use app\backend\components\ActionColumn;
use kartik\dynagrid\DynaGrid;
use kartik\grid\BooleanColumn;
use kartik\helpers\Html;
use kartik\icons\Icon;
$this->title = Yii::t('app', 'Content Blocks');
$this->params['breadcrumbs'][] = $this->title;
?>

<?php 
echo app\widgets\Alert::widget(['id' => 'alert']);
?>

<?php 
echo DynaGrid::widget(['options' => ['id' => 'backend-chunk-grid'], 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'id'], 'name', 'key', ['class' => BooleanColumn::className(), 'attribute' => 'preload'], ['class' => ActionColumn::className(), 'options' => ['width' => '95px'], 'buttons' => [['url' => 'edit', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')], ['url' => 'delete', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => Yii::t('app', 'Delete')]]]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => Html::tag('h3', $this->title, ['class' => 'panel-title']), 'after' => Html::a(Icon::show('plus') . Yii::t('app', 'Add'), ['/core/backend-chunk/edit', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']) . \app\backend\widgets\RemoveAllButton::widget(['url' => '/core/backend-chunk/remove-all', 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']])]]]);
コード例 #9
0
     var current_field_id= "apply_if_params"', \yii\web\View::POS_HEAD, 'propertyData');
\app\backend\assets\PropertyAsset::register($this);
?>


<?php 
echo app\widgets\Alert::widget(['id' => 'alert']);
?>

<?php 
$form = ActiveForm::begin(['id' => 'dynamic-content-form', 'type' => ActiveForm::TYPE_VERTICAL, 'action' => $action]);
?>

<?php 
$this->beginBlock('submit');
echo \app\backend\components\Helper::saveButtons($model);
$this->endBlock();
?>


<section id="widget-grid">
    <div class="row">

        <article class="col-xs-12 col-sm-6 col-md-6 col-lg-6">

            <?php 
BackendWidget::begin(['title' => Yii::t('app', 'Dynamic Content'), 'icon' => 'cogs', 'footer' => $this->blocks['submit']]);
?>
            <?php 
echo $form->field($model, 'object_id')->dropDownList(app\models\Object::getSelectArray());
?>
コード例 #10
0
ファイル: active-widgets.php プロジェクト: tqsq2005/dotplant2
    ?>
                    <?php 
    foreach ($models as $activeWidget) {
        ?>
                        <?php 
        if ($activeWidget->part_id !== intval($partsRow['id'])) {
            continue;
        }
        ?>
                        <li class="well well-sm well-light" activewidget="<?php 
        echo $activeWidget->id;
        ?>
">
                            <div class="pull-right btn-group">
                                <?php 
        echo Html::a(Icon::show('cogs') . Yii::t('app', 'Configure'), ['/DefaultTheme/backend-configuration/configure-json', 'id' => $activeWidget->id, 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success btn-xs configure-active-widget']);
        ?>
                                <?php 
        echo Html::a(Icon::show('trash-o'), ['delete-active-widget', 'id' => $activeWidget->id], ['class' => 'btn btn-danger btn-xs', 'data-action' => 'post']);
        ?>
                            </div>
                            <?php 
        echo $activeWidget->widget->name;
        ?>
                            <?php 
        $matchedCount++;
        ?>
                        </li>
                    <?php 
    }
    ?>
コード例 #11
0
ファイル: index.php プロジェクト: tqsq2005/dotplant2
<?php

use app\backend\components\Helper;
use app\backend\widgets\RemoveAllButton;
use kartik\dynagrid\DynaGrid;
use kartik\grid\CheckboxColumn;
use kartik\icons\Icon;
use yii\helpers\Html;
/**
 * @var yii\web\View $this
 * @var yii\data\ActiveDataProvider $dataProvider
 * @var \app\models\Form $searchModel
 */
$this->title = Yii::t('app', 'Thumbnail size');
$this->params['breadcrumbs'][] = $this->title;
?>

<?php 
$this->beginBlock('add-button');
echo Html::a(Icon::show('plus') . ' ' . Yii::t('app', 'Add'), ['edit', 'returnUrl' => Helper::getReturnUrl()], ['class' => 'btn btn-success']);
echo RemoveAllButton::widget(['url' => '/image/backend-thumbnail-size/remove-all', 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']]);
$this->endBlock();
?>

<?php 
echo DynaGrid::widget(['options' => ['id' => 'form-grid'], 'columns' => [['class' => CheckboxColumn::className(), 'options' => ['width' => '10px']], 'id', 'width', 'height', 'quality', ['class' => 'app\\backend\\components\\ActionColumn', 'buttons' => [['url' => 'edit', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')], ['url' => 'delete', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => Yii::t('app', 'Delete')]], 'options' => ['width' => '85px']]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => '<h3 class="panel-title">' . $this->title . '</h3>', 'after' => $this->blocks['add-button']]]]);
コード例 #12
0
ファイル: page-form.php プロジェクト: kronos777/dotplant2
if (Yii::$app->getModule('elfinder')) {
    echo \DotPlant\ElFinder\widgets\ElfinderFileInput::widget(['url' => Url::toRoute(['addImage', 'objId' => $object->id, 'objModelId' => $model->id])]);
}
?>
            </div>

            <?php 
echo \app\modules\image\widgets\ImageDropzone::widget(['name' => 'file', 'url' => ['upload'], 'removeUrl' => ['remove'], 'uploadDir' => '/theme/resources/product-images', 'sortable' => true, 'sortableOptions' => ['items' => '.dz-image-preview'], 'objectId' => $object->id, 'modelId' => $model->id, 'htmlOptions' => ['class' => 'table table-striped files', 'id' => 'previews'], 'options' => ['clickable' => ".fileinput-button"]]);
?>

            <?php 
BackendWidget::end();
?>
        </article>
        <article class="<?php 
echo Helper::getBackendGridClass('page', PageModule::BACKEND_PAGE_GRID, 2);
?>
">
            <?php 
BackendWidget::begin(['title' => Yii::t('app', 'SEO'), 'icon' => 'search', 'footer' => $this->blocks['submit']]);
?>

            <?php 
echo $form->field($model, 'slug', ['makeSlug' => ["#page-title", "#page-h1", "#page-breadcrumbs_label"]]);
?>
            <?php 
echo $form->field($model, 'slug_absolute')->checkbox();
?>
            <?php 
echo $form->field($model, 'subdomain');
?>
コード例 #13
0
echo $form->field($model, 'meta_keywords')->textarea();
?>

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

    <?php 
echo \app\properties\PropertiesWidget::widget(['model' => $model, 'form' => $form]);
?>

</article>


<article class="<?php 
echo Helper::getBackendGridClass('shop', ShopModule::BACKEND_PRODUCT_GRID, 2);
?>
">
    <?php 
BackendWidget::begin(['title' => Yii::t('app', 'Categories'), 'icon' => 'tree', 'footer' => $this->blocks['submit']]);
?>

    <?php 
echo \app\backend\widgets\JSSelectableTree::widget(['flagFieldName' => 'main_category_id', 'fieldName' => 'categories', 'model' => $model, 'selectedItems' => $selected, 'selectOptions' => ['class' => 'form-control'], 'selectLabel' => Yii::t('app', 'Main category'), 'routes' => ['getTree' => ['getCatTree']], 'stateKey' => $model->id . $model->isNewRecord ? time() : '']);
?>
    <br />

    <?php 
BackendWidget::end();
?>
コード例 #14
0
ファイル: view-submission.php プロジェクト: Razzwan/dotplant2
$formObject = Object::getForClass(Form::className());
$groups = PropertyGroup::getForModel($formObject->id, $submission->form_id);
$submission->getPropertyGroups(true);
?>

<?php 
echo app\widgets\Alert::widget(['id' => 'alert']);
?>

<?php 
$form = ActiveForm::begin(['id' => 'form-form', 'type' => ActiveForm::TYPE_HORIZONTAL]);
?>

<?php 
$this->beginBlock('submit');
echo \app\backend\components\Helper::saveButtons($submission);
$this->endBlock();
?>
<section id="widget-grid">
    <div class="row">

        <article class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
            <?php 
BackendWidget::begin(['title' => Yii::t('app', 'Submission details'), 'icon' => 'cogs', 'footer' => $this->blocks['submit']]);
?>

            <?php 
echo $form->field($submission, 'date_received');
?>
            <?php 
echo $form->field($submission, 'ip');
コード例 #15
0
ファイル: index.php プロジェクト: tqsq2005/dotplant2
 */
use app\backend\widgets\BackendWidget;
use app\backend\widgets\flushcache\FlushCacheButton;
use kartik\helpers\Html;
use yii\bootstrap\Tabs;
$this->title = Yii::t('app', 'Rbac');
$this->params['breadcrumbs'][] = $this->title;
$this->beginBlock('buttonGroup');
?>
<div class="btn-toolbar" role="toolbar">
    <div class="btn-group">
        <?php 
echo Html::a(Yii::t('app', 'Create Permission'), ['create', 'returnUrl' => \app\backend\components\Helper::getReturnUrl(), 'type' => \yii\rbac\Item::TYPE_PERMISSION], ['class' => 'btn btn-success']);
?>
        <?php 
echo Html::a(Yii::t('app', 'Create Role'), ['create', 'returnUrl' => \app\backend\components\Helper::getReturnUrl(), 'type' => \yii\rbac\Item::TYPE_ROLE], ['class' => 'btn btn-success']);
?>
    </div>
    <?php 
echo Html::button(Yii::t('app', 'Delete selected'), ['class' => 'btn btn-danger', 'id' => 'deleteItems']);
?>
</div>
<?php 
$this->endBlock();
?>
<div class="user-index">
    <?php 
BackendWidget::begin(['icon' => 'lock', 'title' => $this->title, 'footer' => $this->blocks['buttonGroup']]);
?>
        <?php 
echo Tabs::widget(['items' => [['label' => Yii::t('app', 'Permissions'), 'content' => $this->render('_rbacGrid', ['data' => $permissions, 'isRules' => $isRules, 'id' => 'operations']), 'active' => true], ['label' => Yii::t('app', 'Roles'), 'content' => $this->render('_rbacGrid', ['data' => $roles, 'isRules' => $isRules, 'id' => 'roles'])]]]);
コード例 #16
0
ファイル: index.php プロジェクト: tqsq2005/dotplant2
<?php

use yii\helpers\Html;
use kartik\dynagrid\DynaGrid;
use app\backend\components\ActionColumn;
use kartik\icons\Icon;
/* @var $this yii\web\View */
/* @var $searchModel app\components\SearchModel */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Categories groups');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="category-group-index">

    <?php 
echo DynaGrid::widget(['options' => ['id' => 'order-statuses-grid'], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => Html::tag('h3', $this->title, ['class' => 'panel-title']), 'after' => Html::a(Icon::show('plus') . Yii::t('app', 'Add'), ['edit', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success'])]], 'columns' => ['id', 'name', ['class' => ActionColumn::className()]]]);
?>

</div>
コード例 #17
0
ファイル: index.php プロジェクト: heartshare/dotplant2
<?php

use yii\helpers\Json;
use kartik\dynagrid\DynaGrid;
/**
 * @var yii\web\View $this
 * @var yii\data\ActiveDataProvider $dataProvider
 * @var \app\models\Form $searchModel
 */
$this->title = Yii::t('app', 'Extensions');
$this->params['breadcrumbs'][] = $this->title;
$this->beginBlock('add-button');
?>
    <?php 
echo \yii\helpers\Html::a(\kartik\icons\Icon::show('plus') . ' ' . Yii::t('app', 'Install new extension'), ['/core/backend-extensions/explore', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']);
?>

<?php 
$this->endBlock();
?>

<?php 
echo DynaGrid::widget(['options' => ['id' => 'extensions-grid'], 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], 'id', 'name', 'type.name', 'force_version', 'current_package_version_timestamp', ['class' => 'app\\backend\\components\\ActionColumn', 'urlCreator' => function ($action, $model, $key, $index) {
    $params = ['/core/backend-extensions/' . $action, 'name' => $model->name];
    $params['returnUrl'] = app\backend\components\Helper::getReturnUrl();
    return yii\helpers\Url::toRoute($params);
}, 'buttons' => [['url' => 'show-package', 'icon' => 'eye', 'class' => 'btn-info btn-show-package', 'label' => Yii::t('app', 'View')]], 'options' => ['width' => '125px']]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => '<h3 class="panel-title">' . $this->title . '</h3>', 'after' => $this->blocks['add-button']]]]);
?>

<?php 
$extensionInformation = Json::encode(Yii::t('app', 'Extension information'));
コード例 #18
0
ファイル: redirect.php プロジェクト: tqsq2005/dotplant2
$this->params['breadcrumbs'][] = ['label' => 'SEO', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="meta-tags-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a(Yii::t('app', 'Create Redirect'), ['create-redirect', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']);
?>
        <?php 
echo Html::a(Yii::t('app', 'Create Redirects'), ['create-redirects', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-warning']);
?>
        <?php 
echo Html::button(Yii::t('app', 'Delete selected'), ['class' => 'btn btn-danger', 'id' => 'deleteRedirects']);
?>
    </p>

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

    <p>
        <?php 
echo Html::button(Yii::t('app', 'Generate Redirect File'), ['class' => 'btn btn-danger', 'id' => 'generateButton']);
?>
        <?php 
コード例 #19
0
ファイル: meta.php プロジェクト: tqsq2005/dotplant2
 * @var \app\modules\seo\models\Meta $searchModel
 */
$this->title = Yii::t('app', 'Meta tags');
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'SEO'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="meta-tags-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a(Yii::t('app', 'Create Meta tag'), ['create-meta', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']);
?>
        <?php 
echo Html::button(Yii::t('app', 'Delete selected'), ['class' => 'btn btn-danger', 'id' => 'deleteTasks']);
?>
        <?php 
echo Yii::$app->user->can('cache manage') ? Html::button(Yii::t('app', 'Delete Meta Cache') . ' <span class="fa"></span>', ['class' => 'btn btn-warning pull-right', 'id' => 'flushCache']) : '';
?>
    </p>

    <?php 
echo $this->render('_metaGrid', ['dataProvider' => $dataProvider, 'searchModel' => $searchModel, 'id' => 'meta-tags']);
?>

</div>
コード例 #20
0
ファイル: index.php プロジェクト: tqsq2005/dotplant2
<?php

use app\backend\components\ActionColumn;
use kartik\dynagrid\DynaGrid;
use kartik\helpers\Html;
use kartik\icons\Icon;
/**
 * @var $this yii\web\View
 * @var $searchModel app\components\SearchModel
 * @var $dataProvider yii\data\ActiveDataProvider
 */
$this->title = Yii::t('app', 'Warehouse');
$this->params['breadcrumbs'][] = $this->title;
?>

<div class="order-status-index">
    <?php 
echo DynaGrid::widget(['options' => ['id' => 'order-statuses-grid'], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => Html::tag('h3', $this->title, ['class' => 'panel-title']), 'after' => Html::a(Icon::show('plus') . Yii::t('app', 'Add'), ['edit', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']) . \app\backend\widgets\RemoveAllButton::widget(['url' => '/backend/order-status/remove-all', 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']])]], 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], 'id', 'name', 'address', ['class' => ActionColumn::className()]]]);
?>
</div>
コード例 #21
0
ファイル: index.php プロジェクト: tqsq2005/dotplant2
/**
 * @var yii\web\View $this
 * @var yii\data\ActiveDataProvider $dataProvider
 * @var \app\models\Form $searchModel
 */
use kartik\dynagrid\DynaGrid;
use kartik\helpers\Html;
$this->title = Yii::t('app', 'Currencies');
$this->params['breadcrumbs'][] = $this->title;
?>

<?php 
echo app\widgets\Alert::widget(['id' => 'alert']);
$this->beginBlock('add-button');
echo \yii\helpers\Html::a(\kartik\icons\Icon::show('plus') . ' ' . Yii::t('app', 'Add'), ['edit', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']);
echo \app\backend\widgets\RemoveAllButton::widget(['url' => 'remove-all', 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']]);
$this->endBlock();
?>



<div class="row">
    <div class="col-md-12">
        <?php 
echo DynaGrid::widget(['options' => ['id' => 'currencies-grid'], 'columns' => [['class' => \app\backend\columns\CheckboxColumn::className()], 'id', 'name', 'iso_code', 'convert_nominal', 'convert_rate', ['attribute' => 'currency_rate_provider_id', 'class' => \kartik\grid\EditableColumn::className(), 'editableOptions' => ['data' => [0 => '-'] + \app\components\Helper::getModelMap(\app\modules\shop\models\CurrencyRateProvider::className(), 'id', 'name'), 'inputType' => 'dropDownList', 'placement' => 'left', 'formOptions' => ['action' => 'update-editable']], 'filter' => \app\components\Helper::getModelMap(\app\modules\shop\models\CurrencyRateProvider::className(), 'id', 'name'), 'format' => 'raw', 'value' => function ($model, $key, $index, $column) {
    if ($model === null || $model->rateProvider === null) {
        return null;
    }
    return Html::tag('div', $model->rateProvider->name, ['class' => $model->rateProvider->name]);
}], ['class' => \app\backend\components\ActionColumn::className()]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => $this->render('_tabs', ['currencies' => true]), 'after' => $this->blocks['add-button']]]]);
コード例 #22
0
ファイル: index.php プロジェクト: lzpfmh/dotplant2
<?php

use app\backend\components\ActionColumn;
use kartik\dynagrid\DynaGrid;
use kartik\icons\Icon;
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Wysiwygs');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wysiwyg-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <?php 
echo DynaGrid::widget(['options' => ['id' => 'backend-wysiwyg-grid'], 'columns' => ['id', 'name', 'class_name', ['class' => ActionColumn::className(), 'options' => ['width' => '95px'], 'buttons' => [['url' => 'update', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')], ['url' => 'delete', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => Yii::t('app', 'Delete')]]]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => Html::tag('h3', $this->title, ['class' => 'panel-title']), 'after' => Html::a(Icon::show('plus') . Yii::t('app', 'Add'), ['/core/backend-wysiwyg/create', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success'])]]]);
?>

</div>
コード例 #23
0
ファイル: edit-property.php プロジェクト: tqsq2005/dotplant2
    <?php 
    echo Html::submitButton(Icon::show('save') . Yii::t('app', 'Save & Go next'), ['class' => 'btn btn-success', 'name' => 'action', 'value' => 'next']);
}
?>

<?php 
echo Html::submitButton(Icon::show('save') . Yii::t('app', 'Save & Go back'), ['class' => 'btn btn-warning', 'name' => 'action', 'value' => 'back']);
?>

<?php 
echo Html::submitButton(Icon::show('save') . Yii::t('app', 'Save'), ['class' => 'btn btn-primary', 'name' => 'action', 'value' => 'save']);
$this->endBlock('submit');
$this->beginBlock('add-button');
?>
        <a href="<?php 
echo Url::to(['/backend/properties/edit-static-value', 'property_id' => $model->id, 'returnUrl' => \app\backend\components\Helper::getReturnUrl()]);
?>
" class="btn btn-success">
            <?php 
echo Icon::show('plus');
?>
            <?php 
echo Yii::t('app', 'Add value');
?>
        </a>
<?php 
$this->endBlock();
?>

<section id="widget-grid">
    <div class="row">
コード例 #24
0
ファイル: _widgets.php プロジェクト: tqsq2005/dotplant2
<?php

use yii\helpers\Html;
use yii\widgets\Pjax;
/** @var \yii\data\ActiveDataProvider $widgetsDataProvider */
/** @var \app\extensions\DefaultTheme\models\ThemeWidgets  $widgetsSearchModel */
$this->beginBlock('bottom-buttons-parts');
echo \yii\helpers\Html::a(\kartik\icons\Icon::show('plus') . ' ' . Yii::t('app', 'Add'), ['/DefaultTheme/backend-configuration/edit-widget', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']);
$this->endBlock();
?>

<?php 
Pjax::begin(['enablePushState' => false]);
echo \kartik\dynagrid\DynaGrid::widget(['options' => ['id' => 'theme-widgets-grid'], 'columns' => ['id', 'name', 'widget', ['class' => \app\backend\columns\BooleanStatus::className(), 'attribute' => 'is_cacheable', 'header' => Yii::t('app', 'Is cacheable')], 'cache_lifetime', ['class' => \app\backend\columns\BooleanStatus::className(), 'attribute' => 'cache_vary_by_session', 'header' => Yii::t('app', 'Cache vary by session'), 'true_value' => Yii::t('app', 'Yes'), 'false_value' => Yii::t('app', 'No')], 'cache_tags', ['class' => app\backend\components\ActionColumn::className(), 'buttons' => ['edit-part' => ['url' => 'edit-widget', 'icon' => 'pencil', 'class' => 'btn-default', 'label' => Yii::t('app', 'Edit')], 'delete-part' => ['options' => ['data-action' => 'delete'], 'url' => 'delete-widget', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => Yii::t('app', 'Delete')]]]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $widgetsDataProvider, 'filterModel' => $widgetsSearchModel, 'hover' => true, 'panel' => ['heading' => Html::tag('h3', Yii::t('app', 'All available theme widgets'), ['class' => 'panel-title']), 'after' => $this->blocks['bottom-buttons-parts']]]]);
Pjax::end();
コード例 #25
0
<?php

/**
 * @var \yii\web\View $this
 * @var \yii\data\ActiveDataProvider $dataProvider
 * @var \app\components\SearchModel $searchModel
 */
use yii\helpers\Html;
$this->title = Yii::t('app', 'Customers');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="customers-index">
<?php 
echo \kartik\dynagrid\DynaGrid::widget(['options' => ['id' => 'customers-index-grid'], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => Html::tag('h3', $this->title, ['class' => 'panel-title']), 'after' => Html::a(\kartik\icons\Icon::show('plus') . Yii::t('app', 'Add'), ['create', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success'])], 'rowOptions' => function ($model, $key, $index, $grid) {
    /** @var \app\modules\shop\models\Customer $model */
    if (intval($model->user_id) <= 0) {
        return ['class' => 'warning'];
    }
    return [];
}], 'columns' => ['id', ['attribute' => 'orders', 'label' => Yii::t('app', 'Orders count'), 'value' => function ($model, $key, $index, $column) {
    /** @var \app\modules\shop\models\Customer $model */
    return count($model->orders);
}], ['attribute' => 'user', 'label' => Yii::t('app', 'User'), 'value' => function ($model, $key, $index, $column) {
    /** @var \app\modules\shop\models\Customer $model */
    /** @var \app\modules\user\models\User $user */
    $user = $model->user;
    return null === $user ? Yii::t('app', 'Guest') : $user->username;
}], 'first_name', 'middle_name', 'last_name', 'email', 'phone', ['class' => 'app\\backend\\components\\ActionColumn', 'buttons' => function ($model, $key, $index, $parent) {
    $result = [['url' => 'edit', 'icon' => 'eye', 'class' => 'btn-info', 'label' => Yii::t('app', 'View')]];
    return $result;
}]]]);
コード例 #26
0
ファイル: index.php プロジェクト: lzpfmh/dotplant2
echo Icon::show('plus');
?>
    <?php 
echo Yii::t('app', 'Add');
?>
</a>
<?php 
echo \app\backend\widgets\PublishSwitchButtons::widget(['url' => Url::toRoute(['publish-switch']), 'gridSelector' => '.grid-view']);
echo \app\backend\widgets\RemoveAllButton::widget(['url' => Url::toRoute(['remove-all', 'parent_id' => $parent_id]), 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']]);
$this->endBlock();
?>

<div class="row">
    <div class="col-md-4">
        <?php 
echo TreeWidget::widget(['treeDataRoute' => ['getTree'], 'doubleClickAction' => ContextMenuHelper::actionUrl(['index', 'returnUrl' => Helper::getReturnUrl()], ['parent_id' => 'id']), 'contextMenuItems' => ['show' => ['label' => 'Show products in category', 'icon' => 'fa fa-folder-open', 'action' => ContextMenuHelper::actionUrl(['index'], ['parent_id' => 'id'])], 'createProduct' => ['label' => 'Create product in this category', 'icon' => 'fa fa-plus-circle', 'action' => ContextMenuHelper::actionUrl(['edit', 'returnUrl' => Helper::getReturnUrl()], ['parent_id' => 'id'])], 'edit' => ['label' => 'Edit category', 'icon' => 'fa fa-pencil', 'action' => ContextMenuHelper::actionUrl(['/shop/backend-category/edit', 'returnUrl' => Helper::getReturnUrl()])], 'create' => ['label' => 'Create category', 'icon' => 'fa fa-plus-circle', 'action' => ContextMenuHelper::actionUrl(['/shop/backend-category/edit', 'returnUrl' => Helper::getReturnUrl()], ['parent_id' => 'id'])], 'delete' => ['label' => 'Delete', 'icon' => 'fa fa-trash-o', 'action' => new \yii\web\JsExpression("function(node) {\n                            jQuery('#delete-category-confirmation')\n                                .attr('data-url', '/backend/category/delete?id=' + jQuery(node.reference[0]).data('id'))\n                                .attr('data-items', '')\n                                .modal('show');\n                            return true;\n                        }")]]]);
?>
    </div>
    <div class="col-md-8" id="jstree-more">
        <?php 
echo DynaGrid::widget(['options' => ['id' => 'Product-grid'], 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'id'], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'name'], 'slug', ['class' => \kartik\grid\EditableColumn::className(), 'attribute' => 'active', 'editableOptions' => ['data' => [0 => Yii::t('app', 'Inactive'), 1 => Yii::t('app', 'Active')], 'inputType' => 'dropDownList', 'placement' => 'left', 'formOptions' => ['action' => 'update-editable']], 'filter' => [0 => Yii::t('app', 'Inactive'), 1 => Yii::t('app', 'Active')], 'format' => 'raw', 'value' => function (Product $model) {
    if ($model === null || $model->active === null) {
        return null;
    }
    if ($model->active === 1) {
        $label_class = 'label-success';
        $value = 'Active';
    } else {
        $value = 'Inactive';
        $label_class = 'label-default';
    }
コード例 #27
0
ファイル: category-form.php プロジェクト: tqsq2005/dotplant2
    echo \DotPlant\ElFinder\widgets\ElfinderFileInput::widget(['url' => Url::toRoute(['addImage', 'objId' => $object->id, 'objModelId' => $model->id])]);
}
?>
            </div>

            <?php 
echo \app\modules\image\widgets\ImageDropzone::widget(['name' => 'file', 'url' => ['/shop/backend-product/upload'], 'removeUrl' => ['/shop/backend-product/remove'], 'uploadDir' => '/theme/resources/product-images', 'sortable' => true, 'sortableOptions' => ['items' => '.dz-image-preview'], 'objectId' => $object->id, 'modelId' => $model->id, 'htmlOptions' => ['class' => 'table table-striped files', 'id' => 'previews'], 'options' => ['clickable' => ".fileinput-button"]]);
?>

            <?php 
BackendWidget::end();
?>
        </article>

        <article class="<?php 
echo Helper::getBackendGridClass('shop', ShopModule::BACKEND_CATEGORY_GRID, 2);
?>
">
            <?php 
BackendWidget::begin(['title' => Yii::t('app', 'SEO'), 'icon' => 'cogs', 'footer' => $this->blocks['submit']]);
?>

            <?php 
echo $form->field($model, 'slug', ['makeSlug' => ["#category-name", "#category-title", "#category-h1", "#category-breadcrumbs_label"]]);
?>

            <?php 
echo $form->field($model, 'h1', ['copyFrom' => ["#category-name", "#category-title", "#category-breadcrumbs_label"]]);
?>

            <?php 
コード例 #28
0
ファイル: _redirectGrid.php プロジェクト: tqsq2005/dotplant2
<?php

use yii\grid\GridView;
use yii\helpers\Url;
use yii\widgets\Pjax;
/**
 * @var $id
 * @var yii\web\View $this
 * @var yii\data\ActiveDataProvider $dataProvider
 * @var app\modules\seo\models\Redirect $searchModel
 */
?>

<?php 
Pjax::begin();
?>

<?php 
echo GridView::widget(['id' => $id, 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'layout' => "{items}\n{summary}\n{pager}", 'columns' => [['class' => 'yii\\grid\\CheckboxColumn', 'options' => ['width' => '10px']], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'id', 'options' => ['width' => '60px']], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'type', 'filter' => \app\modules\seo\models\Redirect::getTypes()], 'from', 'to', ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'active', 'filter' => [0 => 'false', 1 => 'true']], ['class' => 'app\\backend\\components\\ActionColumn', 'urlCreator' => function ($action, $model, $key, $index) {
    $params = is_array($key) ? $key : ['id' => (string) $key];
    $action .= '-redirect';
    $params[0] = $this->context->id ? $this->context->id . '/' . $action : $action;
    $params['returnUrl'] = \app\backend\components\Helper::getReturnUrl();
    return Url::toRoute($params);
}, 'options' => ['width' => '95px'], 'buttons' => [['url' => 'update', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')], ['url' => 'delete', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => Yii::t('app', 'Delete')]]]], 'tableOptions' => ['class' => 'table table-striped table-condensed table-hover']]);
?>

<?php 
Pjax::end();
コード例 #29
0
ファイル: index.php プロジェクト: lzpfmh/dotplant2
echo TreeWidget::widget(['treeDataRoute' => ['getTree', 'selected_id' => $parent_id], 'changeParentAction' => 'move', 'reorderAction' => 'reorder', 'doubleClickAction' => ContextMenuHelper::actionUrl(['/core/backend-chunk-group/update', 'returnUrl' => Helper::getReturnUrl()]), 'contextMenuItems' => ['edit' => ['label' => 'Edit', 'icon' => 'fa fa-pencil', 'action' => ContextMenuHelper::actionUrl(['/core/backend-chunk-group/update', 'returnUrl' => Helper::getReturnUrl()])], 'open' => ['label' => 'Open', 'icon' => 'fa fa-folder-open', 'action' => ContextMenuHelper::actionUrl(['index'], ['group_id' => 'id'])], 'create' => ['label' => 'Create', 'icon' => 'fa fa-plus-circle', 'action' => ContextMenuHelper::actionUrl(['/core/backend-chunk-group/create', 'returnUrl' => Helper::getReturnUrl()], ['parent_id' => 'id', 'returnUrl' => Helper::getReturnUrl()])], 'delete' => ['label' => 'Delete', 'icon' => 'fa fa-trash-o', 'action' => new \yii\web\JsExpression("function(node) {\n                                jQuery('#confirm_delete')\n                                    .modal('toggle');\n\n                                jQuery('#confirm_delete form').attr('action', '/core/backend-chunk-group/delete?id=' + jQuery(node.reference[0]).data('id'))\n                                return true;\n                            }")]]]);
?>
    </div>
    <div class="col-md-8">
        <?php 
echo DynaGrid::widget(['options' => ['id' => 'backend-chunk-grid'], 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'id'], 'name', 'key', ['class' => BooleanColumn::className(), 'attribute' => 'preload'], ['attribute' => 'group', 'value' => 'group.name'], ['class' => ActionColumn::className(), 'options' => ['width' => '95px'], 'buttons' => [['url' => 'edit', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')], ['url' => 'delete', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => Yii::t('app', 'Delete')]]]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => Html::tag('h3', $this->title, ['class' => 'panel-title']), 'after' => Html::a(Icon::show('plus') . Yii::t('app', 'Add'), ['/core/backend-chunk/edit', 'group_id' => $parent_id, 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']) . '&nbsp' . Html::a(Yii::t('app', 'Show all'), ['/core/backend-chunk/index'], ['class' => 'btn btn-warning']) . \app\backend\widgets\RemoveAllButton::widget(['url' => '/core/backend-chunk/remove-all', 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']])]]]);
?>
    </div>
</div>

<?php 
Modal::begin(['id' => 'confirm_delete', 'header' => Yii::t('app', 'Confirm delete item')]);
?>

<?php 
$form = ActiveForm::begin(['options' => ['action' => Url::to(['/core/backend-chunk-group/delete', 'returnUrl' => Helper::getReturnUrl()])]]);
$contentBlockModel = new ContentBlockGroup();
?>

<?php 
echo $form->field($contentBlockModel, 'id')->hiddenInput()->label(false);
echo $form->field($contentBlockModel, 'deleteMethod')->dropDownList([ContentBlockGroup::DELETE_METHOD_PARENT_ROOT => Yii::t('app', 'Move child chunks to root group'), ContentBlockGroup::DELETE_METHOD_ALL => Yii::t('app', 'Delete all child chunks')]);
?>

<?php 
echo Html::submitButton(Yii::t('app', 'Delete'), ['class' => ['btn btn-danger']]);
?>


<?php 
ActiveForm::end();
コード例 #30
0
ファイル: index.php プロジェクト: tqsq2005/dotplant2
<?php 
echo app\widgets\Alert::widget(['id' => 'alert']);
?>

<div class="row">
    <div class="col-md-4">
        <?php 
echo TreeWidget::widget(['treeDataRoute' => ['getTree', 'selected_id' => $parent_id], 'changeParentAction' => 'move', 'reorderAction' => 'reorder', 'doubleClickAction' => ContextMenuHelper::actionUrl(['edit', 'returnUrl' => Helper::getReturnUrl()]), 'contextMenuItems' => ['edit' => ['label' => 'Edit', 'icon' => 'fa fa-pencil', 'action' => ContextMenuHelper::actionUrl(['edit', 'returnUrl' => Helper::getReturnUrl()])], 'open' => ['label' => 'Open', 'icon' => 'fa fa-folder-open', 'action' => ContextMenuHelper::actionUrl(['index'], ['parent_id' => 'id'])], 'create' => ['label' => 'Create', 'icon' => 'fa fa-plus-circle', 'action' => ContextMenuHelper::actionUrl(['edit', 'returnUrl' => Helper::getReturnUrl()], ['parent_id' => 'id'])], 'delete' => ['label' => 'Delete', 'icon' => 'fa fa-trash-o', 'action' => new \yii\web\JsExpression("function(node) {\n                                jQuery('#delete-category-confirmation')\n                                    .attr('data-url', '/shop/backend-category/delete?id=' + jQuery(node.reference[0]).data('id'))\n                                    .attr('data-items', '')\n                                    .modal('show');\n                                return true;\n                            }")]]]);
?>
    </div>
    <div class="col-md-8" id="jstree-more">
        <?php 
$this->beginBlock('add-button');
?>
                <a href="<?php 
echo Url::to(['edit', 'parent_id' => is_object($model) ? $model->id : 0, 'returnUrl' => \app\backend\components\Helper::getReturnUrl()]);
?>
" class="btn btn-success">
                    <?php 
echo Icon::show('plus');
?>
                    <?php 
echo Yii::t('app', 'Add');
?>
                </a>
                <?php 
echo \app\backend\widgets\RemoveAllButton::widget(['url' => Url::to(['remove-all', 'parent_id' => is_object($model) ? $model->id : 0]), 'gridSelector' => '.grid-view', 'modalSelector' => '#delete-category-confirmation', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']]);
?>
        <?php 
$this->endBlock();
?>