Exemple #1
1
 */
$columns = isset($layout->dashboard->options['columns']) ? $layout->dashboard->options['columns'] : 1;
if (!in_array($columns, array(1, 2, 3, 4, 6))) {
    $columns = 1;
}
$span = round(12 / $columns);
$regionPanels = $layout->regionPanels($layout->dashboard->getDashboardPanels()->all(), 'update');
if (isset($regionPanels['none'])) {
    $overflow = $regionPanels['none'];
    unset($regionPanels['none']);
}
echo '<hr>';
echo '<div class="row">';
foreach ($regionPanels as $region => $items) {
    echo '<div class="col-md-' . $span . '">';
    // sortable widget to enable drag-and-drop
    echo Sortable::widget(['id' => 'dashboard-region-' . $region, 'connected' => true, 'items' => $items, 'pluginEvents' => ['sortupdate' => 'dashboardPanelSort']]);
    // hidden element to store the sort order
    echo Html::hiddenInput('DashboardPanelSort[' . $region . ']', implode(',', ArrayHelper::map($items, 'options.id', 'options.id')), ['id' => 'input-dashboard-region-' . $region]);
    // create dashboard panel button
    echo '<div class="text-center">';
    echo Html::a(Yii::t('dashboard', 'Create Dashboard Panel'), ['dashboard-panel/create', 'DashboardPanel' => ['dashboard_id' => $layout->dashboard->id, 'region' => $region, 'sort' => count($items), 'enabled' => 1]], ['class' => 'btn btn-default btn-sm']);
    echo '</div>';
    echo '</div>';
}
echo '</div>';
if (isset($overflow)) {
    echo '<hr>';
    echo Html::hiddenInput('DashboardPanelSort[overflow]', implode(',', ArrayHelper::map($overflow, 'options.id', 'options.id')), ['id' => 'input-dashboard-region-overflow']);
    echo Sortable::widget(['id' => 'dashboard-region-overflow', 'connected' => true, 'items' => $overflow, 'pluginEvents' => ['sortupdate' => 'dashboardPanelSort']]);
}
Exemple #2
1
<?php 
echo Alert::widget();
?>

    <div class="category-index">

        <p>
            <?php 
echo Html::a('Новая категория', ['new'], ['class' => 'btn btn-success', 'data-pjax' => 'false']);
?>
        </p>

            <?php 
echo Sortable::widget(['items' => $list, 'options' => ['class' => 'category-sortable'], 'pluginEvents' => ['sortupdate' => 'function(e, ui) {
                                                    var item = $(ui.item),
                                                    data = $(".category-sortable").find("li").map(function (i, n) {
                                                        return $(n).data("icat");
                                                    }).get().join(",");
                                                    $.ajax({
                                                            url: "' . Yii::$app->urlManager->createUrl(["category/sort-category"]) . '",
                                                            type: "post",
                                                            data: {"sort": data},
                                                            cache: false,
                                                            success: function(data) {}
                                                    });}']]);
?>

    </div>

<?php 
Pjax::end();
Exemple #3
0
 /**
  * Initializes the widget
  */
 public function init()
 {
     parent::init();
     $this->initItems();
     $this->sortableOptions['options']['id'] = $this->options['id'] . '-sortable';
     $this->registerAssets();
     $input = $this->hideInput ? 'hiddenInput' : 'textInput';
     echo Sortable::widget($this->sortableOptions) . PHP_EOL . $this->getInput($input);
 }
Exemple #4
0
 public function run()
 {
     echo Html::activeHiddenInput($this->model, $this->attribute, $this->options);
     $groups_id = $this->attribute;
     $items = array();
     if ($this->model->{$groups_id}) {
         foreach (GlImgs::find()->where(['groups_id' => $this->model->{$groups_id}])->orderBy(['seq' => SORT_ASC])->all() as $i => $image) {
             $items[] = ['content' => Html::tag('div', Html::button(null, ['class' => 'btn btn-default btn-xs glyphicon glyphicon-remove', 'onclick' => 'removeUploadImage("' . $this->pluginOptions['url'] . '", ' . $image->id . ', "' . $image->basename_src . '", ' . $image->groups_id . ')']), ['style' => 'background:url("' . $image->img_small . '") 50% 50% no-repeat;', 'class' => 'upload-img', 'data-imgs-id' => $image->id, 'id' => 'upload-img-' . $image->id])];
         }
     }
     $items[] = ['content' => '<span class="glyphicon glyphicon-plus"></span><br>Добавить фото' . Html::fileInput(null, null, ['multiple' => true, 'data-url' => $this->pluginOptions['url'], 'data-type' => $this->pluginOptions['type'], 'data-input-id' => strtolower($this->model->formName()) . '-' . $groups_id, 'onchange' => 'prepareUpload($(this))', 'id' => 'js-upload-action']), 'disabled' => true, 'options' => ['class' => 'js-upload', 'onclick' => 'openFileDiaolg()']];
     echo Html::beginTag('div', ['class' => 'upload-gallery-content']);
     echo Sortable::widget(['type' => 'grid', 'items' => $items, 'pluginEvents' => ['sortupdate' => 'function(data) {reSortGallery("' . $this->pluginOptions['url'] . '")}'], 'options' => ['class' => 'js-upload-gallery']]);
     echo Html::tag('div', 'Основное изображение', ['class' => 'js-upload-image-default']);
     echo Html::endTag('div');
     /*echo Html::tag('div', '<small>Вы можете прикрепить не более 5 фотографий</small>', [
           'class' => 'text-muted',
       ]);*/
     $view = $this->view;
     UploadGalleryAsset::register($view);
 }
<?php

use yii\helpers\Html;
use kartik\sortable\Sortable;
use backend\widgets\gallery\Gallery;
/** @var $group */
/** @var $gallery_groups_id */
/** @var $gallery_images_id */
if ($gallery_groups_id) {
    $images = array();
    if ($group) {
        $images = (new Gallery())->getImages($gallery_groups_id);
    } elseif ($gallery_images_id) {
        $images[0] = (new Gallery())->getImage($gallery_images_id);
    }
    foreach ($images as $image) {
        $items[] = ['content' => Html::tag('div', Html::button(null, ['class' => 'btn btn-default btn-xs glyphicon glyphicon-remove btn-flat btn-sm', 'onclick' => 'galleryManager.deleteImage("' . $image['id'] . '")']), ['style' => 'background:url("' . $image['small'] . '") 50% 50% no-repeat; background-size:cover;', 'class' => 'upload-image', 'data-image-id' => $image['id'], 'id' => 'upload-image-' . $image['id']])];
    }
}
$items[] = ['content' => '<span class="glyphicon glyphicon-plus"></span><br>Добавить фото' . Html::fileInput(null, null, ['multiple' => $group, 'class' => 'image-upload-action', 'id' => $this->context->id . '-image-upload-action', 'onchange' => 'galleryManager.prepareUpload($(this))']), 'disabled' => true, 'options' => ['onclick' => 'document.getElementById("' . $this->context->id . '-image-upload-action").click()']];
?>

<?php 
echo Sortable::widget(['type' => 'grid', 'items' => $items, 'options' => ['class' => 'list-gallery-manager']]);
Exemple #6
0
</div>
<div class="row">
    <div class="col-sm-12">
        <br>
<?php 
if (empty($items)) {
    ?>
        <h3><?php 
    echo Yii::t('podium/view', 'No categories have been added yet.');
    ?>
</h3>
<?php 
} else {
    ?>
        <?php 
    echo Sortable::widget(['showHandle' => true, 'handleLabel' => '<span class="btn btn-default btn-xs pull-left" style="margin-right:10px"><span class="glyphicon glyphicon-move"></span></span> ', 'items' => $items, 'pluginEvents' => ['sortupdate' => 'function(e, ui) { jQuery.post(\'' . Url::to(['sort-category']) . '\', {id:ui.item.find(\'.podium-forum\').data(\'id\'), new:ui.item.index()}).done(function(data){ jQuery(\'#podiumSortInfo\').html(data); }).fail(function(){ jQuery(\'#podiumSortInfo\').html(\'<span class="text-danger">' . Yii::t('podium/view', 'Sorry! There was some error while changing the order of the categories.') . '</span>\'); }); }']]);
}
?>
    </div>
</div><br>

<?php 
if (!empty($items)) {
    ?>
<div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="podiumModalDeleteLabel" aria-hidden="true" id="podiumModalDelete">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="podiumModalDeleteLabel"><?php 
    echo Yii::t('podium/view', 'Delete Category');
Exemple #7
0
/**
 * @var yii\web\View $this
 * @var yii\data\ActiveDataProvider $dataProvider
 * @var cornernote\dashboard\models\Dashboard $model
 * @var cornernote\dashboard\models\search\DashboardSearch $searchModel
 */
$this->title = Yii::t('dashboard', 'Dashboards');
$this->params['breadcrumbs'][] = $this->title;
?>

<div class="dashboard-index">

    <div class="clearfix">
        <p class="pull-left">
            <?php 
echo Html::a('<span class="fa fa-plus"></span> ' . Yii::t('dashboard', 'Create') . ' ' . Yii::t('dashboard', 'Dashboard'), ['create', 'Dashboard' => ['enabled' => 1, 'sort' => 0]], ['class' => 'btn btn-success']);
?>
        </p>
    </div>

    <?php 
$items = [];
foreach (Dashboard::find()->orderBySort()->all() as $dashboard) {
    $dashboardDisplay = implode(' ', [Html::a('<i class="glyphicon glyphicon-eye-open"></i>', ['dashboard/view', 'id' => $dashboard->id], ['data-toggle' => 'tooltip', 'title' => Yii::t('dashboard', 'View Dashboard')]), Html::a('<i class="glyphicon glyphicon-pencil"></i>', ['dashboard/update', 'id' => $dashboard->id], ['data-toggle' => 'tooltip', 'title' => Yii::t('dashboard', 'Update Dashboard')]), Html::a('<i class="glyphicon glyphicon-trash"></i>', ['dashboard/delete', 'id' => $dashboard->id], ['data-confirm' => Yii::t('dashboard', 'Are you sure to delete this dashboard?'), 'data-method' => 'post', 'data-toggle' => 'tooltip', 'title' => Yii::t('dashboard', 'Delete Dashboard')]), '&nbsp;&nbsp;' . Html::tag('span', $dashboard->name, ['style' => !$dashboard->enabled ? 'text-decoration:line-through' : ''])]);
    $items[] = ['options' => ['id' => 'dashboard-' . $dashboard->id, 'class' => 'dashboard'], 'content' => $dashboardDisplay];
}
echo Sortable::widget(['id' => 'dashboard-sortable', 'items' => $items, 'pluginEvents' => ['sortupdate' => 'dashboardSort']]);
$this->registerJs('var dashboardSortUrl = "' . Url::to(['dashboard/sort']) . '"', View::POS_END);
?>

</div>
Exemple #8
0
        <div class="dynagrid-column-label"><?php 
echo Yii::t('kvdynagrid', 'Configure Order and Display of Grid Columns');
?>
</div>
        <div class="row">
            <div class="col-sm-5">
                <?php 
echo Sortable::widget($options1);
?>
            </div>
            <div class="col-sm-2 text-center">
                <div class="dynagrid-sortable-separator"><i class="glyphicon glyphicon-resize-horizontal"></i></div>
            </div>
            <div class="col-sm-5">
                <?php 
echo Sortable::widget($options2);
?>
            </div>
        </div>

        <?php 
echo Html::hiddenInput($model->id, 1);
?>
        <?php 
echo Html::hiddenInput('visibleKeys');
?>
        <?php 
ActiveForm::end();
?>
    </div>
<?php 
Exemple #9
0
}
$this->params['breadcrumbs'][] = $this->title;
\lenarx\admin\helpers\Backend::addControlLink(['rule' => 'BSettingsCreate', 'label' => 'Добавить поле', 'url' => ['create', 'page' => isset(Yii::$app->controller->actionParams['page']) ? Yii::$app->controller->actionParams['page'] : null]]);
?>

<div class="pages-index">

    <?php 
if ($settings) {
    ?>
    <?php 
    $form = ActiveForm::begin();
    ?>

    <?php 
    echo Sortable::widget(['items' => $settings, 'showHandle' => true, 'pluginOptions' => ['handle' => '.glyphicon-move']]);
    ?>

    <div class="form-group">
        <?php 
    echo Html::submitButton('Сохранить', ['class' => 'btn btn-sm btn-success']);
    ?>
    </div>

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

    <?php 
} else {
    ?>
Exemple #10
0
echo $selector;
?>
" class="fileapi">
  <div class="btn btn-default btn-small">
    <div class="fileapi-browse" data-fileapi="active.hide">
      <span class="glyphicon glyphicon-picture"></span>
      <span><?php 
echo Yii::t('app', 'Upload');
?>
</span>
      <input type="file" name="<?php 
echo $inputName;
?>
">
    </div>
  </div>
  <?php 
foreach ($files as $file) {
    $content = $this->render('item', ['file' => $file, 'model' => $model, 'attribute' => $attribute]);
    $content = str_replace(['<li>', '</li>'], '', $content);
    $items[]['content'] = $content;
}
?>
  <?php 
echo \kartik\sortable\Sortable::widget(['options' => ['class' => 'fileapi-files'], 'pluginOptions' => ['handle' => 'img'], 'items' => $items]);
?>
  <?php 
echo Html::activeHiddenInput($model, $attribute . '[]', ['id' => Html::getInputId($model, $attribute)]);
?>
</div>
Exemple #11
0
            </div>
            <div class="widget-body" style="display:block">
                <div class="widget-main">
                  <?php 
    Pjax::begin(['timeout' => 5000, 'id' => 'listing-images-pjax-' . $ebayAccountObj->id]);
    ?>

                  <div class="listing-images-loading" style='display:none;text-align:center;'>
                    <img src="<?php 
    echo Url::to(['/images/loading.gif']);
    ?>
" alt="" />
                  </div>
                  <div class="listing-images-wrap">
                    <?php 
    echo Sortable::widget(['type' => 'grid', 'items' => isset($sortableItems[$ebayAccountObj->id]) ? $sortableItems[$ebayAccountObj->id] : [], 'itemOptions' => ['class' => 'sortable-item'], 'options' => ['id' => 'sortable-' . $ebayAccountObj->id], 'pluginEvents' => []]);
    ?>
                  </div>
                  <?php 
    $maxImageCount = isset($sortableItems[$ebayAccountObj->id]) ? 8 - count($sortableItems[$ebayAccountObj->id]) : 8;
    ?>

                    <div style="margin-bottom:5px;<?php 
    if ($maxImageCount == 0) {
        echo "display:none;";
    }
    ?>
">

                    <p>Upload Images - <?php 
    echo $maxImageCount;