Skip to content

Commit

Permalink
Adds dash flag for maintenance mode
Browse files Browse the repository at this point in the history
Adds dash flag for maintenance mode
  • Loading branch information
havok89 committed Mar 27, 2017
1 parent 854e9d0 commit 8a9b451
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
1 change: 1 addition & 0 deletions hoosk/hoosk0/controllers/admin/Admin.php
Expand Up @@ -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);
Expand Down
11 changes: 6 additions & 5 deletions hoosk/hoosk0/language/english/admin_lang.php
Expand Up @@ -43,11 +43,12 @@


//Dashboard
$lang['dash_welcome'] = "Welcome <small>to Hoosk</small>";
$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 <small>to Hoosk</small>";
$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
Expand Down
14 changes: 12 additions & 2 deletions hoosk/hoosk0/models/Hoosk_model.php
Expand Up @@ -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');
Expand All @@ -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("*");
Expand Down
7 changes: 7 additions & 0 deletions hoosk/hoosk0/views/admin/home.php
Expand Up @@ -12,6 +12,13 @@
</li>
</ol>
</div>
<?php if($maintenaceActive){ ?>
<div class="col-md-12">
<div class="alert alert-warning">
<p><?php echo $this->lang->line('dash_maintenance_message'); ?></p>
</div>
</div>
<?php } ?>
</div>
</div>
<div class="container-fluid">
Expand Down

0 comments on commit 8a9b451

Please sign in to comment.