Browse Source

Code style fixes

Timothy J. Warren 3 years ago
parent
commit
5941bc2f89

+ 3 - 1
application/controllers/account.php View File

@@ -51,7 +51,9 @@ class Account extends MY_Controller {
51 51
 			}
52 52
 			else
53 53
 			{
54
-				$data['err'] = $val;
54
+				$data = [
55
+					'err' => $val
56
+				];
55 57
 				$this->page->build('account/password', $data);
56 58
 			}
57 59
 		}

+ 2 - 0
application/controllers/calendar.php View File

@@ -58,6 +58,8 @@ class Calendar extends MY_Controller {
58 58
 
59 59
 		$local_time = time();
60 60
 
61
+		$data = array();
62
+
61 63
 		$data['month'] = $_months[(int)$month].' '.$year;
62 64
 		$data['calendar'] = array();
63 65
 		$data['today'] = getdate();

+ 6 - 3
application/controllers/category.php View File

@@ -13,7 +13,6 @@ class Category extends MY_Controller {
13 13
 		parent::__construct();
14 14
 		$this->page->set_foot_js_group('js');
15 15
 		$this->page->set_title('Categories');
16
-
17 16
 	}
18 17
 
19 18
 	/**
@@ -29,7 +28,9 @@ class Category extends MY_Controller {
29 28
 	 */
30 29
 	public function category_list()
31 30
 	{
32
-		$data['category'] = $this->todo->get_category_list();
31
+		$data = [
32
+			'category' => $this->todo->get_category_list()
33
+		];
33 34
 		$this->page->set_title("Category List");
34 35
 		$this->page->build('task/cat_list', $data);
35 36
 	}
@@ -51,7 +52,9 @@ class Category extends MY_Controller {
51 52
 	 */
52 53
 	public function edit($cat_id)
53 54
 	{
54
-		$data['cat'] = $this->todo->get_category((int) $cat_id);
55
+		$data = [
56
+			'cat' => $this->todo->get_category((int) $cat_id)
57
+		];
55 58
 		$this->page->set_title("Edit Category");
56 59
 		$this->page->build('task/cat_add', $data);
57 60
 	}

+ 14 - 7
application/controllers/friend.php View File

@@ -32,8 +32,9 @@ class Friend extends MY_Controller {
32 32
 	 */
33 33
 	public function friend_list()
34 34
 	{
35
-		$data = array();
36
-		$data['friend_list'] = $this->friend_model->get_friends();
35
+		$data = [
36
+			'friend_list' => $this->friend_model->get_friends()
37
+		];
37 38
 		$this->page->set_title('Friends List');
38 39
 		$this->page->build('friend/list', $data);
39 40
 	}
@@ -43,7 +44,9 @@ class Friend extends MY_Controller {
43 44
 	 */
44 45
 	public function find()
45 46
 	{
46
-		$data['results'] = null;
47
+		$data = [
48
+			'results' => NULL
49
+		];
47 50
 		$this->page->set_title('Find Friends');
48 51
 		$this->page->build('friend/search', $data);
49 52
 	}
@@ -62,7 +65,7 @@ class Friend extends MY_Controller {
62 65
 	 */
63 66
 	public function accept_request()
64 67
 	{
65
-		$aid = xss_clean($this->input->post('aid'));
68
+		$aid = $this->input->post('aid', TRUE);
66 69
 		$this->output->set_output($this->friend_model->accept_request($aid));
67 70
 	}
68 71
 
@@ -71,7 +74,7 @@ class Friend extends MY_Controller {
71 74
 	 */
72 75
 	public function reject_request()
73 76
 	{
74
-		$rid = xss_clean($this->input->post('rid'));
77
+		$rid = $this->input->post('rid', TRUE);
75 78
 		$this->output->set_output($this->friend_model->reject_request($rid));
76 79
 	}
77 80
 
@@ -80,7 +83,9 @@ class Friend extends MY_Controller {
80 83
 	 */
81 84
 	public function requests()
82 85
 	{
83
-		$data['request_list'] = $this->friend_model->get_requests();
86
+		$data = [
87
+			'request_list' =>  $this->friend_model->get_requests()
88
+		];
84 89
 		$this->page->set_title('Friend Reqests');
85 90
 		$this->page->build('friend/requests', $data);
86 91
 	}
@@ -90,7 +95,9 @@ class Friend extends MY_Controller {
90 95
 	 */
91 96
 	public function ajax_search()
92 97
 	{
93
-		$data['results'] = $this->friend_model->find_friends();
98
+		$data = [
99
+			'results' => $this->friend_model->find_friends()
100
+		];
94 101
 		$this->load->view('friend/ajax_search', $data);
95 102
 	}
96 103
 	

+ 4 - 1
application/controllers/group.php View File

@@ -29,7 +29,9 @@ class Group extends MY_Controller{
29 29
 	 */
30 30
 	public function group_list()
31 31
 	{
32
-		$data['group'] = $this->todo->get_group_list((int) $this->session->userdata('uid'));
32
+		$data = [
33
+			'group' => $this->todo->get_group_list((int) $this->session->userdata('uid'))
34
+		];
33 35
 		$this->page->set_title("Group List");
34 36
 		$this->page->build('friend/group_list', $data);
35 37
 	}
@@ -83,6 +85,7 @@ class Group extends MY_Controller{
83 85
 			$friends_array[] = $a['user_id'];
84 86
 		}
85 87
 
88
+		$data = array();
86 89
 		$data['group_name'] = $this->todo->get_group_name_by_id($group_id);
87 90
 		$data['friends'] = $this->todo->get_friend_list();
88 91
 		$data['selected_friends'] = $friends_array;

+ 3 - 1
application/controllers/login.php View File

@@ -38,7 +38,9 @@ class Login extends MY_Controller {
38 38
 	 */
39 39
 	public function do_login()
40 40
 	{
41
-		$data['err'] = array();
41
+		$data = [
42
+			'err' => array()
43
+		];
42 44
 
43 45
 		if($this->input->post('login_sub') != FALSE)
44 46
 		{

+ 11 - 2
application/controllers/task.php View File

@@ -36,6 +36,8 @@ class Task extends MY_Controller {
36 36
 	{
37 37
 		$this->page->set_title("Shared Tasks");
38 38
 		$tasks = $this->task_model->get_shared_task_list();
39
+
40
+		$data = array();
39 41
 		$data['task_list'] = $tasks;
40 42
 		$data['list_type'] = "shared";
41 43
 
@@ -51,6 +53,8 @@ class Task extends MY_Controller {
51 53
 	{
52 54
 		$this->page->set_title("View Tasks");
53 55
 		$tasks = $this->task_model->get_task_list();
56
+
57
+		$data = array();
54 58
 		$data['task_list'] = $tasks;
55 59
 		$data['list_type'] = 'active';
56 60
 
@@ -84,6 +88,7 @@ class Task extends MY_Controller {
84 88
 
85 89
 		$this->pagination->initialize($config);
86 90
 
91
+		$data = array();
87 92
 		$data['task_list'] = $tasks;
88 93
 		$data['list_type'] = 'archived';
89 94
 		$data['pagination'] = $this->pagination->create_links();
@@ -100,6 +105,8 @@ class Task extends MY_Controller {
100 105
 	{
101 106
 		$this->page->set_title("Overdue Tasks");
102 107
 		$tasks = $this->task_model->get_overdue_task_list();
108
+
109
+		$data = array();
103 110
 		$data['task_list'] = $tasks;
104 111
 		$data['list_type'] = 'overdue';
105 112
 
@@ -272,8 +279,10 @@ class Task extends MY_Controller {
272 279
 	 */
273 280
 	public function get_task_comments()
274 281
 	{
275
-		$task_id = $this->input->get('task_id');
276
-		$data['comments'] = $this->task_model->get_task_comments($task_id);
282
+		$task_id = (int) $this->input->get('task_id');
283
+		$data = [
284
+			'comments' => $this->task_model->get_task_comments($task_id)
285
+		];
277 286
 		$this->load->view('task/comments_view', $data);
278 287
 	}
279 288
 

+ 1 - 0
application/libraries/Page.php View File

@@ -287,6 +287,7 @@ class Page {
287 287
 	 */
288 288
 	public function set_message($type, $message, $return = FALSE)
289 289
 	{
290
+		$data = array();
290 291
 		$data['stat_type'] = $type;
291 292
 		$data['message'] = $message;
292 293