public function actionDataBlocks() { $favs = Yii::$app->adminuser->identity->setting->get("blockfav", []); $groups = []; foreach (BlockGroup::find()->asArray()->all() as $group) { $blocks = []; $groupPosition = null; foreach (Block::find()->where(['group_id' => $group['id']])->all() as $block) { $obj = Block::objectId($block['id'], 0, 'admin'); if (!$obj || in_array(get_class($obj), Yii::$app->getModule('cmsadmin')->hiddenBlocks)) { continue; } if ($groupPosition == null) { $groupObject = Yii::createObject($obj->blockGroup()); $groupPosition = $groupObject->getPosition(); } $blocks[] = ['id' => $block['id'], 'name' => $obj->name(), 'full_name' => $obj->icon() === null ? $obj->name() : '<i class="material-icons">' . $obj->icon() . '</i> <span>' . $obj->name() . '</span>', 'favorized' => array_key_exists($block['id'], $favs)]; } if (empty($blocks)) { continue; } $group['is_fav'] = 0; $group['toggle_open'] = (int) Yii::$app->adminuser->identity->setting->get("togglegroup.{$group['id']}", 1); $groups[] = ['groupPosition' => $groupPosition, 'group' => $group, 'blocks' => $blocks]; } if (!empty($favs)) { $favblocks = []; foreach ($favs as $fav) { $favblocks[] = $fav; } array_unshift($groups, ['group' => ['toggle_open' => (int) Yii::$app->adminuser->identity->setting->get("togglegroup.99999", 1), 'id' => '99999', 'is_fav' => 1, 'name' => Module::t('block_group_favorites'), 'identifier' => 'favs', 'position' => 0], 'groupPosition' => 0, 'blocks' => $favblocks]); } return $groups; }
</p> <div class="card-panel" ng-controller="DraftsController"> <table class="striped"> <thead> <tr> <th><?php echo \luya\cms\admin\Module::t('draft_column_id'); ?> </th> <th><?php echo \luya\cms\admin\Module::t('draft_column_title'); ?> </th> <th><?php echo \luya\cms\admin\Module::t('draft_column_action'); ?> </th> </tr> </thead> <tr ng-repeat="item in menuData.drafts"> <td>{{item.id}}</td> <td>{{item.title}}</td> <td><button type="button" ng-click="go(item.id)" class="btn btn-flat"><?php echo \luya\cms\admin\Module::t('draft_edit_button'); ?> </button> </tr> </table> </div> </div> </div>
</div> </div> <!-- /PAGE__CONTENT --> </div> <!-- /PAGE --> </div> </div> </div> <div class="cms__sidebar"> <div class="blockholder" ng-controller="DroppableBlocksController"> <div class="col s12"> <div class="blockholder__group blockholder__group--clipboard" ng-show="copyStack.length > 0"> <b class="blockholder__group-title blockholder__group-title--clipboard"><i class="material-icons left">content_copy</i> <span><?php echo Module::t('view_update_blockholder_clipboard'); ?> </span></b> <div class="blockholder__block" ng-repeat="stackItem in copyStack" data-drag="true" data-copy="true" jqyoui-draggable="{placeholder: 'keep', onStart : 'onStart', onStop : 'onStop'}" ng-model="stackItem" data-jqyoui-options="{revert: false, refreshPositions : true, snapTolerance : 40, helper : 'clone', cursor:'move', cursorAt: { top: 0, left: 0 }}"> <span>{{stackItem.name}}</span> </div> <span ng-click="clearStack()" class="blockholder__clear-clipboard"><i class="material-icons">clear</i></span> </div> <div class="blockholder__search" ng-class="{'blockholder__search--active': searchQuery}" zaa-esc="searchQuery=''""> <input class="blockholder__input" type="text" ng-model="searchQuery" value="" id="blockholderSearch" /> <label class="blockholder__icon blockholder__icon--search" for="blockholderSearch"><i class="material-icons">search</i></label> <label class="blockholder__icon blockholder__icon--cancel" for="blockholderCancel"> <div ng-show="searchQuery.length > 0" ng-click="searchQuery=''"><i class="material-icons">close</i></div> </label> </div> <div class="blockholder__group" ng-repeat="item in blocksData | orderBy:'groupPosition'" ng-class="{'blockholder__group--favorite' : item.group.is_fav}">
public function getAction() { if ($this->is_insertion) { switch ($this->table_name) { case "nav_item": return Module::t('log_action_insert_cms_nav_item', ['info' => $this->rowDescriber]); case "nav": return Module::t('log_action_insert_cms_nav', ['info' => $this->rowDescriber]); case "cms_nav_item_page_block_item": return Module::t('log_action_insert_cms_nav_item_page_block_item', ['info' => $this->rowDescriber]); default: return Module::t('log_action_insert_unkown', ['info' => $this->rowDescriber]); } } if ($this->is_update) { switch ($this->table_name) { case "nav_item": return Module::t('log_action_update_cms_nav_item', ['info' => $this->rowDescriber]); case "nav": return Module::t('log_action_update_cms_nav', ['info' => $this->rowDescriber]); case "cms_nav_item_page_block_item": return Module::t('log_action_update_cms_nav_item_page_block_item', ['info' => $this->rowDescriber]); default: return Module::t('log_action_update_unkown', ['info' => $this->rowDescriber]); } } if ($this->is_deletion) { switch ($this->table_name) { case "nav_item": return Module::t('log_action_delete_cms_nav_item', ['info' => $this->rowDescriber]); case "nav": return Module::t('log_action_delete_cms_nav', ['info' => $this->rowDescriber]); case "cms_nav_item_page_block_item": return Module::t('log_action_delete_cms_nav_item_page_block_item', ['info' => $this->rowDescriber]); default: return Module::t('log_action_delete_unkown'); } } }
/** * @inheritdoc */ public function attributeLabels() { return ['value' => Module::t('model_navitemredirect_value_label'), 'type' => Module::t('model_navitemredirect_type_label')]; }
/** * @inheritdoc */ public function attributeLabels() { return ['title' => Module::t('model_navitem_title_label'), 'alias' => Module::t('model_navitem_alias_label'), 'title_tag' => Module::t('model_navitem_title_tag_label')]; }
</span> </label> </div> <?php if (Yii::$app->adminuser->canApi('api-cms-navitempageblockitem')) { ?> <div class="sidebar__button sidebar__button--grey sidebar__button--switch switch" ng-class="{ 'sidebar__button--active': showDrag }"> <label> <input type="checkbox" ng-model="showDrag" ng-true-value="1" ng-false-value="0"> <span class="lever"></span> <div class="sidebar__icon-holder"> <i class="sidebar__icon material-icons">mouse</i> </div> <span class="sidebar__text"><?php echo \luya\cms\admin\Module::t('view_index_sidebar_move'); ?> </span> </label> </div> <?php } ?> <div class="treeview" ng-repeat="catitem in menuData.containers" ng-class="{ 'treeview--drag-active' : showDrag }"> <h5 class="sidebar__group-title sidebar__group-title--clickable" ng-click="toggleCat(catitem.id)"><i class="material-icons sidebar__group-title-icon" ng-class="{'sidebar__group-title-icon--closed': toggleIsHidden(catitem.id)}">arrow_drop_down</i> <span>{{catitem.name}}</span></h5> <div class="treeview__drop" ng-show="(menuData.items|menuparentfilter:catitem.id:0).length == 0 && !toggleIsHidden(catitem.id)" ng-controller="DropNavController" ng-model="droppedNavItem" data-itemid="{{catitem.id}}" data-drop="true" data-jqyoui-options="{greedy : true, tolerance : 'pointer', hoverClass : 'treeview__drop--hover' }" jqyoui-droppable="{onDrop: 'onEmptyDrop()', multiple : true}"></div> <ul class="treeview__list" ng-hide="toggleIsHidden(catitem.id)"> <li class="treeview__item" ng-repeat="data in menuData.items | menuparentfilter:catitem.id:0" ng-include="'reverse.html'"></li>
/** * @inheritdoc */ public function fields() { $fields = parent::fields(); $fields['contentAsArray'] = 'contentAsArray'; $fields['version_alias'] = function ($model) { return Module::t($model->version_alias); }; return $fields; }
/** * @inheritdoc */ public function attributeLabels() { return ['module_name' => Module::t('model_navitemmodule_module_name_label')]; }
<?php use luya\cms\admin\Module; ?> <div ng-controller="CmsadminCreateController"> <div class="row"> <div class="col s12"> <div class="card-panel"> <h5 style="text-align:center;"><?php echo Module::t('view_index_add_title'); ?> </h5> <create-form data="data"></create-form> </div> </div> </div> </div>