Completed
Push — master ( c2cfef...1a5a57 )
by Angus
02:24
created

IndexC::_frontpage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 7
ccs 5
cts 5
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php defined('BASEPATH') OR exit('No direct script access allowed');
2
3
class IndexC extends User_Controller {
4 1
	public function __construct() {
5 1
		parent::__construct();
6 1
	}
7
8 1
	public function index() : void {
9 1
		if(!$this->User->logged_in()) {
10 1
			$this->_frontpage();
11
		} else {
12
			$this->_dashboard();
13
		}
14 1
	}
15
16 1
	private function _frontpage() : void {
17 1
		$this->header_data['title'] = "Index";
18 1
		$this->header_data['page']  = "index";
19
20
		//redirect('user/login');
21 1
		$this->_render_page('FrontPage');
22 1
	}
23
24
	private function _dashboard() : void {
25
		$this->header_data['title'] = "Dashboard";
26
		$this->header_data['page']  = "dashboard";
27
28
		$trackerData                     = $this->Tracker->list->get();
29
		$this->body_data['trackerData']  = $trackerData['series'];
30
		$this->body_data['has_inactive'] = $trackerData['has_inactive'];
31
32
		$this->body_data['category_custom_1']      = ($this->User_Options->get('category_custom_1') == 'enabled' ? TRUE : FALSE);
33
		$this->body_data['category_custom_1_text'] = $this->User_Options->get('category_custom_1_text');
34
35
		$this->body_data['category_custom_2']      = ($this->User_Options->get('category_custom_2') == 'enabled' ? TRUE : FALSE);
36
		$this->body_data['category_custom_2_text'] = $this->User_Options->get('category_custom_2_text');
37
38
		$this->body_data['category_custom_3']      = ($this->User_Options->get('category_custom_3') == 'enabled' ? TRUE : FALSE);
39
		$this->body_data['category_custom_3_text'] = $this->User_Options->get('category_custom_3_text');
40
41
		$this->body_data['use_live_countdown_timer'] = ($this->User_Options->get('enable_live_countdown_timer') == 'enabled' ? 'true' : 'false');
42
		$this->body_data['mal_sync']                 = $this->User_Options->get('mal_sync');
43
44
		$this->_render_page('User/Dashboard');
45
	}
46
}
47