Exemplo n.º 1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getIcon()
 {
     return empty($this->icon) ? '' : FA::icon($this->icon);
 }
Exemplo n.º 2
0
/* @var $this yii\web\View */
/* @var $model yeesoft\models\MenuLink; */
/* @var $searchLinkModel yeesoft\menu\models\search\SearchMenuLink */
?>

<div class="sortable-item-content" data-linkid="<?php 
echo $model->id;
?>
">

    <?php 
if (!empty($model->image)) {
    ?>
        <div class="pull-left" style="padding: 3px 15px 0 0;">
            <?php 
    echo FA::icon($model->image)->size(FA::SIZE_LARGE)->fixedWidth();
    ?>
        </div>
    <?php 
}
?>
    <div class="pull-left">
        <b><?php 
echo $model->label;
?>
</b><br/>
        <span class="menu-link"><?php 
echo empty($model->link) ? "(no link)" : "[{$model->link}]";
?>
</span>
    </div>
Exemplo n.º 3
0
            <div class="row">
                <div class="col-sm-12 text-right">
                    <?php 
echo GridPageSize::widget(['pjaxId' => 'menu-link-grid-pjax']);
?>
                </div>
            </div>

            <?php 
Pjax::begin(['id' => 'menu-link-grid-pjax']);
?>

            <?php 
echo GridView::widget(['id' => 'menu-link-grid', 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'bulkActionOptions' => ['gridId' => 'menu-link-grid', 'actions' => [Url::to(['bulk-delete']) => Yii::t('yee', 'Delete')]], 'columns' => [['class' => 'yeesoft\\grid\\CheckboxColumn', 'options' => ['style' => 'width:10px']], ['attribute' => 'image', 'value' => function (MenuLink $model) {
    return FA::icon($model->image)->fixedWidth();
}, 'format' => 'raw', 'contentOptions' => ['style' => 'width:20px; text-align:center;']], ['class' => 'yeesoft\\grid\\columns\\TitleActionColumn', 'controller' => '/menu/link', 'attribute' => 'id', 'title' => function (MenuLink $model) {
    return Html::a($model->label, ['/menu/link/update', 'id' => $model->id], ['data-pjax' => 0]);
}, 'format' => 'raw', 'buttonsTemplate' => '{update} {delete}', 'options' => ['style' => 'width:220px']], ['attribute' => 'menu_id', 'filter' => ArrayHelper::merge(['' => Yii::t('yee', 'Not Selected')], Menu::getMenus()), 'value' => function (MenuLink $model) {
    return $model->menu instanceof Menu ? $model->menu->title : Yii::t('yii', '(not set)');
}, 'format' => 'raw'], 'link', 'parent_id', 'order']]);
?>

            <?php 
Pjax::end();
?>
        </div>
    </div>
</div>

Exemplo n.º 4
0
 private static function generateItem($link, $menuLinks)
 {
     $item = [];
     $icon = !empty($link->image) ? FA::icon($link->image) . ' ' : '';
     $subItems = self::generateSubItems($link->id, $menuLinks);
     $item['label'] = $icon . $link->label;
     if (isset($link->alwaysVisible) && $link->alwaysVisible) {
         $item['visible'] = true;
     }
     if ($link->link) {
         $url = parse_url($link->link);
         $item['url'] = isset($url['scheme']) ? $link->link : [$link->link];
     }
     if (is_array($subItems)) {
         $item['items'] = $subItems;
     }
     return $item;
 }
Exemplo n.º 5
0
}
UploaderAsset::register($this);
?>

<div class="clearfix quick-upload">
    <?php 
echo Html::beginForm($context->url, 'post', $context->options);
?>

    <div role="presentation" class="files pull-left"></div>

    <div class="fileupload-buttonbar pull-left">
        <div class="btn btn-primary fileinput-button">
            <div style="vertical-align: middle;">
                <?php 
echo FA::icon(FA::_PLUS);
?>
                <span><?php 
echo Yii::t('yee/media', 'Add files');
?>
</span>
                <?php 
echo $context->model instanceof Model && $context->attribute !== null ? Html::activeFileInput($context->model, $context->attribute, $context->fieldOptions) : Html::fileInput($context->name, $context->value, $context->fieldOptions);
?>
            </div>
        </div>
    </div>

    <?php 
echo Html::endForm();
?>