add ability to set float for cmoboxes
authorZbigniew Braniecki (zbraniecki@mozilla.com)
Wed, 20 Aug 2008 17:48:41 +0200
changeset 4 4f74c6a8830444e605583a3c0637512cdb48efc7
parent 3 ee9b6b38c000b9962f2d1ef1226c60cf7812a783
child 5 c09a327eb0fb408533e08b632bd0a52d0b5c21a0
push id1
push userroot
push dateWed, 17 Sep 2008 21:54:46 +0000
add ability to set float for cmoboxes
mediawiki/extensions/cmo.php
--- a/mediawiki/extensions/cmo.php
+++ b/mediawiki/extensions/cmo.php
@@ -21,24 +21,27 @@ function wfCMOBox() {
 }
  
  
 // the function that reacts to "<topicbox>"
  
 function CMOBox( $input, $argv, &$parser) {
   global $wgScriptPath;
   $parser->disableCache();
-
-// the varibles are: <aim style="$argv['style']" action="$argv['action']">$input</aim>
  
   $input = '<cmobox title="'.$argv['title'].'">'.$input.'</cmobox>';
   $xml = new SimpleXMLElement($input);
 
+  if ($argv['float'])
+    $style = 'style="float:'.$argv['float'].'"';
+  else
+    $style = '';
+
 // start the rendering the html outupt
-  $output = '<div class="topicbox"><h2>'.$parser->recursiveTagParse((string)$argv['title']).'</h2><table>';
+  $output = '<div class="topicbox" '.$style.'><h2>'.$parser->recursiveTagParse((string)$argv['title']).'</h2><table>';
   $i = 0;
   
   foreach ($xml->cmocell as $cmocell) {
 	if ($i==0)
 	  $output .= '<tr>';
     if (strpos((string)$cmocell['url'], 'http://')===false) {
       $title = Title::newFromText((string)$cmocell['url']);
       if ($title)