From 8a9b451f158fd69cd91e692e098f0787eb28ba9b Mon Sep 17 00:00:00 2001 From: Callum Henry Date: Mon, 27 Mar 2017 20:51:06 +0100 Subject: [PATCH] Adds dash flag for maintenance mode Adds dash flag for maintenance mode --- hoosk/hoosk0/controllers/admin/Admin.php | 1 + hoosk/hoosk0/language/english/admin_lang.php | 11 ++++++----- hoosk/hoosk0/models/Hoosk_model.php | 14 ++++++++++++-- hoosk/hoosk0/views/admin/home.php | 7 +++++++ 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/hoosk/hoosk0/controllers/admin/Admin.php b/hoosk/hoosk0/controllers/admin/Admin.php index bba036e..977447a 100644 --- a/hoosk/hoosk0/controllers/admin/Admin.php +++ b/hoosk/hoosk0/controllers/admin/Admin.php @@ -27,6 +27,7 @@ public function index() $this->rssparser->set_cache_life(30); $this->data['hooskFeed'] = $this->rssparser->getFeed(3); } + $this->data['maintenaceActive'] = $this->Hoosk_model->checkMaintenance(); $this->data['header'] = $this->load->view('admin/header', $this->data, true); $this->data['footer'] = $this->load->view('admin/footer', '', true); $this->load->view('admin/home', $this->data); diff --git a/hoosk/hoosk0/language/english/admin_lang.php b/hoosk/hoosk0/language/english/admin_lang.php index 9abedf1..df4eadf 100644 --- a/hoosk/hoosk0/language/english/admin_lang.php +++ b/hoosk/hoosk0/language/english/admin_lang.php @@ -43,11 +43,12 @@ //Dashboard -$lang['dash_welcome'] = "Welcome to Hoosk"; -$lang['dash_unreachable'] = "The news feed cannot be reached."; -$lang['dash_recent'] = "Recently Updated Pages"; -$lang['dash_message'] = "This is your Hoosk dashboard, Using the navigation bar you can add or edit the users, pages or navigation menus on your website. Hoosk is built around the bootstrap framework, this should make your website fully responsive with ease."; -$lang['feed_heading'] = "Hoosk News"; +$lang['dash_welcome'] = "Welcome to Hoosk"; +$lang['dash_unreachable'] = "The news feed cannot be reached."; +$lang['dash_recent'] = "Recently Updated Pages"; +$lang['dash_maintenance_message'] = "Your site is currently in maintenance mode, visit the settings page to disable this and allow visitors to view your site."; +$lang['dash_message'] = "This is your Hoosk dashboard, Using the navigation bar you can add or edit the users, pages or navigation menus on your website. Hoosk is built around the bootstrap framework, this should make your website fully responsive with ease."; +$lang['feed_heading'] = "Hoosk News"; //Settings Page diff --git a/hoosk/hoosk0/models/Hoosk_model.php b/hoosk/hoosk0/models/Hoosk_model.php index c978035..ce4c3ac 100644 --- a/hoosk/hoosk0/models/Hoosk_model.php +++ b/hoosk/hoosk0/models/Hoosk_model.php @@ -12,7 +12,6 @@ function __construct() { /* * ** Dash Querys ************ */ /* * *************************** */ function getSiteName() { - // Get Theme $this->db->select("*"); $this->db->where("siteID", 0); $query = $this->db->get('hoosk_settings'); @@ -24,7 +23,18 @@ function getSiteName() { } return array(); } - + function checkMaintenance(){ + $this->db->select("*"); + $this->db->where("siteID", 0); + $query = $this->db->get('hoosk_settings'); + if ($query->num_rows() > 0) { + $results = $query->result_array(); + foreach ($results as $u): + return $u['siteMaintenance']; + endforeach; + } + return array(); + } function getTheme() { // Get Theme $this->db->select("*"); diff --git a/hoosk/hoosk0/views/admin/home.php b/hoosk/hoosk0/views/admin/home.php index b0a4a8c..4a7d6ff 100644 --- a/hoosk/hoosk0/views/admin/home.php +++ b/hoosk/hoosk0/views/admin/home.php @@ -12,6 +12,13 @@ + +
+
+

lang->line('dash_maintenance_message'); ?>

+
+
+