From 3c5e766dc3efc34f4d85e0038871c0d1c724b4c5 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Tue, 16 Jun 2015 11:21:22 -0400 Subject: [PATCH] Enable toggling of anime collection view --- app/config/config.php | 24 ++++++++++++++++++++---- app/controllers/AnimeController.php | 7 ++++++- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/app/config/config.php b/app/config/config.php index 2d4f409c..65e9a7a7 100644 --- a/app/config/config.php +++ b/app/config/config.php @@ -1,11 +1,16 @@ 'timw4mail', - // Included config files - 'routes' => require _dir(CONF_DIR, 'routes.php'), - 'database' => require _dir(CONF_DIR, 'database.php'), + // ---------------------------------------------------------------------------- + // General config + // ---------------------------------------------------------------------------- + + // do you wish to show the anime collection tab? + 'show_anime_collection' => FALSE, // ---------------------------------------------------------------------------- // Routing @@ -14,6 +19,7 @@ return (object)[ // options to an empty string. To route by host, set the _path suffixed options // to an empty string // ---------------------------------------------------------------------------- + 'anime_host' => 'anime.timshomepage.net', 'manga_host' => 'manga.timshomepage.net', 'anime_path' => '', @@ -26,7 +32,17 @@ return (object)[ // Default to list view? 'default_to_list_view' => FALSE, + // ---------------------------------------------------------------------------- + // Lower level configuration + // + // You shouldn't generally need to change anything below this line + // ---------------------------------------------------------------------------- + // Cache paths 'data_cache_path' => _dir(APP_DIR, 'cache'), 'img_cache_path' => _dir(ROOT_DIR, 'public/images'), + + // Included config files + 'routes' => require _dir(CONF_DIR, 'routes.php'), + 'database' => require _dir(CONF_DIR, 'database.php'), ]; \ No newline at end of file diff --git a/app/controllers/AnimeController.php b/app/controllers/AnimeController.php index 7573e279..75b1c7f8 100644 --- a/app/controllers/AnimeController.php +++ b/app/controllers/AnimeController.php @@ -46,9 +46,14 @@ class AnimeController extends BaseController { public function __construct() { parent::__construct(); + + if ($this->config->show_anime_collection === FALSE) + { + unset($this->nav_routes['Collection']); + } + $this->model = new AnimeModel(); $this->collection_model = new AnimeCollectionModel(); - $this->base_data = [ 'url_type' => 'anime', 'other_type' => 'manga',