| @@ -210,10 +210,10 @@ | ||
| 210 | 210 |  { | 
| 211 | 211 | // Ensure there's a trailing slash | 
| 212 | 212 | $system_path = strtr( | 
| 213 | - rtrim($system_path, '/\\'), | |
| 214 | - '/\\', | |
| 215 | - DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR | |
| 216 | - ).DIRECTORY_SEPARATOR; | |
| 213 | + rtrim($system_path, '/\\'), | |
| 214 | + '/\\', | |
| 215 | + DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR | |
| 216 | + ).DIRECTORY_SEPARATOR; | |
| 217 | 217 | } | 
| 218 | 218 | |
| 219 | 219 | // Is the system path correct? | 
| @@ -18,7 +18,7 @@ | ||
| 18 | 18 | */ | 
| 19 | 19 | class UnitTester extends \Codeception\Actor | 
| 20 | 20 |  { | 
| 21 | - use _generated\UnitTesterActions; | |
| 21 | + use _generated\UnitTesterActions; | |
| 22 | 22 | |
| 23 | 23 | /** | 
| 24 | 24 | * Define custom actions here | 
| @@ -18,7 +18,7 @@ | ||
| 18 | 18 | */ | 
| 19 | 19 | class AcceptanceTester extends \Codeception\Actor | 
| 20 | 20 |  { | 
| 21 | - use _generated\AcceptanceTesterActions; | |
| 21 | + use _generated\AcceptanceTesterActions; | |
| 22 | 22 | |
| 23 | 23 | /** | 
| 24 | 24 | * Define custom actions here | 
| @@ -18,7 +18,7 @@ | ||
| 18 | 18 | */ | 
| 19 | 19 | class FunctionalTester extends \Codeception\Actor | 
| 20 | 20 |  { | 
| 21 | - use _generated\FunctionalTesterActions; | |
| 21 | + use _generated\FunctionalTesterActions; | |
| 22 | 22 | |
| 23 | 23 | /** | 
| 24 | 24 | * Define custom actions here | 
| @@ -9,9 +9,9 @@ | ||
| 9 | 9 | $success = FALSE; | 
| 10 | 10 |  		if(preg_match("/^[a-z0-9\\-_,:]{0,255}$/", $tag_string)) { | 
| 11 | 11 | $success = (bool) $this->db->set(['tags' => $tag_string, 'active' => 'Y', 'last_updated' => NULL]) | 
| 12 | -			                           ->where('user_id', $userID) | |
| 13 | -			                           ->where('id', $chapterID) | |
| 14 | -			                           ->update('tracker_chapters'); | |
| 12 | +									   ->where('user_id', $userID) | |
| 13 | +									   ->where('id', $chapterID) | |
| 14 | +									   ->update('tracker_chapters'); | |
| 15 | 15 | } | 
| 16 | 16 | |
| 17 | 17 |  		if($success) { | 
| @@ -7,9 +7,9 @@ discard block | ||
| 7 | 7 | |
| 8 | 8 |  	public function setByID(int $userID, int $chapterID, string $category) : bool { | 
| 9 | 9 | $success = $this->db->set(['category' => $category, 'active' => 'Y', 'last_updated' => NULL]) | 
| 10 | -		                    ->where('user_id', $userID) | |
| 11 | -		                    ->where('id', $chapterID) | |
| 12 | -		                    ->update('tracker_chapters'); | |
| 10 | +							->where('user_id', $userID) | |
| 11 | +							->where('id', $chapterID) | |
| 12 | +							->update('tracker_chapters'); | |
| 13 | 13 | |
| 14 | 14 | return (bool) $success; | 
| 15 | 15 | } | 
| @@ -40,11 +40,11 @@ discard block | ||
| 40 | 40 | |
| 41 | 41 |  	public function getUsed(int $userID) : array { | 
| 42 | 42 | $query = $this->db->distinct() | 
| 43 | -		                  ->select('category') | |
| 44 | -		                  ->from('tracker_chapters') | |
| 45 | -		                  ->where('tracker_chapters.active', 'Y') | |
| 46 | -		                  ->where('user_id', $userID) | |
| 47 | - ->get(); | |
| 43 | +						  ->select('category') | |
| 44 | +						  ->from('tracker_chapters') | |
| 45 | +						  ->where('tracker_chapters.active', 'Y') | |
| 46 | +						  ->where('user_id', $userID) | |
| 47 | + ->get(); | |
| 48 | 48 | |
| 49 | 49 | return array_column($query->result_array(), 'category'); | 
| 50 | 50 | } | 
| @@ -188,18 +188,18 @@ | ||
| 188 | 188 | //FIXME: Query duplication. | 
| 189 | 189 |  		if($this->User->id !== $userID) { | 
| 190 | 190 |  			$query = $this->db->select('value_str, value_int') | 
| 191 | -			                  ->from('user_options') | |
| 192 | -			                  ->where('user_id', $userID) | |
| 193 | -			                  ->where('name',    $option) | |
| 194 | - ->limit(1); | |
| 191 | +							  ->from('user_options') | |
| 192 | +							  ->where('user_id', $userID) | |
| 193 | +							  ->where('name',    $option) | |
| 194 | + ->limit(1); | |
| 195 | 195 | $data = $query->get()->row_array(); | 
| 196 | 196 |  		} else { | 
| 197 | 197 |  			if(!($data = $this->session->tempdata("option_{$option}"))) { | 
| 198 | 198 |  				$query = $this->db->select('value_str, value_int') | 
| 199 | -				                  ->from('user_options') | |
| 200 | -				                  ->where('user_id', $userID) | |
| 201 | -				                  ->where('name',    $option) | |
| 202 | - ->limit(1); | |
| 199 | +								  ->from('user_options') | |
| 200 | +								  ->where('user_id', $userID) | |
| 201 | +								  ->where('name',    $option) | |
| 202 | + ->limit(1); | |
| 203 | 203 | $data = $query->get()->row_array(); | 
| 204 | 204 |  				$this->session->set_tempdata("option_{$option}", $data, 3600); | 
| 205 | 205 | } | 
| @@ -40,12 +40,12 @@ | ||
| 40 | 40 | |
| 41 | 41 |  	private function _list_complete_titles() { | 
| 42 | 42 |  		$query = $this->db->select('tracker_titles.id, tracker_sites.site_class, tracker_titles.title, tracker_titles.title_url') | 
| 43 | -		                  ->from('tracker_chapters') | |
| 44 | -		                  ->join('tracker_titles', 'tracker_chapters.title_id = tracker_titles.id', 'left') | |
| 45 | -		                  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left') | |
| 46 | -		                  ->like('tracker_chapters.tags', 'complete') | |
| 47 | -		                  ->where('tracker_titles.status', 0) | |
| 48 | - ->get(); | |
| 43 | +						  ->from('tracker_chapters') | |
| 44 | +						  ->join('tracker_titles', 'tracker_chapters.title_id = tracker_titles.id', 'left') | |
| 45 | +						  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left') | |
| 46 | +						  ->like('tracker_chapters.tags', 'complete') | |
| 47 | +						  ->where('tracker_titles.status', 0) | |
| 48 | + ->get(); | |
| 49 | 49 | |
| 50 | 50 | $completeList = []; | 
| 51 | 51 |  		if($query->num_rows() > 0) { | 
| @@ -53,9 +53,9 @@ | ||
| 53 | 53 | ]; | 
| 54 | 54 | |
| 55 | 55 | $this->output | 
| 56 | -				     ->set_status_header('200') | |
| 57 | -				     ->set_content_type('application/json', 'utf-8') | |
| 58 | - ->set_output(json_encode($json)); | |
| 56 | +					 ->set_status_header('200') | |
| 57 | +					 ->set_content_type('application/json', 'utf-8') | |
| 58 | + ->set_output(json_encode($json)); | |
| 59 | 59 |  			} else { | 
| 60 | 60 | //TODO: We should probably try and have more verbose errors here. Return via JSON or something. | 
| 61 | 61 |  				$this->output->set_status_header('400', 'Unable to update?'); |