r36917 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36916‎ | r36917 | r36918 >
Date:14:45, 2 July 2008
Author:daniel
Status:old
Tags:
Comment:
Allow raw HTML blocks in data['sidebar'] array. This provides a simple ways for extensions to inject portlets containing arbitrary HTML code. For use by CategoryTree and others.
Modified paths:
  • /trunk/phase3/skins/Modern.php (modified) (history)
  • /trunk/phase3/skins/MonoBook.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/MonoBook.php
@@ -156,6 +156,7 @@
157157 <div class='generated-sidebar portlet' id='p-<?php echo Sanitizer::escapeId($bar) ?>'<?php echo $skin->tooltip('p-'.$bar) ?>>
158158 <h5><?php $out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo $bar; else echo $out; ?></h5>
159159 <div class='pBody'>
 160+<?php if ( is_array( $cont ) ) { ?>
160161 <ul>
161162 <?php foreach($cont as $key => $val) { ?>
162163 <li id="<?php echo Sanitizer::escapeId($val['id']) ?>"<?php
@@ -163,6 +164,11 @@
164165 ?>><a href="<?php echo htmlspecialchars($val['href']) ?>"<?php echo $skin->tooltipAndAccesskey($val['id']) ?>><?php echo htmlspecialchars($val['text']) ?></a></li>
165166 <?php } ?>
166167 </ul>
 168+<?php } else {
 169+ # allow raw HTML block to be defined by extensions
 170+ print $cont;
 171+ }
 172+?>
167173 </div>
168174 </div>
169175 <?php } ?>
Index: trunk/phase3/skins/Modern.php
@@ -154,6 +154,7 @@
155155 <div class='generated-sidebar portlet' id='p-<?php echo Sanitizer::escapeId($bar) ?>'<?php echo $skin->tooltip('p-'.$bar) ?>>
156156 <h5><?php $out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo $bar; else echo $out; ?></h5>
157157 <div class='pBody'>
 158+<?php if ( is_array( $cont ) ) { ?>
158159 <ul>
159160 <?php foreach($cont as $key => $val) { ?>
160161 <li id="<?php echo Sanitizer::escapeId($val['id']) ?>"<?php
@@ -161,6 +162,11 @@
162163 ?>><a href="<?php echo htmlspecialchars($val['href']) ?>"<?php echo $skin->tooltipAndAccesskey($val['id']) ?>><?php echo htmlspecialchars($val['text']) ?></a></li>
163164 <?php } ?>
164165 </ul>
 166+<?php } else {
 167+ # allow raw HTML block to be defined by extensions
 168+ print $cont;
 169+ }
 170+?>
165171 </div><!-- pBody -->
166172 </div><!-- portlet -->
167173 <?php } ?>

Follow-up revisions

RevisionCommit summaryAuthorDate
r36920optionally show category tree in the sidebar (requires skin update from r36917)daniel15:13, 2 July 2008

Status & tagging log