本文整理汇总了PHP中OutputPage::prependHTML方法的典型用法代码示例。如果您正苦于以下问题:PHP OutputPage::prependHTML方法的具体用法?PHP OutputPage::prependHTML怎么用?PHP OutputPage::prependHTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputPage
的用法示例。
在下文中一共展示了OutputPage::prependHTML方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addEditModule
public static function addEditModule(EditPage $editPage, OutputPage $output)
{
$output->addModules('ext.wikieditor.huijiextra.top');
$output->addModules('ext.wikieditor.huijiextra.bottom');
$output->addHeadItem('loader', '<script language="JavaScript">' . "\n" . '$(window).load(function() {' . "\n" . '// Animate loader off screen' . "\n" . '$(".se-pre-con").fadeOut("slow");' . "\n" . 'var editFormSisyphus = $( "#editform" ).sisyphus( {' . "\n" . 'locationBased: true, ' . "\n" . 'timeout: 0,' . "\n" . 'autoRelease: true,' . "\n" . 'onBeforeRestore:function(){' . "\n" . '$("#autoRestoreModal").modal({' . "\n" . 'keyboard: false,' . "\n" . 'backdrop: "static"' . "\n" . '}); ' . "\n" . 'return false;' . "\n" . '}' . "\n" . '} ); ' . "\n" . '});' . "\n" . '</script>');
$output->prependHTML('<div class="se-pre-con"></div>');
}
示例2: maybeAddBacklogNotice
protected static function maybeAddBacklogNotice(OutputPage &$out)
{
global $wgUser;
if (!$wgUser->isAllowed('review')) {
return true;
// not relevant to user
}
$namespaces = FlaggedRevs::getReviewNamespaces();
$watchlist = SpecialPage::getTitleFor('Watchlist');
# Add notice to watchlist about pending changes...
if ($out->getTitle()->equals($watchlist) && $namespaces) {
$dbr = wfGetDB(DB_SLAVE, 'watchlist');
// consistency with watchlist
$watchedOutdated = (bool) $dbr->selectField(array('watchlist', 'page', 'flaggedpages'), '1', array('wl_user' => $wgUser->getId(), 'wl_namespace' => $namespaces, 'wl_namespace = page_namespace', 'wl_title = page_title', 'fp_page_id = page_id', 'fp_pending_since IS NOT NULL'), __METHOD__);
# Give a notice if pages on the users's wachlist have pending edits
if ($watchedOutdated) {
$css = 'plainlinks fr-watchlist-pending-notice';
$out->prependHTML("<div id='mw-fr-watchlist-pending-notice' class='{$css}'>" . wfMsgExt('flaggedrevs-watched-pending', 'parseinline') . "</div>");
}
}
return true;
}