diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-04-25 03:40:09 +0300 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-04-25 03:40:09 +0300 |
| commit | 65d07ba64d45c77d2db16272710ec5702b34d641 (patch) | |
| tree | 4578793e288cd1a6dc08f87ab44d0e3568904c12 /public/app/controllers/admin | |
| parent | 13753d58d6aceaea8f246040518d50f2eb06a8d9 (diff) | |
| download | classroom-65d07ba64d45c77d2db16272710ec5702b34d641.tar.gz classroom-65d07ba64d45c77d2db16272710ec5702b34d641.tar.bz2 classroom-65d07ba64d45c77d2db16272710ec5702b34d641.zip | |
front-end: putting everything together
Diffstat (limited to 'public/app/controllers/admin')
| -rw-r--r-- | public/app/controllers/admin/Course_admin.php | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/public/app/controllers/admin/Course_admin.php b/public/app/controllers/admin/Course_admin.php index bb4deb0..c2e06f2 100644 --- a/public/app/controllers/admin/Course_admin.php +++ b/public/app/controllers/admin/Course_admin.php @@ -5,6 +5,7 @@ namespace app\controllers\admin; use Registry; use Render; use app\models\cms\Course_model; +use app\extends\Cache_service; class Course_admin { @@ -22,15 +23,7 @@ class Course_admin { */ public static function breadcrumbs() { - $tree = proxy( // cache-get categories - [\app\models\cms\Course_model::class, 'category_tree'], - [], CACHE_ROOT_TTL - ); - $breadcrumbs = proxy( // cache-get breadcrumbs - [\app\models\cms\Course_model::class, 'breadcrumbs'], - [$tree], CACHE_ROOT_TTL - ); - Render::json($breadcrumbs); // send as json + Render::json( Cache_service::courses_struct()['breadcrumbs'] ); } /** add course @@ -75,26 +68,15 @@ class Course_admin { /** update courses cache * --- -- -- - - - + * Forces re-caching of courses tree * Shall run if anything changes to courses * * @param void - * @return (array): the two course caches + * @return (array): ['tree' => ..., 'breadcrumbs' => ... ] */ public static function update_courses_cache() { - $tree = proxy( // cache-get categories - [\app\models\cms\Course_model::class, 'category_tree'], - [], CACHE_ROOT_TTL, PROXY_IGNORE_CACHE - ); - $breadcrumbs = proxy( // cache-get breadcrumbs - [\app\models\cms\Course_model::class, 'breadcrumbs'], - [$tree], CACHE_ROOT_TTL, PROXY_IGNORE_CACHE - ); - - return [ - 'tree' => $tree, - 'breadcrumbs' => $breadcrumbs - ]; + return Cache_service::courses_struct(PROXY_IGNORE_CACHE); } @@ -289,10 +271,7 @@ class Course_admin { */ public static function files() { - return proxy( // cache-get files - [\app\models\cms\Course_model::class, 'files'], - [], CACHE_ROOT_TTL - ); + return Cache_service::files_attributes(); } |
