summaryrefslogtreecommitdiff
path: root/libs/plugins/function.html_table.php
diff options
context:
space:
mode:
authorUwe.Tews@googlemail.com <Uwe.Tews@googlemail.com>2014-06-06 02:40:04 +0000
committerUwe.Tews@googlemail.com <Uwe.Tews@googlemail.com>2014-06-06 02:40:04 +0000
commit425091a19f674cb3e869493c8beb85ac96ed7d42 (patch)
treee4394a276e62eee3efb222d51cb5339f4db3793b /libs/plugins/function.html_table.php
parentca6a908c833d68908c79f48b4514ffd43be4b88d (diff)
downloadsmarty-425091a19f674cb3e869493c8beb85ac96ed7d42.tar.gz
smarty-425091a19f674cb3e869493c8beb85ac96ed7d42.tar.bz2
smarty-425091a19f674cb3e869493c8beb85ac96ed7d42.zip
- fixed spelling, PHPDoc , minor errors, code cleanup
Diffstat (limited to 'libs/plugins/function.html_table.php')
-rw-r--r--libs/plugins/function.html_table.php34
1 files changed, 17 insertions, 17 deletions
diff --git a/libs/plugins/function.html_table.php b/libs/plugins/function.html_table.php
index 275f6c24..ec7ba48a 100644
--- a/libs/plugins/function.html_table.php
+++ b/libs/plugins/function.html_table.php
@@ -2,13 +2,12 @@
/**
* Smarty plugin
*
- * @package Smarty
+ * @package Smarty
* @subpackage PluginsFunction
*/
/**
* Smarty {html_table} function plugin
- *
* Type: function<br>
* Name: html_table<br>
* Date: Feb 17, 2003<br>
@@ -37,17 +36,18 @@
* {table loop=$data cols="first,second,third" tr_attr=$colors}
* </pre>
*
- * @author Monte Ohrt <monte at ohrt dot com>
- * @author credit to Messju Mohr <messju at lammfellpuschen dot de>
- * @author credit to boots <boots dot smarty at yahoo dot com>
- * @version 1.1
- * @link http://www.smarty.net/manual/en/language.function.html.table.php {html_table}
- * (Smarty online manual)
- * @param array $params parameters
- * @param Smarty_Internal_Template $template template object
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author credit to Messju Mohr <messju at lammfellpuschen dot de>
+ * @author credit to boots <boots dot smarty at yahoo dot com>
+ * @version 1.1
+ * @link http://www.smarty.net/manual/en/language.function.html.table.php {html_table}
+ * (Smarty online manual)
+ *
+ * @param array $params parameters
+ *
* @return string
*/
-function smarty_function_html_table($params, $template)
+function smarty_function_html_table($params)
{
$table_attr = 'border="1"';
$tr_attr = '';
@@ -63,7 +63,7 @@ function smarty_function_html_table($params, $template)
$loop = null;
if (!isset($params['loop'])) {
- trigger_error("html_table: missing 'loop' parameter",E_USER_WARNING);
+ trigger_error("html_table: missing 'loop' parameter", E_USER_WARNING);
return;
}
@@ -130,7 +130,7 @@ function smarty_function_html_table($params, $template)
$cols = ($hdir == 'right') ? $cols : array_reverse($cols);
$output .= "<thead><tr>\n";
- for ($r = 0; $r < $cols_count; $r++) {
+ for ($r = 0; $r < $cols_count; $r ++) {
$output .= '<th' . smarty_function_html_table_cycle('th', $th_attr, $r) . '>';
$output .= $cols[$r];
$output .= "</th>\n";
@@ -139,12 +139,12 @@ function smarty_function_html_table($params, $template)
}
$output .= "<tbody>\n";
- for ($r = 0; $r < $rows; $r++) {
+ for ($r = 0; $r < $rows; $r ++) {
$output .= "<tr" . smarty_function_html_table_cycle('tr', $tr_attr, $r) . ">\n";
- $rx = ($vdir == 'down') ? $r * $cols_count : ($rows-1 - $r) * $cols_count;
+ $rx = ($vdir == 'down') ? $r * $cols_count : ($rows - 1 - $r) * $cols_count;
- for ($c = 0; $c < $cols_count; $c++) {
- $x = ($hdir == 'right') ? $rx + $c : $rx + $cols_count-1 - $c;
+ for ($c = 0; $c < $cols_count; $c ++) {
+ $x = ($hdir == 'right') ? $rx + $c : $rx + $cols_count - 1 - $c;
if ($inner != 'cols') {
/* shuffle x to loop over rows*/
$x = floor($x / $cols_count) + ($x % $cols_count) * $rows;