From: <var...@us...> - 2009-01-09 12:23:55
|
Revision: 6387 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6387&view=rev Author: vargenau Date: 2009-01-09 11:59:25 +0000 (Fri, 09 Jan 2009) Log Message: ----------- Numeric cells are right-aligned by default Modified Paths: -------------- trunk/lib/plugin/MediawikiTable.php Modified: trunk/lib/plugin/MediawikiTable.php =================================================================== --- trunk/lib/plugin/MediawikiTable.php 2009-01-09 09:56:12 UTC (rev 6386) +++ trunk/lib/plugin/MediawikiTable.php 2009-01-09 11:59:25 UTC (rev 6387) @@ -8,7 +8,7 @@ /* * Copyright (C) 2003 Sameer D. Sahasrabuddhe * Copyright (C) 2005 $ThePhpWikiProgrammingTeam - * Copyright (C) 2008 Alcatel-Lucent + * Copyright (C) 2008-2009 Alcatel-Lucent * * This file is part of PhpWiki. * @@ -110,7 +110,11 @@ if (isset($row)) { if (isset($cell)) { if (isset($content)) { - $cell->pushContent(TransformText(trim($content), $markup, $basepage)); + if (is_numeric(trim($content))) { + $cell->pushContent(HTML::p(array('style' => "text-align:right"), trim($content))); + } else { + $cell->pushContent(TransformText(trim($content), $markup, $basepage)); + } unset($content); } $row->pushContent($cell); @@ -167,7 +171,11 @@ if (((substr($line,0,1) == "|") or (substr($line,0,1) == "!")) and isset($row)) { if (isset($cell)) { if (isset ($content)) { - $cell->pushContent(TransformText(trim($content), $markup, $basepage)); + if (is_numeric(trim($content))) { + $cell->pushContent(HTML::p(array('style' => "text-align:right"), trim($content))); + } else { + $cell->pushContent(TransformText(trim($content), $markup, $basepage)); + } unset($content); } $row->pushContent($cell); @@ -203,7 +211,11 @@ } } $line=substr($line, $pospipe+1); - $cell->pushContent(TransformText(trim($line), $markup, $basepage)); + if (is_numeric(trim($content))) { + $cell->pushContent(HTML::p(array('style' => "text-align:right"), trim($content))); + } else { + $cell->pushContent(TransformText(trim($content), $markup, $basepage)); + } continue; } } @@ -216,8 +228,14 @@ } if (isset($row)) { if (isset($cell)) { - if (isset($content)) - $cell->pushContent(TransformText(trim($content), $markup, $basepage)); + if (isset($content)) { + if (is_numeric(trim($content))) { + $cell->pushContent(HTML::p(array('style' => "text-align:right"), trim($content))); + } else { + $cell->pushContent(TransformText(trim($content), $markup, $basepage)); + } + + } $row->pushContent($cell); } $tbody->pushContent($row); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |