Difference between revisions of "Expandable.php"

From Organic Design wiki
m
m
Line 1: Line 1:
 
<?
 
<?
 
if ($GLOBALS['action'] == 'view') $article = preg_replace(
 
if ($GLOBALS['action'] == 'view') $article = preg_replace(
     '/<table class=["\']?expandable["\']? title=["\']?(.+?)["\']?(.+?<\\/table.*?>)/s',
+
     '/<table class=["\']?expandable["\']? title=["\']?(.+?)["\']?\\s*>(.+?<\\/table.*?>)/s',
 
     '<table class=expandable-heading><tr><td>$1</td><td align=right>
 
     '<table class=expandable-heading><tr><td>$1</td><td align=right>
 
       <script type="text/javascript">showTocToggle("show","hide")</script>
 
       <script type="text/javascript">showTocToggle("show","hide")</script>
 
     </td></tr>
 
     </td></tr>
 
     <tr id="tocinside"><td colspan=2>
 
     <tr id="tocinside"><td colspan=2>
       <table class=expandable-content$2
+
       <table class=expandable-content>$2
 
     </td></tr></table>',
 
     </td></tr></table>',
 
     $article
 
     $article
 
     );
 
     );
 
?>
 
?>

Revision as of 22:07, 1 October 2006

<? if ($GLOBALS['action'] == 'view') $article = preg_replace(

'/

(.+?<\\/table.*?>)/s', '
$1
      <script type="text/javascript">showTocToggle("show","hide")</script>
$2
',
   $article
   );

?>