本文整理汇总了PHP中OutputPage::prependHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP OutputPage::prependHtml方法的具体用法?PHP OutputPage::prependHtml怎么用?PHP OutputPage::prependHtml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputPage
的用法示例。
在下文中一共展示了OutputPage::prependHtml方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tmwAccountsNotice
/**
* Add "x email-tmwed open account requests" notice
* @param $notice
* @return bool
*/
public static function tmwAccountsNotice(OutputPage &$out, Skin &$skin)
{
global $wgTMWAccountNotice;
$context = $out->getContext();
if (!$wgTMWAccountNotice || !$context->getUser()->isAllowed('tmwaccount')) {
return true;
}
# Only show on some special pages
$title = $context->getTitle();
if (!$title->isSpecial('Recentchanges') && !$title->isSpecial('Watchlist')) {
return true;
}
$count = TMWAccount::getOpenEmailTMWedCount('*');
if ($count > 0) {
$out->prependHtml('<div id="mw-tmwaccount-msg" class="plainlinks mw-tmwaccount-bar">' . $out->parse(wfMsgExt('tmwaccount-newrequests', 'parsemag', $count), false) . '</div>');
}
return true;
}
示例2: confirmAccountsNotice
/**
* Add "x email-confirmed open account requests" notice
* @param $notice
* @return bool
*/
public static function confirmAccountsNotice(OutputPage &$out, Skin &$skin)
{
global $wgConfirmAccountNotice;
$context = $out->getContext();
if (!$wgConfirmAccountNotice || !$context->getUser()->isAllowed('confirmaccount')) {
return true;
}
# Only show on some special pages
$title = $context->getTitle();
if (!$title->isSpecial('Recentchanges') && !$title->isSpecial('Watchlist')) {
return true;
}
$count = ConfirmAccount::getOpenEmailConfirmedCount('*');
if ($count > 0) {
$out->prependHtml('<div id="mw-confirmaccount-msg" class="plainlinks mw-confirmaccount-bar">' . $context->msg('confirmaccount-newrequests')->numParams($count)->parse() . '</div>');
$out->addModules('ext.confirmAccount');
// CSS
}
return true;
}