Code style fixes

This commit is contained in:
Timothy Warren 2014-08-13 22:19:00 -04:00
parent 8b6e6ddcb7
commit 5941bc2f89
8 changed files with 44 additions and 15 deletions

View File

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

View File

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

View File

@ -13,7 +13,6 @@ class Category extends MY_Controller {
parent::__construct(); parent::__construct();
$this->page->set_foot_js_group('js'); $this->page->set_foot_js_group('js');
$this->page->set_title('Categories'); $this->page->set_title('Categories');
} }
/** /**
@ -29,7 +28,9 @@ class Category extends MY_Controller {
*/ */
public function category_list() public function category_list()
{ {
$data['category'] = $this->todo->get_category_list(); $data = [
'category' => $this->todo->get_category_list()
];
$this->page->set_title("Category List"); $this->page->set_title("Category List");
$this->page->build('task/cat_list', $data); $this->page->build('task/cat_list', $data);
} }
@ -51,7 +52,9 @@ class Category extends MY_Controller {
*/ */
public function edit($cat_id) public function edit($cat_id)
{ {
$data['cat'] = $this->todo->get_category((int) $cat_id); $data = [
'cat' => $this->todo->get_category((int) $cat_id)
];
$this->page->set_title("Edit Category"); $this->page->set_title("Edit Category");
$this->page->build('task/cat_add', $data); $this->page->build('task/cat_add', $data);
} }

View File

@ -32,8 +32,9 @@ class Friend extends MY_Controller {
*/ */
public function friend_list() public function friend_list()
{ {
$data = array(); $data = [
$data['friend_list'] = $this->friend_model->get_friends(); 'friend_list' => $this->friend_model->get_friends()
];
$this->page->set_title('Friends List'); $this->page->set_title('Friends List');
$this->page->build('friend/list', $data); $this->page->build('friend/list', $data);
} }
@ -43,7 +44,9 @@ class Friend extends MY_Controller {
*/ */
public function find() public function find()
{ {
$data['results'] = null; $data = [
'results' => NULL
];
$this->page->set_title('Find Friends'); $this->page->set_title('Find Friends');
$this->page->build('friend/search', $data); $this->page->build('friend/search', $data);
} }
@ -62,7 +65,7 @@ class Friend extends MY_Controller {
*/ */
public function accept_request() public function accept_request()
{ {
$aid = xss_clean($this->input->post('aid')); $aid = $this->input->post('aid', TRUE);
$this->output->set_output($this->friend_model->accept_request($aid)); $this->output->set_output($this->friend_model->accept_request($aid));
} }
@ -71,7 +74,7 @@ class Friend extends MY_Controller {
*/ */
public function reject_request() public function reject_request()
{ {
$rid = xss_clean($this->input->post('rid')); $rid = $this->input->post('rid', TRUE);
$this->output->set_output($this->friend_model->reject_request($rid)); $this->output->set_output($this->friend_model->reject_request($rid));
} }
@ -80,7 +83,9 @@ class Friend extends MY_Controller {
*/ */
public function requests() public function requests()
{ {
$data['request_list'] = $this->friend_model->get_requests(); $data = [
'request_list' => $this->friend_model->get_requests()
];
$this->page->set_title('Friend Reqests'); $this->page->set_title('Friend Reqests');
$this->page->build('friend/requests', $data); $this->page->build('friend/requests', $data);
} }
@ -90,7 +95,9 @@ class Friend extends MY_Controller {
*/ */
public function ajax_search() public function ajax_search()
{ {
$data['results'] = $this->friend_model->find_friends(); $data = [
'results' => $this->friend_model->find_friends()
];
$this->load->view('friend/ajax_search', $data); $this->load->view('friend/ajax_search', $data);
} }

View File

@ -29,7 +29,9 @@ class Group extends MY_Controller{
*/ */
public function group_list() public function group_list()
{ {
$data['group'] = $this->todo->get_group_list((int) $this->session->userdata('uid')); $data = [
'group' => $this->todo->get_group_list((int) $this->session->userdata('uid'))
];
$this->page->set_title("Group List"); $this->page->set_title("Group List");
$this->page->build('friend/group_list', $data); $this->page->build('friend/group_list', $data);
} }
@ -83,6 +85,7 @@ class Group extends MY_Controller{
$friends_array[] = $a['user_id']; $friends_array[] = $a['user_id'];
} }
$data = array();
$data['group_name'] = $this->todo->get_group_name_by_id($group_id); $data['group_name'] = $this->todo->get_group_name_by_id($group_id);
$data['friends'] = $this->todo->get_friend_list(); $data['friends'] = $this->todo->get_friend_list();
$data['selected_friends'] = $friends_array; $data['selected_friends'] = $friends_array;

View File

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

View File

@ -36,6 +36,8 @@ class Task extends MY_Controller {
{ {
$this->page->set_title("Shared Tasks"); $this->page->set_title("Shared Tasks");
$tasks = $this->task_model->get_shared_task_list(); $tasks = $this->task_model->get_shared_task_list();
$data = array();
$data['task_list'] = $tasks; $data['task_list'] = $tasks;
$data['list_type'] = "shared"; $data['list_type'] = "shared";
@ -51,6 +53,8 @@ class Task extends MY_Controller {
{ {
$this->page->set_title("View Tasks"); $this->page->set_title("View Tasks");
$tasks = $this->task_model->get_task_list(); $tasks = $this->task_model->get_task_list();
$data = array();
$data['task_list'] = $tasks; $data['task_list'] = $tasks;
$data['list_type'] = 'active'; $data['list_type'] = 'active';
@ -84,6 +88,7 @@ class Task extends MY_Controller {
$this->pagination->initialize($config); $this->pagination->initialize($config);
$data = array();
$data['task_list'] = $tasks; $data['task_list'] = $tasks;
$data['list_type'] = 'archived'; $data['list_type'] = 'archived';
$data['pagination'] = $this->pagination->create_links(); $data['pagination'] = $this->pagination->create_links();
@ -100,6 +105,8 @@ class Task extends MY_Controller {
{ {
$this->page->set_title("Overdue Tasks"); $this->page->set_title("Overdue Tasks");
$tasks = $this->task_model->get_overdue_task_list(); $tasks = $this->task_model->get_overdue_task_list();
$data = array();
$data['task_list'] = $tasks; $data['task_list'] = $tasks;
$data['list_type'] = 'overdue'; $data['list_type'] = 'overdue';
@ -272,8 +279,10 @@ class Task extends MY_Controller {
*/ */
public function get_task_comments() public function get_task_comments()
{ {
$task_id = $this->input->get('task_id'); $task_id = (int) $this->input->get('task_id');
$data['comments'] = $this->task_model->get_task_comments($task_id); $data = [
'comments' => $this->task_model->get_task_comments($task_id)
];
$this->load->view('task/comments_view', $data); $this->load->view('task/comments_view', $data);
} }

View File

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