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(
     '/EXPANDABLE\\((.+?)\\)(.*?<table.+?<\\/table.*?>)/s',
+
     '/<table class=["']?expandable["']? title=["']?(.+?)["']?(.+?<\\/table.*?>)/s',
     '<table cellpadding=0 cellspacing=0 border=0>
+
     '<table class=expandable-heading><tr><td>$1</td><td align=right>
    <tr><td class=expandable-heading>$1</td><td class=expandable-heading 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>$2</td></tr></table>',
+
     <tr id="tocinside"><td colspan=2>
 +
      <table class=expandable-content$2
 +
    </td></tr></table>',
 
     $article
 
     $article
 
     );
 
     );
 
?>
 
?>

Revision as of 21:56, 1 October 2006

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

   '/<table class=["']?expandable["']? title=["']?(.+?)["']?(.+?<\\/table.*?>)/s',

'

$1
      <script type="text/javascript">showTocToggle("show","hide")</script>
      <table class=expandable-content$2

',

   $article
   );

?>