Difference between revisions of "Expandable.php"

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

Revision as of 21:42, 1 October 2006

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

   '/EXPANDABLE(.+?)(.*?<table.+?<\\/table>)/s',

'

$1
      <script type="text/javascript">showTocToggle("show","hide")</script>
$2

',

   $article
   );

?>