From 3182a76899e75bc99da855d79867ce9fcfdc5592 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Thu, 26 Apr 2012 18:09:25 -0400 Subject: Fix Table library docblocks --- system/libraries/Table.php | 52 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) (limited to 'system/libraries/Table.php') diff --git a/system/libraries/Table.php b/system/libraries/Table.php index 3777d29ff..c5c71d889 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -38,13 +38,60 @@ */ class CI_Table { + /** + * Data for table rows + * + * @var array + */ public $rows = array(); + + /** + * Data for table heading + * + * @var array + */ public $heading = array(); + + /** + * Whether or not to automatically create the table header + * + * @var bool + */ public $auto_heading = TRUE; + + /** + * Table caption + * + * @var string + */ public $caption = NULL; + + /** + * Table layout template + * + * @var array + */ public $template = NULL; + + /** + * Newline setting + * + * @var string + */ public $newline = "\n"; + + /** + * Contents of empty cells + * + * @var string + */ public $empty_cells = ''; + + /** + * Callback for custom table layout + * + * @var function + */ public $function = FALSE; /** @@ -93,7 +140,7 @@ class CI_Table { * @param mixed * @return void */ - public function set_heading() + public function set_heading($args=array()) { $args = func_get_args(); $this->heading = $this->_prep_args($args); @@ -172,7 +219,7 @@ class CI_Table { * @param mixed * @return void */ - public function add_row() + public function add_row($args = array()) { $args = func_get_args(); $this->rows[] = $this->_prep_args($args); @@ -420,6 +467,7 @@ class CI_Table { * Set table data from an array * * @param array + * @param bool * @return void */ protected function _set_from_array($data, $set_heading = TRUE) -- cgit v1.2.3-24-g4f1b From 68f098142cb71f6a57f74ce34b5f58616cc1ed2f Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Fri, 27 Apr 2012 10:38:32 -0400 Subject: Fix calendar and session libraries --- system/libraries/Table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Table.php') diff --git a/system/libraries/Table.php b/system/libraries/Table.php index c5c71d889..236129531 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -140,7 +140,7 @@ class CI_Table { * @param mixed * @return void */ - public function set_heading($args=array()) + public function set_heading($args = array()) { $args = func_get_args(); $this->heading = $this->_prep_args($args); -- cgit v1.2.3-24-g4f1b From 5645479c622eb36cf9869797896dc0921568c4a9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 17 May 2012 14:32:19 +0300 Subject: Clean up the libraries --- system/libraries/Table.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'system/libraries/Table.php') diff --git a/system/libraries/Table.php b/system/libraries/Table.php index 236129531..f844d6435 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -44,49 +44,49 @@ class CI_Table { * @var array */ public $rows = array(); - + /** * Data for table heading * * @var array */ public $heading = array(); - + /** * Whether or not to automatically create the table header * * @var bool */ public $auto_heading = TRUE; - + /** * Table caption * * @var string */ public $caption = NULL; - + /** - * Table layout template + * Table layout template * * @var array */ public $template = NULL; - + /** * Newline setting * * @var string */ public $newline = "\n"; - + /** * Contents of empty cells * * @var string */ public $empty_cells = ''; - + /** * Callback for custom table layout * -- cgit v1.2.3-24-g4f1b From d261b1e89c3d4d5191036d5a5660ef6764e593a0 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sat, 2 Jun 2012 11:12:16 +0100 Subject: Replaced `==` with `===` and `!=` with `!==` in /system/libraries --- system/libraries/Table.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'system/libraries/Table.php') diff --git a/system/libraries/Table.php b/system/libraries/Table.php index f844d6435..0f8404d85 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -169,7 +169,7 @@ class CI_Table { // will want headings from a one-dimensional array $this->auto_heading = FALSE; - if ($col_limit == 0) + if ($col_limit === 0) { return $array; } @@ -298,7 +298,7 @@ class CI_Table { } elseif (is_array($table_data)) { - $set_heading = (count($this->heading) !== 0 OR $this->auto_heading != FALSE); + $set_heading = (count($this->heading) !== 0 OR $this->auto_heading !== FALSE); $this->_set_from_array($table_data, $set_heading); } } @@ -336,7 +336,7 @@ class CI_Table { foreach ($heading as $key => $val) { - if ($key != 'data') + if ($key !== 'data') { $temp = str_replace(' 1 && count($this->heading) === 0 && $set_heading == TRUE) + if ($i++ === 0 && count($data) > 1 && count($this->heading) === 0 && $set_heading === TRUE) { $this->heading = $this->_prep_args($row); } @@ -501,7 +501,7 @@ class CI_Table { */ protected function _compile_template() { - if ($this->template == NULL) + if ($this->template === NULL) { $this->template = $this->_default_template(); return; -- cgit v1.2.3-24-g4f1b From c5536aac5752054f7f76e448d58b86407d8f574e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 1 Nov 2012 17:33:58 +0200 Subject: Manually apply PR #1594 (fixing phpdoc page-level generation/warnings) Also partially fixes issue #1295, fixes inconsistencies in some page-level docblocks and adds include checks in language files. --- system/libraries/Table.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'system/libraries/Table.php') diff --git a/system/libraries/Table.php b/system/libraries/Table.php index 0f8404d85..886fb6581 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -1,4 +1,4 @@ - Date: Mon, 3 Dec 2012 14:37:47 +0200 Subject: [ci skip] Cleaned some spaces --- system/libraries/Table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Table.php') diff --git a/system/libraries/Table.php b/system/libraries/Table.php index 886fb6581..3d53b1c00 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -527,7 +527,7 @@ class CI_Table { */ protected function _default_template() { - return array( + return array( 'table_open' => '', 'thead_open' => '', -- cgit v1.2.3-24-g4f1b