summaryrefslogtreecommitdiff
path: root/public/app/routes/backend.php
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-24 04:36:57 +0300
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-24 04:36:57 +0300
commit17d243371c43847e9dbdeb21395afc0e8f5437ae (patch)
tree7dfe75fe664826f2b1575d13f09e75a500b605fb /public/app/routes/backend.php
parent74f1c04022328280b996dde0b7089e13d96acf70 (diff)
downloadclassroom-17d243371c43847e9dbdeb21395afc0e8f5437ae.tar.gz
classroom-17d243371c43847e9dbdeb21395afc0e8f5437ae.tar.bz2
classroom-17d243371c43847e9dbdeb21395afc0e8f5437ae.zip
edit lesson: putting all together; media with privile level
Diffstat (limited to 'public/app/routes/backend.php')
-rw-r--r--public/app/routes/backend.php77
1 files changed, 71 insertions, 6 deletions
diff --git a/public/app/routes/backend.php b/public/app/routes/backend.php
index 704d161..7f4717d 100644
--- a/public/app/routes/backend.php
+++ b/public/app/routes/backend.php
@@ -4,6 +4,25 @@ use app\controllers\Auth;
use app\controllers\admin\Course_admin;
use app\models\admin\Privilege_model;
+
+// admin panel
+// ---
+Route::add('/admin', function () {
+ Auth::allowRoles([1, 2, 3]); // allow few admin-panel roles
+ Render::view('admin/skeleton', [
+ 'title' => 'Διαχείριση Classroom',
+ 'action' => 'panel',
+ ]);
+});
+Route::add('/admin/panel', function () {
+ Auth::allowRoles([1, 2, 3]); // allow few admin-panel roles
+ Render::view('admin/skeleton', [
+ 'title' => 'Διαχείριση Classroom',
+ 'action' => 'panel',
+ ]);
+});
+
+
// admin lessons
// ---
Route::add('/admin/lessons', function () {
@@ -15,7 +34,7 @@ Route::add('/admin/lessons', function () {
});
-// admin categories (=courses)
+// admin categories (=courses) /////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// manage categories page
@@ -54,7 +73,7 @@ Route::add('/admin/api/categories/update', function () {
);
-// admin privileges
+// admin privileges ////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// manage privileges page
@@ -84,8 +103,12 @@ Route::add('/admin/api/privileges', function () {
-// new lesson
+// admin lesson ////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
+
+
+// new lesson
+// ---
Route::add('/admin/edit_lesson', function () {
Auth::allowRoles([1, 2, 3]); // allow few admin-panel roles
Render::view('admin/skeleton', [
@@ -94,18 +117,55 @@ Route::add('/admin/edit_lesson', function () {
]);
});
-// new lesson
-// -----------------------------------------------------------------------------
+// edit lesson (give lesson-id)
+// ---
Route::add('/admin/edit_lesson/([0-9]*)', function ($id) {
Auth::allowRoles([1, 2, 3]); // allow few admin-panel roles
Render::view('admin/skeleton', [
- 'title' => 'Νέο Μάθημα',
+ 'title' => 'Επεξεργασία Μαθήματος',
'action' => 'edit_lesson',
'id' => intval($id)
]);
});
+// ajax: get lesson
+// ---
+Route::add('/admin/api/lesson/([0-9]*)', function ($id) {
+ Auth::allowRoles([1, 2, 3]); // allow few admin-panel roles
+ Course_admin::get_lesson($id);
+});
+
+
+Route::add('/admin/api/lesson/add', function () {
+ Auth::allowRoles([1, 2, 3]); // allow few admin-panel roles
+ Course_admin::add_lesson();
+}, 'post');
+
+
+Route::add('/admin/api/lesson/update', function () {
+ Auth::allowRoles([1, 2, 3]); // allow few admin-panel roles
+ Course_admin::update_lesson();
+}, 'post');
+
+
+
+// admin files /////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+Route::add('/admin/files', function () {
+ Auth::allowRoles([1, 2, 3]);
+ Render::view('admin/skeleton', [
+ 'title' => 'Διαχείριση Μέσων (media)',
+ 'action' => 'files',
+ ]);
+});
+// ajax: get lesson
+// ---
+Route::add('/admin/api/files', function () {
+ Auth::allowRoles([1, 2, 3]); // allow few admin-panel roles
+ Render::json(Course_admin::files());
+});
// ajax: file-upload
// ---
@@ -113,3 +173,8 @@ Route::add('/admin/api/file_upload', function () {
Auth::allowRoles([1, 2, 3]); // allow few admin-panel roles
Render::json(Course_admin::upload_file());
}, 'post');
+
+
+
+
+