Completed
Push — master ( 646b8b...a5c38a )
by Angus
08:02
created

Dashboard   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 0
Metric Value
dl 0
loc 51
rs 10
c 0
b 0
f 0
wmc 6
lcom 1
cbo 5
1
<?php defined('BASEPATH') OR exit('No direct script access allowed');
2
3
class Dashboard extends User_Controller {
4
	public function __construct() {
5
		parent::__construct();
6
	}
7
8
	public function index() : void {
9
		$this->load->helper('form');
10
11
		$this->header_data['title'] = 'Dashboard';
12
		$this->header_data['page']  = 'dashboard';
13
14
		$trackerData                     = $this->Tracker->list->get();
15
		$this->body_data['trackerData']  = $trackerData['series'];
16
		$this->body_data['inactive_titles'] = $trackerData['extra_data']['inactive_titles'];
17
18
		$this->body_data['category_custom_1']      = ($this->User_Options->get('category_custom_1') == 'enabled' ? TRUE : FALSE);
19
		$this->body_data['category_custom_1_text'] = $this->User_Options->get('category_custom_1_text');
20
21
		$this->body_data['category_custom_2']      = ($this->User_Options->get('category_custom_2') == 'enabled' ? TRUE : FALSE);
22
		$this->body_data['category_custom_2_text'] = $this->User_Options->get('category_custom_2_text');
23
24
		$this->body_data['category_custom_3']      = ($this->User_Options->get('category_custom_3') == 'enabled' ? TRUE : FALSE);
25
		$this->body_data['category_custom_3_text'] = $this->User_Options->get('category_custom_3_text');
26
27
		$this->body_data['use_live_countdown_timer'] = ($this->User_Options->get('enable_live_countdown_timer') == 'enabled' ? 'true' : 'false');
28
		$this->body_data['mal_sync']                 = $this->User_Options->get('mal_sync');
29
30
		$this->body_data['list_sort_type'] = array_intersect_key(
31
			array(
32
				'unread'        => 'Unread (Alphabetical)',
33
				'unread_latest' => 'Unread (Latest Release)',
34
				'alphabetical'  => 'Alphabetical',
35
				'my_status'     => 'My Status',
36
				'latest'        => 'Latest Release'
37
			),
38
			array_flip(array_values($this->User_Options->options['list_sort_type']['valid_options']))
39
		);
40
		$this->body_data['list_sort_type_selected'] = $this->User_Options->get('list_sort_type');
41
42
		$this->body_data['list_sort_order'] = array_intersect_key(
43
			array(
44
				'asc'  => 'ASC',
45
				'desc' => 'DESC'
46
			),
47
			array_flip(array_values($this->User_Options->options['list_sort_order']['valid_options']))
48
		);
49
		$this->body_data['list_sort_order_selected'] = $this->User_Options->get('list_sort_order');
50
51
		$this->_render_page('User/Dashboard');
52
	}
53
}
54