本文整理匯總了PHP中SkinTemplate::getOutput方法的典型用法代碼示例。如果您正苦於以下問題:PHP SkinTemplate::getOutput方法的具體用法?PHP SkinTemplate::getOutput怎麽用?PHP SkinTemplate::getOutput使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SkinTemplate
的用法示例。
在下文中一共展示了SkinTemplate::getOutput方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: onSkinTemplateOutputPageBeforeExec
/**
* Add variables to SkinTemplate
*/
public static function onSkinTemplateOutputPageBeforeExec(SkinTemplate $skinTemplate, QuickTemplate $tpl)
{
wfProfileIn(__METHOD__);
$out = $skinTemplate->getOutput();
$title = $skinTemplate->getTitle();
# quick hack for rt#15730; if you ever feel temptation to add 'elseif' ***CREATE A PROPER HOOK***
if ($title instanceof Title && NS_CATEGORY == $title->getNamespace()) {
// FIXME
$tpl->set('pagetitle', preg_replace("/^{$title->getNsText()}:/", '', $out->getHTMLTitle()));
}
// Pass parameters to skin, see: Login friction project (Marooned)
$tpl->set('thisurl', $title->getPrefixedURL());
$tpl->set('thisquery', $skinTemplate->thisquery);
wfProfileOut(__METHOD__);
return true;
}
示例2: onPersonalUrls
/**
* Handler for PersonalUrls hook.
* Add a "Notifications" item to the user toolbar ('personal URLs').
* @see http://www.mediawiki.org/wiki/Manual:Hooks/PersonalUrls
* @param &$personal_urls Array of URLs to append to.
* @param &$title Title of page being visited.
* @param SkinTemplate $sk
* @return bool true in all cases
*/
static function onPersonalUrls(&$personal_urls, &$title, $sk)
{
global $wgEchoNewMsgAlert;
$user = $sk->getUser();
if ($user->isAnon() || self::isEchoDisabled($user)) {
return true;
}
// Add a "My notifications" item to personal URLs
if ($user->getOption('echo-notify-show-link')) {
$notificationCount = MWEchoNotifUser::newFromUser($user)->getNotificationCount();
$text = EchoNotificationController::formatNotificationCount($notificationCount);
$url = SpecialPage::getTitleFor('Notifications')->getLocalURL();
if ($notificationCount == 0) {
$linkClasses = array('mw-echo-notifications-badge');
} else {
$linkClasses = array('mw-echo-unread-notifications', 'mw-echo-notifications-badge');
}
$notificationsLink = array('href' => $url, 'text' => $text, 'active' => $url == $title->getLocalUrl(), 'class' => $linkClasses);
$insertUrls = array('notifications' => $notificationsLink);
$personal_urls = wfArrayInsertAfter($personal_urls, $insertUrls, 'userpage');
}
// If the user has new messages, display a talk page alert
if ($wgEchoNewMsgAlert && $user->getOption('echo-show-alert') && $user->getNewtalk()) {
$personal_urls['mytalk']['text'] = $sk->msg('echo-new-messages')->text();
$personal_urls['mytalk']['class'] = array('mw-echo-alert');
$sk->getOutput()->addModuleStyles('ext.echo.alert');
}
return true;
}