buttons.
* Special:UserLogin/signup now does AJAX checks for invalid and taken usernames,
displaying the error live.
+* Added BaseTemplateAfterPortlet hook to allow injecting html after portlets in skins.
=== Bug fixes in 1.23 ===
* (bug 41759) The "updated since last visit" markers (on history pages, recent
$name: Image name being checked
&$bad: Whether or not the image is "bad"
+'BaseTemplateAfterPortlet': After output of portlets, allow injecting
+custom HTML after the section. Any uses of the hook need to handle escaping.
+$template BaseTemplate
+$portlet: string portlet name
+&$html: string
+
'BeforeDisplayNoArticleText': Before displaying message key "noarticletext" or
"noarticletext-nopermission" at Article::showMissingArticle().
$article: article object
return $boxes;
}
+ /**
+ * @param string $name
+ */
+ protected function renderAfterPortlet( $name ) {
+ $content = '';
+ wfRunHooks( 'BaseTemplateAfterPortlet', array( $this, $name, &$content ) );
+
+ if ( $content !== '' ) {
+ echo "<div class='after-portlet after-portlet-$name'>$content</div>";
+ }
+
+ }
+
/**
* Makes a link, usually used by makeListItem to generate a link for an item
* in a list used in navigation lists, portlets, portals, sidebars, etc...
return "";
}
+ $html = '';
+
// We override SkinTemplate->formatLanguageName() in SkinCologneBlue
// not to capitalize the language names.
$language_urls = $this->data['language_urls'];
- if ( empty( $language_urls ) ) {
- return "";
- }
+ if ( !empty( $language_urls ) ) {
+ $s = array();
+ foreach ( $language_urls as $key => $data ) {
+ $s[] = $this->makeListItem( $key, $data, array( 'tag' => 'span' ) );
+ }
- $s = array();
- foreach ( $language_urls as $key => $data ) {
- $s[] = $this->makeListItem( $key, $data, array( 'tag' => 'span' ) );
+ $html = wfMessage( 'otherlanguages' )->text()
+ . wfMessage( 'colon-separator' )->text()
+ . $this->getSkin()->getLanguage()->pipeList( $s );
}
- return wfMessage( 'otherlanguages' )->text()
- . wfMessage( 'colon-separator' )->text()
- . $this->getSkin()->getLanguage()->pipeList( $s );
+ $html .= $this->renderAfterPortlet( 'lang' );
+
+ return $html;
+ }
+
+ /**
+ * @param string $name
+ */
+ protected function renderAfterPortlet( $name ) {
+ $content = '';
+ wfRunHooks( 'BaseTemplateAfterPortlet', array( $this, $name, &$content ) );
+
+ $html = $content !== '' ? "<div class='after-portlet after-portlet-$name'>$content</div>" : '';
+
+ return $html;
}
function pageTitleLinks() {
$role = ( $heading == 'search' ) ? 'search' : 'navigation';
$s .= "<div class=\"portlet\" id=\"$portletId\" role=\"$role\">\n$headingHTML\n$listHTML\n</div>\n";
}
+
+ $s .= $this->renderAfterPortlet( $heading );
}
$s .= "</div>\n";
} ?>
</form>
+
+ <?php $this->renderAfterPortlet( 'search' ); ?>
</div>
</div>
<?php
} ?>
</ul>
+<?php $this->renderAfterPortlet( 'cactions' ); ?>
</div>
</div>
<?php
wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this, true ) );
?>
</ul>
+<?php $this->renderAfterPortlet( 'tb' ); ?>
</div>
</div>
<?php
/*************************************************************************************************/
function languageBox() {
- if ( $this->data['language_urls'] ) {
+ if ( $this->data['language_urls'] !== false ) {
?>
<div id="p-lang" class="portlet" role="navigation">
<h3<?php $this->html( 'userlangattributes' ) ?>><?php $this->msg( 'otherlanguages' ) ?></h3>
<?php } ?>
</ul>
+
+<?php $this->renderAfterPortlet( 'lang' ); ?>
</div>
</div>
<?php
# allow raw HTML block to be defined by extensions
print $cont;
}
+
+ $this->renderAfterPortlet( $bar );
?>
</div>
</div>
<?php
}
+
} // end of class
$this->renderPortal( 'tb', $this->getToolbox(), 'toolbox', 'SkinTemplateToolboxEnd' );
break;
case 'LANGUAGES':
- if ( $this->data['language_urls'] ) {
+ if ( $this->data['language_urls'] !== false ) {
$this->renderPortal( 'lang', $this->data['language_urls'], 'otherlanguages' );
}
break;
</ul>
<?php
} else { ?>
- <?php echo $content; /* Allow raw HTML block to be defined by extensions */ ?>
-<?php
- } ?>
+ <?php
+ echo $content; /* Allow raw HTML block to be defined by extensions */
+ }
+
+ $this->renderAfterPortlet( $name );
+ ?>
</div>
</div>
<?php
line-height: inherit;
}
+div.after-portlet {
+ display: inline;
+ padding-left: .5em;
+}
+
h1 {
color: #666666;
font-family: Verdana, Arial, sans-serif;
border: 1px solid #aaa;
padding: 0 .8em .3em .5em;
}
+/* allows .pBody styles to wrap around content added via BaseTemplateAfterPortlet hook */
+.pBody:after {
+ content: '';
+ clear: both;
+ display: block;
+}
.portlet ul {
line-height: 1.5em;
font-size: 95%;