@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | case 'csv': |
| 33 | 33 | $this->output->set_content_type('text/csv', 'utf-8'); |
| 34 | - $this->_render_content($this->arrayToCSVRecursive($historyData), 'csv',TRUE, 'tracker-history'); |
|
| 34 | + $this->_render_content($this->arrayToCSVRecursive($historyData), 'csv', TRUE, 'tracker-history'); |
|
| 35 | 35 | break; |
| 36 | 36 | |
| 37 | 37 | default: |
@@ -50,15 +50,15 @@ discard block |
||
| 50 | 50 | $enclosure_esc = preg_quote($enclosure, '/'); |
| 51 | 51 | |
| 52 | 52 | $output = array(); |
| 53 | - foreach ($fields as $field) { |
|
| 54 | - if ($field === NULL && $nullToMysqlNull) { |
|
| 53 | + foreach($fields as $field) { |
|
| 54 | + if($field === NULL && $nullToMysqlNull) { |
|
| 55 | 55 | $output[] = 'NULL'; |
| 56 | 56 | continue; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | // Enclose fields containing $delimiter, $enclosure or whitespace |
| 60 | - if ($encloseAll || preg_match("/(?:${delimiter_esc}|${enclosure_esc}|\s)/", $field)) { |
|
| 61 | - $output[] = $enclosure . str_replace($enclosure, $enclosure . $enclosure, $field) . $enclosure; |
|
| 60 | + if($encloseAll || preg_match("/(?:${delimiter_esc}|${enclosure_esc}|\s)/", $field)) { |
|
| 61 | + $output[] = $enclosure.str_replace($enclosure, $enclosure.$enclosure, $field).$enclosure; |
|
| 62 | 62 | } else { |
| 63 | 63 | $output[] = $field; |
| 64 | 64 | } |
@@ -70,10 +70,10 @@ discard block |
||
| 70 | 70 | $csvArr = [ |
| 71 | 71 | 'Date/Time,Title,URL,Site,Status' |
| 72 | 72 | ]; |
| 73 | - foreach ($fields as $field) { |
|
| 74 | - $csvArr[] = $this->arrayToCSV($field, $delimiter, $enclosure,$encloseAll,$nullToMysqlNull); |
|
| 73 | + foreach($fields as $field) { |
|
| 74 | + $csvArr[] = $this->arrayToCSV($field, $delimiter, $enclosure, $encloseAll, $nullToMysqlNull); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - return implode(PHP_EOL,$csvArr); |
|
| 77 | + return implode(PHP_EOL, $csvArr); |
|
| 78 | 78 | } |
| 79 | 79 | } |
@@ -6,7 +6,9 @@ discard block |
||
| 6 | 6 | } |
| 7 | 7 | |
| 8 | 8 | public function index(int $page = 1) { |
| 9 | - if($page === 0) redirect('user/history/1'); |
|
| 9 | + if($page === 0) { |
|
| 10 | + redirect('user/history/1'); |
|
| 11 | + } |
|
| 10 | 12 | |
| 11 | 13 | $this->header_data['title'] = "History"; |
| 12 | 14 | $this->header_data['page'] = "history"; |
@@ -16,7 +18,9 @@ discard block |
||
| 16 | 18 | $this->body_data['currentPage'] = (int) $page; |
| 17 | 19 | $this->body_data['totalPages'] = $historyData['totalPages']; |
| 18 | 20 | |
| 19 | - if($page > $this->body_data['totalPages'] && $page <= 1) redirect('user/history/1'); |
|
| 21 | + if($page > $this->body_data['totalPages'] && $page <= 1) { |
|
| 22 | + redirect('user/history/1'); |
|
| 23 | + } |
|
| 20 | 24 | |
| 21 | 25 | $this->_render_page('User/History'); |
| 22 | 26 | } |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | protected $footer_data = array(); |
| 7 | 7 | public $global_data = array(); |
| 8 | 8 | |
| 9 | - public function __construct(){ |
|
| 9 | + public function __construct() { |
|
| 10 | 10 | parent::__construct(); |
| 11 | 11 | |
| 12 | 12 | $this->load->driver('cache', array('adapter' => 'file', 'backup' => 'apc')); //Sadly we can't autoload this with params |
@@ -20,10 +20,10 @@ discard block |
||
| 20 | 20 | $this->global_data['analytics_tracking_id'] = $this->config->item('tracking_id'); |
| 21 | 21 | |
| 22 | 22 | $css_path = "css/main.{$this->User_Options->get('theme')}"; |
| 23 | - $this->global_data['complied_css_path'] = asset_url()."{$css_path}.".filemtime(APPPATH . "../public/assets/{$css_path}.css").".css"; |
|
| 23 | + $this->global_data['complied_css_path'] = asset_url()."{$css_path}.".filemtime(APPPATH."../public/assets/{$css_path}.css").".css"; |
|
| 24 | 24 | |
| 25 | 25 | $js_path = 'js/compiled.min'; |
| 26 | - $this->global_data['complied_js_path'] = asset_url()."{$js_path}.".filemtime(APPPATH . "../public/assets/{$js_path}.js").".js"; |
|
| 26 | + $this->global_data['complied_js_path'] = asset_url()."{$js_path}.".filemtime(APPPATH."../public/assets/{$js_path}.js").".js"; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | public function _render_page(/*(array) $paths*/) { |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $json = is_array($json_input) ? json_encode($json_input) : $json_input; |
| 48 | 48 | |
| 49 | 49 | $this->output->set_content_type('application/json', 'utf-8'); |
| 50 | - $this->_render_content($json,'json', $download, $filenamePrefix); |
|
| 50 | + $this->_render_content($json, 'json', $download, $filenamePrefix); |
|
| 51 | 51 | } |
| 52 | 52 | public function _render_content(string $content, string $filenameExt, bool $download = FALSE, string $filenamePrefix = 'tracker') : void { |
| 53 | 53 | if($download) { |