summaryrefslogtreecommitdiff
path: root/public/app/routes/backend.php
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-18 01:11:37 +0300
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-18 01:11:37 +0300
commit2b6970d33afd75be5bfef951dc3691d492004d43 (patch)
tree39eba4206ca0c4cd3fecd5ead95580a74e50f3f9 /public/app/routes/backend.php
parent68fc9e55e538e03f94509731ab41a0c8cf96710f (diff)
downloadclassroom-2b6970d33afd75be5bfef951dc3691d492004d43.tar.gz
classroom-2b6970d33afd75be5bfef951dc3691d492004d43.tar.bz2
classroom-2b6970d33afd75be5bfef951dc3691d492004d43.zip
admin back-office environment (skeleton); admin categories
Diffstat (limited to 'public/app/routes/backend.php')
-rw-r--r--public/app/routes/backend.php44
1 files changed, 38 insertions, 6 deletions
diff --git a/public/app/routes/backend.php b/public/app/routes/backend.php
index 9b90cf1..700fa14 100644
--- a/public/app/routes/backend.php
+++ b/public/app/routes/backend.php
@@ -1,9 +1,41 @@
<?php
-Route::add('/admin/info', // generaly you need to hide phpinfo()
- function() { // so, remove this route on production
- // Authenticate::session(); // or require authentication
- phpinfo(); },
- 'get'
-);
+use app\controllers\Auth;
+use app\models\cms\Course_model;
+// admin lessons
+// ---
+Route::add('/admin/lessons', function () {
+ Auth::allowRoles([1, 2, 3]); // allow few admin-panel roles
+ Render::view('admin/skeleton', [
+ 'title' => 'Διαχείριση Μαθημάτων',
+ 'action' => 'lessons',
+ ]);
+});
+
+
+// admin cateogies
+// ---
+Route::add('/admin/categories', function () {
+ Auth::allowRoles([1, 2, 3]);
+ Render::view('admin/skeleton', [
+ 'title' => 'Διαχείριση Κατηγοριών',
+ 'action' => 'categories',
+ ]);
+});
+
+
+Route::add('/admin/api/categories', function () {
+ Auth::allowRoles([1, 2, 3]);
+ $tree = proxy(
+ [\app\models\cms\Course_model::class, 'category_tree'],
+ [], CACHE_ROOT_TTL
+ );
+
+ $breadcrumbs = proxy(
+ [\app\models\cms\Course_model::class, 'breadcrumbs'],
+ [$tree], CACHE_ROOT_TTL
+ );
+ // $breadcrumbs = Course_model::breadcrumbs($tree);
+ Render::json($breadcrumbs);
+}); \ No newline at end of file