diff --git a/modules/Categories/Config/config.php b/modules/Categories/Config/config.php deleted file mode 100644 index 5b050b72..00000000 --- a/modules/Categories/Config/config.php +++ /dev/null @@ -1,12 +0,0 @@ - 'Categories', - 'translatedName' => 'categories::module.name', - 'translatedDescription' => 'categories::module.description', - 'alias' => 'categories', - 'handler' => \Modules\Categories\Handlers\Categories::class, - 'providers' => [\Modules\Categories\Providers\CategoriesServiceProvider::class], - 'files' => ['start.php'], - 'order' => 0, -]; \ No newline at end of file diff --git a/modules/Categories/Contracts/Repositories/Category.php b/modules/Categories/Contracts/Repositories/Category.php deleted file mode 100644 index ea344d3d..00000000 --- a/modules/Categories/Contracts/Repositories/Category.php +++ /dev/null @@ -1,9 +0,0 @@ -increments('id'); - $table->timestamps(); - $table->softDeletes(); - $table->integer('parent_id') - ->unsigned() - ->nullable(); - $table->integer('position', false, true); - $table->integer('real_depth', false, true); - $table->integer('user_id') - ->comment('Author of this category'); - $table->integer('module_id') - ->comment('ID of module, where this category is used'); - $table->string('name') - ->comment('Human readable name of category'); - $table->string('url') - ->index() - ->comment('URL slug of category'); - $table->text('description'); - - $table->unique(['url', 'module_id']); - }); - - Schema::table('categories', function (Blueprint $table) { - $table->foreign('parent_id') - ->references('id') - ->on('categories') - ->onDelete('set null'); - - $table->foreign('user_id') - ->references('id') - ->on('users') - ->onDelete('cascade') - ->onUpdate('cascade'); - - $table->foreign('module_id') - ->references('id') - ->on('modules') - ->onDelete('cascade') - ->onUpdate('cascade'); - }); - } - - public function down() - { - Schema::table('categories', function (Blueprint $table) { - Schema::dropIfExists('categories'); - }); - } -} diff --git a/modules/Categories/Database/Migrations/2016_08_10_204046_create_category_closures_table.php b/modules/Categories/Database/Migrations/2016_08_10_204046_create_category_closures_table.php deleted file mode 100644 index d580f81a..00000000 --- a/modules/Categories/Database/Migrations/2016_08_10_204046_create_category_closures_table.php +++ /dev/null @@ -1,35 +0,0 @@ -increments('closure_id'); - - $table->integer('ancestor', false, true); - $table->integer('descendant', false, true); - $table->integer('depth', false, true); - - $table->foreign('ancestor') - ->references('id') - ->on('categories') - ->onDelete('cascade'); - $table->foreign('descendant') - ->references('id') - ->on('categories') - ->onDelete('cascade'); - }); - } - - public function down() - { - Schema::table('category_closure', function (Blueprint $table) { - Schema::dropIfExists('category_closure'); - }); - } -} diff --git a/modules/Categories/Database/Seeders/.gitkeep b/modules/Categories/Database/Seeders/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/modules/Categories/Database/Seeders/CategoriesDatabaseSeeder.php b/modules/Categories/Database/Seeders/CategoriesDatabaseSeeder.php deleted file mode 100644 index 5a509fba..00000000 --- a/modules/Categories/Database/Seeders/CategoriesDatabaseSeeder.php +++ /dev/null @@ -1,20 +0,0 @@ -call("OthersTableSeeder"); - } - -} \ No newline at end of file diff --git a/modules/Categories/Entities/Category.php b/modules/Categories/Entities/Category.php deleted file mode 100644 index f1147b26..00000000 --- a/modules/Categories/Entities/Category.php +++ /dev/null @@ -1,33 +0,0 @@ -belongsTo(Module::class); - } - - public function content() - { - return $this->hasMany(Content::class, 'categoryId'); - } -} diff --git a/modules/Categories/Entities/CategoryClosure.php b/modules/Categories/Entities/CategoryClosure.php deleted file mode 100644 index bdb3a035..00000000 --- a/modules/Categories/Entities/CategoryClosure.php +++ /dev/null @@ -1,14 +0,0 @@ -dropdown(trans('categories::categories.name'), function ($sub) { - $sub->route('categories.new', trans('categories::categories.new'), [], 10, ['icon' => 'fa fa-fw fa-plus']); - $sub->route('categories.overview', trans('categories::categories.overview'), [], 30, ['icon' => 'fa fa-fw fa-tags']); - }, 55, ['icon' => 'fa fa-fw fa-tags']); - } -} \ No newline at end of file diff --git a/modules/Categories/Http/Controllers/CategoriesOverview.php b/modules/Categories/Http/Controllers/CategoriesOverview.php deleted file mode 100644 index 3d142332..00000000 --- a/modules/Categories/Http/Controllers/CategoriesOverview.php +++ /dev/null @@ -1,22 +0,0 @@ -toArray(); - - $modules = ModuleNamesWithIds::getWithTranslations(); - - return view('categories::admin.overview', [ - 'categories' => $categories, - 'modules' => $modules - ]); - } -} \ No newline at end of file diff --git a/modules/Categories/Http/Controllers/CreateNewCategory.php b/modules/Categories/Http/Controllers/CreateNewCategory.php deleted file mode 100644 index 9e228f4d..00000000 --- a/modules/Categories/Http/Controllers/CreateNewCategory.php +++ /dev/null @@ -1,60 +0,0 @@ -toArray(); - - // get list of modules which supports categories - $modules = Module::where('enabled', true) - ->where('support_categories', true) - ->get(); - - return view('categories::admin.new', [ - 'category' => new Category(), - 'categories' => $categories, - 'modules' => $modules - ]); - } - - /** - * Create new category - * - * @param Request $request - * - * @return \Illuminate\Http\RedirectResponse - */ - public function postNew(Request $request) - { - $category = new Category(); - $category->user_id = Auth::user()->id; - $category->module_id = $request->moduleId; - $category->name = $request->name; - $category->url = Str::slug($request->url); - $category->description = $request->description; - - if ((int)$request->parentCategory) { - $category->parent_id = $request->parentCategory; - } - - $category->save(); - - return redirect() - ->route('categories.overview') - ->with('success', trans('categories::categories.saveSuccessfull')); - } -} \ No newline at end of file diff --git a/modules/Categories/Http/Controllers/EditCategory.php b/modules/Categories/Http/Controllers/EditCategory.php deleted file mode 100644 index 1405249d..00000000 --- a/modules/Categories/Http/Controllers/EditCategory.php +++ /dev/null @@ -1,77 +0,0 @@ -toArray(); - - // get list of modules which supports categories - $modules = Module::where('enabled', true) - ->where('support_categories', true) - ->get(); - - return view('categories::admin.edit', [ - 'category' => $category, - 'categories' => $categories, - 'modules' => $modules - ]); - } - - /** - * Create new category - * - * @param Request $request - * @param $id - * - * @return \Illuminate\Http\RedirectResponse - */ - public function postEdit(Request $request, $id) - { - $category = Category::findOrFail($id); - - $category->name = $request->name; - $category->url = Str::slug($request->url); - $category->description = $request->description; - - $category->save(); - - if ($category->parent_id !== $request->parentCategory) { - $category->parent_id = empty($request->parentCategory) ? null : $request->parentCategory; - $category->save(); - - if (empty($request->parentCategory)) { - $category->makeRoot($category->position); - } - } - - return redirect() - ->route('categories.edit', ['id' => $id]) - ->with('success', trans('categories::categories.saveSuccessfull')); - } - - public function delete($id) { - $category = Category::findOrFail($id); - - $category->delete(); - - return redirect() - ->route('categories.overview') - ->with('success', trans('categories::categories.deleteSuccessfull')); - } -} \ No newline at end of file diff --git a/modules/Categories/Http/Middleware/.gitkeep b/modules/Categories/Http/Middleware/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/modules/Categories/Http/Requests/.gitkeep b/modules/Categories/Http/Requests/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/modules/Categories/Http/routes.php b/modules/Categories/Http/routes.php deleted file mode 100644 index 52ff9a1a..00000000 --- a/modules/Categories/Http/routes.php +++ /dev/null @@ -1,23 +0,0 @@ - LaravelLocalization::setLocale() . '/admin/categories', - 'middleware' => ['admin'], - 'namespace' => 'Modules\Categories\Http\Controllers' - ], function () { - Route::get('/', 'CategoriesOverview@getOverview') - ->name('categories.overview'); - - Route::get('/new', 'CreateNewCategory@getNew') - ->name('categories.new'); - Route::post('/new', 'CreateNewCategory@postNew') - ->name('categories.postNew'); - - Route::get('/edit/{id}', 'EditCategory@getEdit') - ->name('categories.edit'); - Route::post('/edit/{id}', 'EditCategory@postEdit') - ->name('categories.postEdit'); - - Route::get('/delete/{id}', 'EditCategory@delete') - ->name('categories.delete'); -}); \ No newline at end of file diff --git a/modules/Categories/Providers/CategoriesServiceProvider.php b/modules/Categories/Providers/CategoriesServiceProvider.php deleted file mode 100644 index cdde8c90..00000000 --- a/modules/Categories/Providers/CategoriesServiceProvider.php +++ /dev/null @@ -1,26 +0,0 @@ -alias = 'categories'; - } - - public function boot() - { - parent::boot(); - - $this->app->bind(ICategory::class, Category::class); - } - - protected function setModulePath() - { - $this->path = __DIR__; - } -} diff --git a/modules/Categories/Repositories/Category.php b/modules/Categories/Repositories/Category.php deleted file mode 100644 index 7ef044e5..00000000 --- a/modules/Categories/Repositories/Category.php +++ /dev/null @@ -1,21 +0,0 @@ -first(); - $categories = []; - if ($module->support_categories && !is_null($categoryModule) && $categoryModule->enabled) { - $categories = CategoryModel::where('module_id', $module->id) - ->get(); - } - - return $categories; - } -} \ No newline at end of file diff --git a/modules/Categories/Resources/lang/cs/categories.php b/modules/Categories/Resources/lang/cs/categories.php deleted file mode 100644 index 70faf2ea..00000000 --- a/modules/Categories/Resources/lang/cs/categories.php +++ /dev/null @@ -1,20 +0,0 @@ - "Akce", -"deleteSuccessfull" => "Kategorie úspěšně smazána", -"description" => "Modul pro správu a kategorizaci obsahu.", -"edit" => "Úprava kategorie", -"fields" => ["description" => "Popis", -"module" => "Modul", -"name" => "Jméno", -"parentCategory" => "Rodičovská kategorie", -"save" => "Uložit", -"url" => "URL", -], -"module" => "Modul", -"name" => "Kategorie", -"new" => "Nová kategorie", -"noCategories" => "Žádná vytvořená kategorie.", -"overview" => "Všechny kategorie", -"saveSuccessfull" => "Kategorie úspěšně uložena", -]; diff --git a/modules/Categories/Resources/lang/en/categories.php b/modules/Categories/Resources/lang/en/categories.php deleted file mode 100644 index a01d847e..00000000 --- a/modules/Categories/Resources/lang/en/categories.php +++ /dev/null @@ -1,21 +0,0 @@ - 'Categories', - 'description' => 'Module for category management and content categorization.', - 'new' => 'New category', - 'overview' => 'All categories', - 'fields' => [ - 'name' => 'Name', - 'description' => 'Description', - 'url' => 'URL', - 'module' => 'Module', - 'parentCategory' => 'Parent category', - 'save' => 'Save category' - ], - 'edit' => 'Edit category', - 'saveSuccessfull' => 'Category successfully saved', - 'deleteSuccessfull' => 'Category successfully deleted', - 'module' => 'Module', - 'actions' => 'Actions', - 'noCategories' => 'No categories available' -]; \ No newline at end of file diff --git a/modules/Categories/Resources/lang/sk/categories.php b/modules/Categories/Resources/lang/sk/categories.php deleted file mode 100644 index ceb9a5dd..00000000 --- a/modules/Categories/Resources/lang/sk/categories.php +++ /dev/null @@ -1,20 +0,0 @@ - "Akcie", - "deleteSuccessfull" => "Kategória úspešne zmazaná.", - "description" => "Modul pre správu kategórií a kategorizovanie obsahu", - "edit" => "Upraviť kategóriu", - "fields" => ["description" => "Popis", - "module" => "Modul", - "name" => "Názov", - "parentCategory" => "Rodičovská kategória", - "save" => "Uložiť kategóriu", - "url" => "URL", - ], - "module" => "Modul", - "name" => "Kategórie", - "new" => "Nová kategória", - "noCategories" => "Žiadne kategórie nie sú dostupné.", - "overview" => "Všetky kategórie", - "saveSuccessfull" => "Kategória úspešne uložená.", -]; diff --git a/modules/Categories/Resources/views/admin/edit.blade.php b/modules/Categories/Resources/views/admin/edit.blade.php deleted file mode 100644 index 9f2c69a6..00000000 --- a/modules/Categories/Resources/views/admin/edit.blade.php +++ /dev/null @@ -1,7 +0,0 @@ -@extends('admin.layoutWithNavigation') - -@section('pageHeading', trans('categories::categories.edit')) - -@section('content') - @include('categories::admin.form', ['action' => route('categories.postEdit', ['id' => $category->id])]) -@endsection \ No newline at end of file diff --git a/modules/Categories/Resources/views/admin/form.blade.php b/modules/Categories/Resources/views/admin/form.blade.php deleted file mode 100644 index 9e744f23..00000000 --- a/modules/Categories/Resources/views/admin/form.blade.php +++ /dev/null @@ -1,67 +0,0 @@ -
\ No newline at end of file diff --git a/modules/Categories/Resources/views/admin/new.blade.php b/modules/Categories/Resources/views/admin/new.blade.php deleted file mode 100644 index 12cae2af..00000000 --- a/modules/Categories/Resources/views/admin/new.blade.php +++ /dev/null @@ -1,7 +0,0 @@ -@extends('admin.layoutWithNavigation') - -@section('pageHeading', trans('categories::categories.new')) - -@section('content') - @include('categories::admin.form', ['action' => route('categories.postNew')]) -@endsection \ No newline at end of file diff --git a/modules/Categories/Resources/views/admin/overview.blade.php b/modules/Categories/Resources/views/admin/overview.blade.php deleted file mode 100644 index e11ed7bb..00000000 --- a/modules/Categories/Resources/views/admin/overview.blade.php +++ /dev/null @@ -1,35 +0,0 @@ -@extends('admin.layoutWithNavigation') - -@section('pageHeading', trans('categories::categories.overview')) - -@section('content') - -| @lang('categories::categories.name') | -@lang('categories::categories.module') | -@lang('categories::categories.actions') | -
|---|