From: <var...@us...> - 2009-01-02 10:54:06
|
Revision: 6362 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6362&view=rev Author: vargenau Date: 2009-01-02 10:54:00 +0000 (Fri, 02 Jan 2009) Log Message: ----------- No trigger_error Modified Paths: -------------- trunk/lib/plugin/WikicreoleTable.php Modified: trunk/lib/plugin/WikicreoleTable.php =================================================================== --- trunk/lib/plugin/WikicreoleTable.php 2009-01-01 20:15:34 UTC (rev 6361) +++ trunk/lib/plugin/WikicreoleTable.php 2009-01-02 10:54:00 UTC (rev 6362) @@ -89,7 +89,7 @@ $line = substr($line, 0, -1); } if ($line[0] != '|') { - trigger_error(sprintf(_("Line %s does not begin with a '|'."), $line), E_USER_WARNING); + // trigger_error(sprintf(_("Line %s does not begin with a '|'."), $line), E_USER_WARNING); } else { $table->pushContent($this->_parse_row($line, $basepage)); } @@ -120,11 +120,6 @@ } } -// $Log: not supported by cvs2svn $ -// Revision 1.1 2008/08/19 17:58:25 vargenau -// Implement Wikicreole syntax for tables -// - // For emacs users // Local Variables: // mode: php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-01-02 11:04:12
|
Revision: 6363 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6363&view=rev Author: vargenau Date: 2009-01-02 11:04:05 +0000 (Fri, 02 Jan 2009) Log Message: ----------- Add spreadsheet capability to Wikicreole tables Modified Paths: -------------- trunk/lib/plugin/WikicreoleTable.php Modified: trunk/lib/plugin/WikicreoleTable.php =================================================================== --- trunk/lib/plugin/WikicreoleTable.php 2009-01-02 10:54:00 UTC (rev 6362) +++ trunk/lib/plugin/WikicreoleTable.php 2009-01-02 11:04:05 UTC (rev 6363) @@ -75,7 +75,7 @@ global $WikiTheme; include_once('lib/InlineParser.php'); - $table = HTML::table(array('class' => "bordered")); + $table = array(); $lines = preg_split('/\s*?\n\s*/', $argstr); @@ -84,18 +84,42 @@ continue; } $line = trim($line); - // If lines ends with a '|', remove it + // If line ends with a '|', remove it if ($line[strlen($line)-1] == '|') { $line = substr($line, 0, -1); } if ($line[0] != '|') { // trigger_error(sprintf(_("Line %s does not begin with a '|'."), $line), E_USER_WARNING); } else { - $table->pushContent($this->_parse_row($line, $basepage)); + $table[] = $this->_parse_row($line, $basepage); } } - return $table; + $nbrows = sizeof($table); + $nbcols = sizeof($table[0]); + + for ($i=0; $i<$nbrows; $i++) { + for ($j=0; $j<$nbcols; $j++) { + if ($table[$i][$j][0] == '@') { + $table[$i][$j] = $this->_compute($table, $i, $j, $nbrows, $nbcols); + } + } + } + + $htmltable = HTML::table(array('class' => "bordered")); + foreach ($table as $row) { + $htmlrow = HTML::tr(); + foreach ($row as $cell) { + if ($cell[0] == '=') { + $cell = trim(substr($cell, 1)); + $htmlrow->pushContent(HTML::th(TransformInline($cell, 2.0, $basepage))); + } else { + $htmlrow->pushContent(HTML::td(TransformInline($cell, 2.0, $basepage))); + } + } + $htmltable->pushContent($htmlrow); + } + return $htmltable; } function _parse_row ($line, $basepage) { @@ -105,19 +129,34 @@ preg_match_all("/(\\|+) \s* ($cell_content) \s* (?=\\||\$)/x", $line, $matches, PREG_SET_ORDER); - $row = HTML::tr(); + $row = array(); foreach ($matches as $m) { $cell = $m[2]; - if ($cell[0] == '=') { - $cell = trim(substr($cell, 1)); - $row->pushContent(HTML::th(TransformInline($cell, 2.0, $basepage))); - } else { - $row->pushContent(HTML::td(TransformInline($cell, 2.0, $basepage))); - } + $row[]= $cell; } return $row; } + + function _compute ($mytable, $i, $j, $imax, $jmax) { + + // What is implemented: + // @@SUM(R)@@ : sum of cells in current row + // @@SUM(C)@@ : sum of cells in current column + + $result=0; + if (trim($mytable[$i][$j]) == "@@SUM(C)@@") { + for ($index=0; $index<$imax; $index++) { + $result += $mytable[$index][$j]; + } + } + if (trim($mytable[$i][$j]) == "@@SUM(R)@@") { + for ($index=0; $index<$jmax; $index++) { + $result += $mytable[$i][$index]; + } + } + return $result; + } } // For emacs users This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-01-09 09:56:17
|
Revision: 6386 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6386&view=rev Author: vargenau Date: 2009-01-09 09:56:12 +0000 (Fri, 09 Jan 2009) Log Message: ----------- Numeric cells are right-aligned by default Modified Paths: -------------- trunk/lib/plugin/WikicreoleTable.php Modified: trunk/lib/plugin/WikicreoleTable.php =================================================================== --- trunk/lib/plugin/WikicreoleTable.php 2009-01-08 15:26:25 UTC (rev 6385) +++ trunk/lib/plugin/WikicreoleTable.php 2009-01-09 09:56:12 UTC (rev 6386) @@ -6,7 +6,7 @@ syntax. */ /* - * Copyright (C) 2008 Alcatel-Lucent + * Copyright (C) 2008-2009 Alcatel-Lucent * * This file is part of PhpWiki. * @@ -114,7 +114,11 @@ $cell = trim(substr($cell, 1)); $htmlrow->pushContent(HTML::th(TransformInline($cell, 2.0, $basepage))); } else { - $htmlrow->pushContent(HTML::td(TransformInline($cell, 2.0, $basepage))); + if (is_numeric($cell)) { + $htmlrow->pushContent(HTML::td(array('style' => "text-align:right"), $cell)); + } else { + $htmlrow->pushContent(HTML::td(TransformInline($cell, 2.0, $basepage))); + } } } $htmltable->pushContent($htmlrow); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-01-12 15:44:58
|
Revision: 6393 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6393&view=rev Author: vargenau Date: 2009-01-12 15:44:50 +0000 (Mon, 12 Jan 2009) Log Message: ----------- Match for @@ Modified Paths: -------------- trunk/lib/plugin/WikicreoleTable.php Modified: trunk/lib/plugin/WikicreoleTable.php =================================================================== --- trunk/lib/plugin/WikicreoleTable.php 2009-01-11 17:47:52 UTC (rev 6392) +++ trunk/lib/plugin/WikicreoleTable.php 2009-01-12 15:44:50 UTC (rev 6393) @@ -100,7 +100,7 @@ for ($i=0; $i<$nbrows; $i++) { for ($j=0; $j<$nbcols; $j++) { - if ($table[$i][$j][0] == '@') { + if (preg_match('/@@/', $table[$i][$j])) { $table[$i][$j] = compute_tablecell($table, $i, $j, $nbrows, $nbcols); } } @@ -110,7 +110,7 @@ foreach ($table as $row) { $htmlrow = HTML::tr(); foreach ($row as $cell) { - if ($cell[0] == '=') { + if ($cell && $cell[0] == '=') { $cell = trim(substr($cell, 1)); $htmlrow->pushContent(HTML::th(TransformInline($cell, 2.0, $basepage))); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-02-26 12:58:12
|
Revision: 6574 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6574&view=rev Author: vargenau Date: 2009-02-26 12:45:55 +0000 (Thu, 26 Feb 2009) Log Message: ----------- Do not count columns if table is empty Modified Paths: -------------- trunk/lib/plugin/WikicreoleTable.php Modified: trunk/lib/plugin/WikicreoleTable.php =================================================================== --- trunk/lib/plugin/WikicreoleTable.php 2009-02-26 12:35:15 UTC (rev 6573) +++ trunk/lib/plugin/WikicreoleTable.php 2009-02-26 12:45:55 UTC (rev 6574) @@ -96,12 +96,11 @@ } $nbrows = sizeof($table); - $nbcols = sizeof($table[0]); - // If table is empty, do not generate table markup if ($nbrows == 0) { return HTML::raw(''); } + $nbcols = sizeof($table[0]); for ($i=0; $i<$nbrows; $i++) { for ($j=0; $j<$nbcols; $j++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-02-26 13:22:58
|
Revision: 6573 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6573&view=rev Author: vargenau Date: 2009-02-26 12:35:15 +0000 (Thu, 26 Feb 2009) Log Message: ----------- If table is empty, do not generate table markup Modified Paths: -------------- trunk/lib/plugin/WikicreoleTable.php Modified: trunk/lib/plugin/WikicreoleTable.php =================================================================== --- trunk/lib/plugin/WikicreoleTable.php 2009-02-26 10:50:44 UTC (rev 6572) +++ trunk/lib/plugin/WikicreoleTable.php 2009-02-26 12:35:15 UTC (rev 6573) @@ -98,6 +98,11 @@ $nbrows = sizeof($table); $nbcols = sizeof($table[0]); + // If table is empty, do not generate table markup + if ($nbrows == 0) { + return HTML::raw(''); + } + for ($i=0; $i<$nbrows; $i++) { for ($j=0; $j<$nbcols; $j++) { if (preg_match('/@@/', $table[$i][$j])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-01-07 08:51:15
|
Revision: 7815 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7815&view=rev Author: vargenau Date: 2011-01-07 08:51:09 +0000 (Fri, 07 Jan 2011) Log Message: ----------- Remove commented code Modified Paths: -------------- trunk/lib/plugin/WikicreoleTable.php Modified: trunk/lib/plugin/WikicreoleTable.php =================================================================== --- trunk/lib/plugin/WikicreoleTable.php 2011-01-05 16:57:05 UTC (rev 7814) +++ trunk/lib/plugin/WikicreoleTable.php 2011-01-07 08:51:09 UTC (rev 7815) @@ -1,7 +1,7 @@ <?php // -*-php-*- -// rcs_id('$Id$'); +// $Id$ /* - * Copyright (C) 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent + * Copyright (C) 2008-2009, 2011 Marc-Etienne Vargenau, Alcatel-Lucent * * This file is part of PhpWiki. * @@ -84,9 +84,7 @@ if ($line[strlen($line)-1] == '|') { $line = substr($line, 0, -1); } - if ($line[0] != '|') { - // trigger_error(sprintf(_("Line %s does not begin with a '|'."), $line), E_USER_WARNING); - } else { + if ($line[0] == '|') { $table[] = $this->_parse_row($line, $basepage); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-01-07 09:30:20
|
Revision: 7816 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7816&view=rev Author: vargenau Date: 2011-01-07 09:30:14 +0000 (Fri, 07 Jan 2011) Log Message: ----------- Better handle tables with uneven number of columns Modified Paths: -------------- trunk/lib/plugin/WikicreoleTable.php Modified: trunk/lib/plugin/WikicreoleTable.php =================================================================== --- trunk/lib/plugin/WikicreoleTable.php 2011-01-07 08:51:09 UTC (rev 7815) +++ trunk/lib/plugin/WikicreoleTable.php 2011-01-07 09:30:14 UTC (rev 7816) @@ -94,11 +94,18 @@ if ($nbrows == 0) { return HTML::raw(''); } - $nbcols = sizeof($table[0]); + // Number of columns is the number of cells in the longer row + $nbcols = 0; for ($i=0; $i<$nbrows; $i++) { + $nbcols = max($nbcols, sizeof($table[$i])); + } + + for ($i=0; $i<$nbrows; $i++) { for ($j=0; $j<$nbcols; $j++) { - if (preg_match('/@@/', $table[$i][$j])) { + if (!isset($table[$i][$j])) { + $table[$i][$j] = ''; + } else if (preg_match('/@@/', $table[$i][$j])) { $table[$i][$j] = compute_tablecell($table, $i, $j, $nbrows, $nbcols); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-03-15 14:37:47
|
Revision: 8250 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8250&view=rev Author: vargenau Date: 2012-03-15 14:37:36 +0000 (Thu, 15 Mar 2012) Log Message: ----------- Remove unused argument Modified Paths: -------------- trunk/lib/plugin/WikicreoleTable.php Modified: trunk/lib/plugin/WikicreoleTable.php =================================================================== --- trunk/lib/plugin/WikicreoleTable.php 2012-03-15 14:36:26 UTC (rev 8249) +++ trunk/lib/plugin/WikicreoleTable.php 2012-03-15 14:37:36 UTC (rev 8250) @@ -84,7 +84,7 @@ $line = substr($line, 0, -1); } if ($line[0] == '|') { - $table[] = $this->_parse_row($line, $basepage); + $table[] = $this->_parse_row($line); } } @@ -130,7 +130,7 @@ return $htmltable; } - function _parse_row ($line, $basepage) { + function _parse_row ($line) { $brkt_link = "\\[ .*? [^]\s] .*? \\]"; $cell_content = "(?: [^[] | ".ESCAPE_CHAR."\\[ | $brkt_link )*?"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2013-04-16 14:55:36
|
Revision: 8754 http://sourceforge.net/p/phpwiki/code/8754 Author: vargenau Date: 2013-04-16 14:55:33 +0000 (Tue, 16 Apr 2013) Log Message: ----------- No underscore for private parse_row function Modified Paths: -------------- trunk/lib/plugin/WikicreoleTable.php Modified: trunk/lib/plugin/WikicreoleTable.php =================================================================== --- trunk/lib/plugin/WikicreoleTable.php 2013-04-16 14:42:30 UTC (rev 8753) +++ trunk/lib/plugin/WikicreoleTable.php 2013-04-16 14:55:33 UTC (rev 8754) @@ -89,7 +89,7 @@ $line = substr($line, 0, -1); } if ($line[0] == '|') { - $table[] = $this->_parse_row($line); + $table[] = $this->parse_row($line); } } @@ -135,7 +135,7 @@ return $htmltable; } - private function _parse_row($line) + private function parse_row($line) { $brkt_link = "\\[ .*? [^]\s] .*? \\]"; $cell_content = "(?: [^[] | " . ESCAPE_CHAR . "\\[ | $brkt_link )*?"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2013-04-16 15:42:24
|
Revision: 8759 http://sourceforge.net/p/phpwiki/code/8759 Author: vargenau Date: 2013-04-16 15:42:21 +0000 (Tue, 16 Apr 2013) Log Message: ----------- No underscore for private function Modified Paths: -------------- trunk/lib/plugin/WikicreoleTable.php Modified: trunk/lib/plugin/WikicreoleTable.php =================================================================== --- trunk/lib/plugin/WikicreoleTable.php 2013-04-16 15:32:54 UTC (rev 8758) +++ trunk/lib/plugin/WikicreoleTable.php 2013-04-16 15:42:21 UTC (rev 8759) @@ -93,52 +93,52 @@ } } - $nbrows = sizeof($table); + $nb_rows = sizeof($table); // If table is empty, do not generate table markup - if ($nbrows == 0) { + if ($nb_rows == 0) { return HTML::raw(''); } // Number of columns is the number of cells in the longer row - $nbcols = 0; - for ($i = 0; $i < $nbrows; $i++) { - $nbcols = max($nbcols, sizeof($table[$i])); + $nb_cols = 0; + for ($i = 0; $i < $nb_rows; $i++) { + $nb_cols = max($nb_cols, sizeof($table[$i])); } - for ($i = 0; $i < $nbrows; $i++) { - for ($j = 0; $j < $nbcols; $j++) { + for ($i = 0; $i < $nb_rows; $i++) { + for ($j = 0; $j < $nb_cols; $j++) { if (!isset($table[$i][$j])) { $table[$i][$j] = ''; } elseif (preg_match('/@@/', $table[$i][$j])) { - $table[$i][$j] = $this->_compute_tablecell($table, $i, $j, $nbrows, $nbcols); + $table[$i][$j] = $this->compute_table_cell($table, $i, $j, $nb_rows, $nb_cols); } } } - $htmltable = HTML::table(array('class' => "bordered")); + $html_table = HTML::table(array('class' => "bordered")); foreach ($table as $row) { - $htmlrow = HTML::tr(); + $html_row = HTML::tr(); foreach ($row as $cell) { if ($cell && $cell[0] == '=') { $cell = trim(substr($cell, 1)); - $htmlrow->pushContent(HTML::th(TransformInline($cell, 2.0, $basepage))); + $html_row->pushContent(HTML::th(TransformInline($cell, 2.0, $basepage))); } else { if (is_numeric($cell)) { - $htmlrow->pushContent(HTML::td(array('style' => "text-align:right"), $cell)); + $html_row->pushContent(HTML::td(array('style' => "text-align:right"), $cell)); } else { - $htmlrow->pushContent(HTML::td(TransformInline($cell, 2.0, $basepage))); + $html_row->pushContent(HTML::td(TransformInline($cell, 2.0, $basepage))); } } } - $htmltable->pushContent($htmlrow); + $html_table->pushContent($html_row); } - return $htmltable; + return $html_table; } private function parse_row($line) { - $brkt_link = "\\[ .*? [^]\s] .*? \\]"; - $cell_content = "(?: [^[] | " . ESCAPE_CHAR . "\\[ | $brkt_link )*?"; + $bracket_link = "\\[ .*? [^]\s] .*? \\]"; + $cell_content = "(?: [^[] | " . ESCAPE_CHAR . "\\[ | $bracket_link )*?"; preg_match_all("/(\\|+) \s* ($cell_content) \s* (?=\\||\$)/x", $line, $matches, PREG_SET_ORDER); @@ -158,7 +158,7 @@ * $i and $j: indexes of cell to compute * $imax and $jmax: table dimensions */ - private function _compute_tablecell($table, $i, $j, $imax, $jmax) + private function compute_table_cell($table, $i, $j, $imax, $jmax) { // What is implemented: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-03-04 10:00:32
|
Revision: 8851 http://sourceforge.net/p/phpwiki/code/8851 Author: vargenau Date: 2014-03-04 10:00:28 +0000 (Tue, 04 Mar 2014) Log Message: ----------- Allow bold, italics or underlined for numbers Modified Paths: -------------- trunk/lib/plugin/WikicreoleTable.php Modified: trunk/lib/plugin/WikicreoleTable.php =================================================================== --- trunk/lib/plugin/WikicreoleTable.php 2014-01-28 17:10:36 UTC (rev 8850) +++ trunk/lib/plugin/WikicreoleTable.php 2014-03-04 10:00:28 UTC (rev 8851) @@ -118,8 +118,8 @@ $cell = trim(substr($cell, 1)); $html_row->pushContent(HTML::th(TransformInline($cell, $basepage))); } else { - if (is_numeric($cell)) { - $html_row->pushContent(HTML::td(array('style' => "text-align:right"), $cell)); + if ($this->is_wiki_numeric($cell)) { + $html_row->pushContent(HTML::td(array('style' => "text-align:right"), TransformInline($cell, $basepage))); } else { $html_row->pushContent(HTML::td(TransformInline($cell, $basepage))); } @@ -130,6 +130,12 @@ return $html_table; } + // $cell is a number, possibly in bold, italics or underlined + private function is_wiki_numeric($cell) + { + return is_numeric(trim($cell, "*/_'")); + } + private function parse_row($line) { $bracket_link = "\\[ .*? [^]\s] .*? \\]"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-09-16 08:17:34
|
Revision: 9081 http://sourceforge.net/p/phpwiki/code/9081 Author: vargenau Date: 2014-09-16 08:17:23 +0000 (Tue, 16 Sep 2014) Log Message: ----------- Wicreole tables: better handle completely empty cells; allow COUNT in headers Modified Paths: -------------- trunk/lib/plugin/WikicreoleTable.php Modified: trunk/lib/plugin/WikicreoleTable.php =================================================================== --- trunk/lib/plugin/WikicreoleTable.php 2014-09-16 08:14:33 UTC (rev 9080) +++ trunk/lib/plugin/WikicreoleTable.php 2014-09-16 08:17:23 UTC (rev 9081) @@ -138,6 +138,8 @@ private function parse_row($line) { + $line = str_replace('|', ' |', $line); + $bracket_link = "\\[ .*? [^]\s] .*? \\]"; $cell_content = "(?: [^[] | " . ESCAPE_CHAR . "\\[ | $bracket_link )*?"; @@ -287,7 +289,11 @@ $counter++; } } - $result = $counter - 1; // exclude self + if (string_starts_with(trim($table[$i][$j]), "=")) { + $result = $counter; + } else { + $result = $counter - 1; // exclude self + } return str_replace("@@=COUNT(C)@@", $result, $table[$i][$j]); } elseif (strpos($table[$i][$j], "@@=COUNT(R)@@") !== false) { @@ -297,7 +303,11 @@ $counter++; } } - $result = $counter - 1; // exclude self + if (string_starts_with(trim($table[$i][$j]), "=")) { + $result = $counter; + } else { + $result = $counter - 1; // exclude self + } return str_replace("@@=COUNT(R)@@", $result, $table[$i][$j]); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-09-17 08:39:27
|
Revision: 9083 http://sourceforge.net/p/phpwiki/code/9083 Author: vargenau Date: 2014-09-17 08:39:16 +0000 (Wed, 17 Sep 2014) Log Message: ----------- Update PHP Doc Modified Paths: -------------- trunk/lib/plugin/WikicreoleTable.php Modified: trunk/lib/plugin/WikicreoleTable.php =================================================================== --- trunk/lib/plugin/WikicreoleTable.php 2014-09-16 08:26:03 UTC (rev 9082) +++ trunk/lib/plugin/WikicreoleTable.php 2014-09-17 08:39:16 UTC (rev 9083) @@ -157,9 +157,12 @@ /** * Compute cell in spreadsheet table - * $table: two-dimensional table - * $i and $j: indexes of cell to compute - * $imax and $jmax: table dimensions + * @param array $table: two-dimensional table + * @param int $i: first index of cell to compute + * @param int $j: second index of cell to compute + * @param int $imax: first table dimension + * @param int $jmax: second table dimension + * @return int */ private function compute_table_cell($table, $i, $j, $imax, $jmax) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-09-19 10:10:04
|
Revision: 9096 http://sourceforge.net/p/phpwiki/code/9096 Author: vargenau Date: 2014-09-19 10:09:57 +0000 (Fri, 19 Sep 2014) Log Message: ----------- Use two loops to avoid warning Modified Paths: -------------- trunk/lib/plugin/WikicreoleTable.php Modified: trunk/lib/plugin/WikicreoleTable.php =================================================================== --- trunk/lib/plugin/WikicreoleTable.php 2014-09-18 14:32:14 UTC (rev 9095) +++ trunk/lib/plugin/WikicreoleTable.php 2014-09-19 10:09:57 UTC (rev 9096) @@ -104,7 +104,13 @@ for ($j = 0; $j < $nb_cols; $j++) { if (!isset($table[$i][$j])) { $table[$i][$j] = ''; - } elseif (preg_match('/@@/', $table[$i][$j])) { + } + } + } + + for ($i = 0; $i < $nb_rows; $i++) { + for ($j = 0; $j < $nb_cols; $j++) { + if (preg_match('/@@/', $table[$i][$j])) { $table[$i][$j] = $this->compute_table_cell($table, $i, $j, $nb_rows, $nb_cols); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2023-07-18 13:56:16
|
Revision: 11059 http://sourceforge.net/p/phpwiki/code/11059 Author: vargenau Date: 2023-07-18 13:56:14 +0000 (Tue, 18 Jul 2023) Log Message: ----------- lib/plugin/WikicreoleTable.php: compute_table_cell returns straing, not int Modified Paths: -------------- trunk/lib/plugin/WikicreoleTable.php Modified: trunk/lib/plugin/WikicreoleTable.php =================================================================== --- trunk/lib/plugin/WikicreoleTable.php 2023-07-18 10:28:12 UTC (rev 11058) +++ trunk/lib/plugin/WikicreoleTable.php 2023-07-18 13:56:14 UTC (rev 11059) @@ -191,9 +191,9 @@ * @param int $j: second index of cell to compute * @param int $imax: first table dimension * @param int $jmax: second table dimension - * @return int + * @return string */ - private function compute_table_cell(array $table, int $i, int $j, int $imax, int $jmax): int + private function compute_table_cell(array $table, int $i, int $j, int $imax, int $jmax): string { // What is implemented: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |