コード例 #1
0
ファイル: Category.php プロジェクト: ekstremedia/shop
 public function index_onDelete()
 {
     if (($checkedIds = post('checked')) && is_array($checkedIds) && count($checkedIds)) {
         foreach ($checkedIds as $postId) {
             if (!($post = EmCat::find($postId)) || !$post->canEdit($this->user)) {
                 continue;
             }
             $post->delete();
         }
         Flash::success('Successfully deleted those categories.');
     }
     return $this->listRefresh();
 }
コード例 #2
0
ファイル: Plugin.php プロジェクト: ekstremedia/shop
 public function boot()
 {
     /*
      * Register menu items for the RainLab.Pages plugin
      */
     Event::listen('pages.menuitem.listTypes', function () {
         return ['blog-category' => 'Blog Category', 'all-blog-categories' => 'All Blog Categories'];
     });
     Event::listen('pages.menuitem.getTypeInfo', function ($type) {
         if ($type == 'blog-category' || $type == 'all-blog-categories') {
             return Category::getMenuTypeInfo($type);
         }
     });
     Event::listen('pages.menuitem.resolveItem', function ($type, $item, $url, $theme) {
         if ($type == 'blog-category' || $type == 'all-blog-categories') {
             return Category::resolveMenuItem($item, $url, $theme);
         }
     });
 }
コード例 #3
0
ファイル: Category.php プロジェクト: ekstremedia/shop
 public function items()
 {
     $slug = $this->property('slug');
     $alleposter = EmCat::where('slug', $slug)->items;
     return $alleposter;
 }
コード例 #4
0
ファイル: CategoryList.php プロジェクト: ekstremedia/shop
 public function count()
 {
     $count = EmCat::count();
     return $count;
 }