public function actionGenerate($id)
 {
     $category = Category::findOne($id);
     /** @var StaticUrl $class */
     $class = AdminModule::getInstance()->getCatalog()->staticUrlClass;
     $class::generate($category);
 }
 public function getModel()
 {
     return $this->hasOne(AdminModule::getInstance()->getCatalog()->itemClass, ['item_id' => 'model_id']);
 }
Exemplo n.º 3
0
 /**
  * @inheritDoc
  */
 public function behaviors()
 {
     return ArrayHelper::merge(parent::behaviors(), [['class' => ModelLoaderController::class, 'rules' => [['actions' => ['index', 'generate'], 'ownerAttribute' => 'category', 'modelClass' => Category::class], ['actions' => ['update'], 'ownerAttribute' => 'staticUrl', 'modelClass' => AdminModule::getInstance()->getCatalog()->staticUrlClass]]]]);
 }
Exemplo n.º 4
0
 /**
  * @param int $categoryId
  * @return Category
  */
 public static function category($categoryId)
 {
     return AdminModule::getInstance()->getCatalog()->categoryFind()->byId($categoryId)->one();
 }
Exemplo n.º 5
0
 /**
  * @inheritDoc
  */
 public function getOwner()
 {
     return $this->hasOne(AdminModule::getInstance()->getCatalog()->itemClass, ['id' => 'owner_id']);
 }
Exemplo n.º 6
0
 /**
  * @inheritDoc
  */
 public function behaviors()
 {
     return ArrayHelper::merge(parent::behaviors(), ['modelLoader' => ['class' => ModelLoaderController::class, 'rules' => [['actions' => ['category'], 'modelClass' => AdminModule::getInstance()->getCatalog()->categoryClass, 'ownerAttribute' => 'category'], ['actions' => ['attribute', 'add'], 'modelClass' => AttributeRuleRecord::class, 'ownerAttribute' => 'rule'], ['actions' => ['sort', 'update', 'delete'], 'modelClass' => AttributeEnumRecord::class, 'ownerAttribute' => 'enum']]]]);
 }
Exemplo n.º 7
0
 /**
  * @return ItemQuery
  */
 public function getItems()
 {
     return $this->hasMany(AdminModule::getInstance()->getCatalog()->itemClass, ['category_id' => 'category_id']);
 }
Exemplo n.º 8
0
echo Url::to(['/admin/sign/out']);
?>
" class="pull-right"><i class="glyphicon glyphicon-log-out"></i> <?php 
echo Yii::t('easyii', 'Logout');
?>
</a>
                </div>
            </div>
            <div class="main">
                <div class="box sidebar">

                    <?php 
foreach (AdminModule::getInstance()->activeModules as $module) {
    ?>
                        <?php 
    $m = AdminModule::getInstance()->getModule($module->name);
    ?>
                        <?php 
    $subModules = $m->getModules();
    ?>

                        <?php 
    if (count($subModules)) {
        ?>
                            <a href="" class="menu-list <?php 
        echo $moduleName == $module->name ? 'active' : '';
        ?>
">
                                <?php 
        if ($module->icon != '') {
            ?>