diff options
| author | Geo Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-04-27 18:16:44 +0300 |
|---|---|---|
| committer | Geo Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-04-27 18:16:44 +0300 |
| commit | b52e052bd3741c1ddf1bdaa43079ba5a9eafc8bd (patch) | |
| tree | ebf54306edc20705544ea4d10cb12b34a66c05cc /public/app/controllers | |
| parent | 187335950742b4c7ec011ede6e6d1ae86662cb1f (diff) | |
| download | classroom-b52e052bd3741c1ddf1bdaa43079ba5a9eafc8bd.tar.gz classroom-b52e052bd3741c1ddf1bdaa43079ba5a9eafc8bd.tar.bz2 classroom-b52e052bd3741c1ddf1bdaa43079ba5a9eafc8bd.zip | |
setting blueprint in action
Diffstat (limited to 'public/app/controllers')
| -rw-r--r-- | public/app/controllers/Admin.php | 58 | ||||
| -rw-r--r-- | public/app/controllers/Auth.php | 2 | ||||
| -rw-r--r-- | public/app/controllers/Cms.php (renamed from public/app/controllers/cms/Course.php) | 26 | ||||
| -rw-r--r-- | public/app/controllers/CmsAdmin.php (renamed from public/app/controllers/admin/Course_admin.php) | 4 | ||||
| -rw-r--r-- | public/app/controllers/admin/.gitkeep | 0 | ||||
| -rw-r--r-- | public/app/controllers/admin/Users_admin.php | 42 | ||||
| -rw-r--r-- | public/app/controllers/cli/CliContoller.php | 4 |
7 files changed, 22 insertions, 114 deletions
diff --git a/public/app/controllers/Admin.php b/public/app/controllers/Admin.php deleted file mode 100644 index 6f6858c..0000000 --- a/public/app/controllers/Admin.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php -namespace app\controllers; - -use Registry; -use Render; - -// user classes and models -use app\extends\Classroom_user; -use app\extends\Classroom_manager; -use app\models\admin\User_model; - -use app\extends\Send_mail; -use app\extends\Mail_jet; - - -/** class Auth - * - * handles user's Authentication and Authorizarion - * - */ -class Admin { - - /** admin cateogories - * - */ - public static function categories() - { - Render::view('admin/categories'); - } - - - /** admin lessons - * - */ - public static function lessons() - { - - } - - - /** admin pages - * - */ - public static function pages() - { - - } - - /** admin users - * - */ - public static function users() - { - - } - - -}
\ No newline at end of file diff --git a/public/app/controllers/Auth.php b/public/app/controllers/Auth.php index 4a6b9ed..aeec41c 100644 --- a/public/app/controllers/Auth.php +++ b/public/app/controllers/Auth.php @@ -7,7 +7,7 @@ use Render; // user classes and models use app\extends\Classroom_user; use app\extends\Classroom_manager; -use app\models\admin\User_model; +use app\models\User_model; use app\extends\Send_mail; use app\extends\Mail_jet; diff --git a/public/app/controllers/cms/Course.php b/public/app/controllers/Cms.php index ad8a0fb..306bc88 100644 --- a/public/app/controllers/cms/Course.php +++ b/public/app/controllers/Cms.php @@ -1,14 +1,21 @@ <?php -namespace app\controllers\cms; +namespace app\controllers; use Registry; use Render; use app\controllers\Auth; -use app\models\cms\Course_model; +use app\models\Cms_model; use app\extends\Cache_service; -class Course { +/** CMS class + * (Content Management System) + * + * Serves the content; + * Reponds to all front-end front-office requests + * + */ +class Cms { ## PERMITION @@ -120,7 +127,7 @@ class Course { $cache = Cache_service::courses_struct(); $tree = $cache['tree']; $breadcrumbs = $cache['breadcrumbs']; - $lessons = Course_model::lessons_of_course(intval($id)); + $lessons = Cms_model::lessons_of_course(intval($id)); // find parent_ids of current category (to open the menu tree) // --- @@ -162,7 +169,7 @@ class Course { { $id = intval($id); // lesson id - $lesson = Course_model::lesson($id); // get lesson + $lesson = Cms_model::lesson($id); // get lesson $course_id = $lesson['course_id']; // get course id $pri_id = $lesson['privilege_id']; // privilege needed @@ -219,6 +226,10 @@ class Course { } + ## PAGES + ## ------------------------------------------------------------------------- + + /** lesson * * check if user is authorized to view the content; @@ -245,7 +256,4 @@ class Course { } - - - -}
\ No newline at end of file +} diff --git a/public/app/controllers/admin/Course_admin.php b/public/app/controllers/CmsAdmin.php index fcf38c9..aa6ff6f 100644 --- a/public/app/controllers/admin/Course_admin.php +++ b/public/app/controllers/CmsAdmin.php @@ -4,10 +4,10 @@ namespace app\controllers\admin; use Registry; use Render; -use app\models\cms\Course_model; +use app\models\Cms_model; use app\extends\Cache_service; -class Course_admin { +class CmsAdmin { ## ------------------------------------------------------------------------- diff --git a/public/app/controllers/admin/.gitkeep b/public/app/controllers/admin/.gitkeep deleted file mode 100644 index e69de29..0000000 --- a/public/app/controllers/admin/.gitkeep +++ /dev/null diff --git a/public/app/controllers/admin/Users_admin.php b/public/app/controllers/admin/Users_admin.php deleted file mode 100644 index 4e335c1..0000000 --- a/public/app/controllers/admin/Users_admin.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -namespace app\controllers\admin; - -use Registry; -use Render; - - -class Users_admin { - - /** privileges - * --- - * get all privileges - * - * @param void - * @return privileges (array) - */ - public static function privileges() - { - return Registry::use('database')->runQuery( - "SELECT * FROM privilege",[] - ); - } - - /** edit privileges - * --- - */ - public static function edit_privileges() - { - // TODO: ... - } - - - /** update course - * --- - */ - public static function update_course() - { - // TODO: ... - } - -}
\ No newline at end of file diff --git a/public/app/controllers/cli/CliContoller.php b/public/app/controllers/cli/CliContoller.php index 4549b50..949985d 100644 --- a/public/app/controllers/cli/CliContoller.php +++ b/public/app/controllers/cli/CliContoller.php @@ -39,12 +39,12 @@ class CliContoller if (php_sapi_name() != 'cli') return false; # PROXY call: - # CMS \ Course_model::courses_struct(): + # CMS \ Cms_model::courses_struct(): # + Refresh Cache # -------------------------------------- echo textColor("Creating category_products tree Cache ... ", \NORMAL); $reply = proxy( - [\app\models\cms\Course_model::class, 'courses_struct'], + [\app\models\Cms_model::class, 'courses_struct'], [], \CACHE_ROOT_TTL, \PROXY_IGNORE_CACHE ); |
