本文整理汇总了PHP中LogEventsList::showLogExtract方法的典型用法代码示例。如果您正苦于以下问题:PHP LogEventsList::showLogExtract方法的具体用法?PHP LogEventsList::showLogExtract怎么用?PHP LogEventsList::showLogExtract使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogEventsList
的用法示例。
在下文中一共展示了LogEventsList::showLogExtract方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showLogFragment
/**
* @param $user User
* @param $output OutputPage
*/
protected function showLogFragment($user, $output)
{
$pageTitle = Title::makeTitleSafe(NS_USER, $user->getName());
$logPage = new LogPage('gblrights');
$output->addHTML(Xml::element('h2', null, $logPage->getName()->text() . "\n"));
LogEventsList::showLogExtract($output, 'gblrights', $pageTitle->getPrefixedText());
}
示例2: wfSpecialRevisiondelete
/**
* Special page allowing users with the appropriate permissions to view
* and hide revisions. Log items can also be hidden.
*
* @file
* @ingroup SpecialPage
*/
function wfSpecialRevisiondelete($par = null)
{
global $wgOut, $wgRequest, $wgUser;
# Handle our many different possible input types
$target = $wgRequest->getText('target');
$oldid = $wgRequest->getArray('oldid');
$artimestamp = $wgRequest->getArray('artimestamp');
$logid = $wgRequest->getArray('logid');
$img = $wgRequest->getArray('oldimage');
$fileid = $wgRequest->getArray('fileid');
# For reviewing deleted files...
$file = $wgRequest->getVal('file');
# If this is a revision, then we need a target page
$page = Title::newFromUrl($target);
if (is_null($page)) {
$wgOut->addWikiMsg('undelete-header');
return;
}
# Only one target set at a time please!
$i = (bool) $file + (bool) $oldid + (bool) $logid + (bool) $artimestamp + (bool) $fileid + (bool) $img;
if ($i !== 1) {
$wgOut->showErrorPage('revdelete-nooldid-title', 'revdelete-nooldid-text');
return;
}
# Logs must have a type given
if ($logid && !strpos($page->getDBKey(), '/')) {
$wgOut->showErrorPage('revdelete-nooldid-title', 'revdelete-nooldid-text');
return;
}
# Either submit or create our form
$form = new RevisionDeleteForm($page, $oldid, $logid, $artimestamp, $fileid, $img, $file);
if ($wgRequest->wasPosted()) {
$form->submit($wgRequest);
} else {
if ($oldid || $artimestamp) {
$form->showRevs();
} else {
if ($fileid || $img) {
$form->showImages();
} else {
if ($logid) {
$form->showLogItems();
}
}
}
}
# Show relevant lines from the deletion log. This will show even if said ID
# does not exist...might be helpful
$wgOut->addHTML("<h2>" . htmlspecialchars(LogPage::logName('delete')) . "</h2>\n");
LogEventsList::showLogExtract($wgOut, 'delete', $page->getPrefixedText());
if ($wgUser->isAllowed('suppressionlog')) {
$wgOut->addHTML("<h2>" . htmlspecialchars(LogPage::logName('suppress')) . "</h2>\n");
LogEventsList::showLogExtract($wgOut, 'suppress', $page->getPrefixedText());
}
}
示例3: onShowMissingArticle
/**
* Show a log if the user has been renamed and point to the new username.
* Don't show the log if the $oldUserName exists as a user.
*
* @param $article Article
* @return bool
*/
public static function onShowMissingArticle($article)
{
$title = $article->getTitle();
$oldUser = User::newFromName($title->getBaseText());
if (($title->getNamespace() === NS_USER || $title->getNamespace() === NS_USER_TALK) && ($oldUser && $oldUser->isAnon())) {
// Get the title for the base userpage
$page = Title::makeTitle(NS_USER, str_replace(' ', '_', $title->getBaseText()))->getPrefixedDBkey();
$out = $article->getContext()->getOutput();
LogEventsList::showLogExtract($out, 'renameuser', $page, '', array('lim' => 10, 'showIfEmpty' => false, 'msgKey' => array('renameuser-renamed-notice', $title->getBaseText())));
}
return true;
}
示例4: openShowImage
//.........这里部分代码省略.........
} else {
$thumb1 = '';
}
if ($page < $count) {
$label = wfMessage('imgmultipagenext')->text();
$link = Linker::linkKnown($this->getTitle(), $label, array(), array('page' => $page + 1));
$thumb2 = Linker::makeThumbLinkObj($this->getTitle(), $this->displayImg, $link, $label, 'none', array('page' => $page + 1));
} else {
$thumb2 = '';
}
global $wgScript;
$formParams = array('name' => 'pageselector', 'action' => $wgScript);
$options = array();
for ($i = 1; $i <= $count; $i++) {
$options[] = Xml::option($lang->formatNum($i), $i, $i == $page);
}
$select = Xml::tags('select', array('id' => 'pageselector', 'name' => 'page'), implode("\n", $options));
$out->addHTML('</td><td><div class="multipageimagenavbox">' . Xml::openElement('form', $formParams) . Html::hidden('title', $this->getTitle()->getPrefixedDBkey()) . wfMessage('imgmultigoto')->rawParams($select)->parse() . Xml::submitButton(wfMessage('imgmultigo')->text()) . Xml::closeElement('form') . "<hr />{$thumb1}\n{$thumb2}<br style=\"clear: both\" /></div></td></tr></table>");
}
} elseif ($this->displayImg->isSafeFile()) {
# if direct link is allowed but it's not a renderable image, show an icon.
$icon = $this->displayImg->iconThumb();
$out->addHTML('<div class="fullImageLink" id="file">' . $icon->toHtml(array('file-link' => true)) . "</div>\n");
}
$longDesc = wfMessage('parentheses', $this->displayImg->getLongDesc())->text();
$medialink = "[[Media:{$filename}|{$linktext}]]";
if (!$this->displayImg->isSafeFile()) {
$warning = wfMessage('mediawarning')->plain();
// dirmark is needed here to separate the file name, which
// most likely ends in Latin characters, from the description,
// which may begin with the file type. In RTL environment
// this will get messy.
// The dirmark, however, must not be immediately adjacent
// to the filename, because it can get copied with it.
// See bug 25277.
$out->addWikiText(<<<EOT
<div class="fullMedia"><span class="dangerousLink">{$medialink}</span> {$dirmark}<span class="fileInfo">{$longDesc}</span></div>
<div class="mediaWarning">{$warning}</div>
EOT
);
} else {
$out->addWikiText(<<<EOT
<div class="fullMedia">{$medialink} {$dirmark}<span class="fileInfo">{$longDesc}</span>
</div>
EOT
);
}
$renderLangOptions = $this->displayImg->getAvailableLanguages();
if (count($renderLangOptions) >= 1) {
$currentLanguage = $renderLang;
$defaultLang = $this->displayImg->getDefaultRenderLanguage();
if (is_null($currentLanguage)) {
$currentLanguage = $defaultLang;
}
$out->addHtml($this->doRenderLangOpt($renderLangOptions, $currentLanguage, $defaultLang));
}
// Add cannot animate thumbnail warning
if (!$this->displayImg->canAnimateThumbIfAppropriate()) {
// Include the extension so wiki admins can
// customize it on a per file-type basis
// (aka say things like use format X instead).
// additionally have a specific message for
// file-no-thumb-animation-gif
$ext = $this->displayImg->getExtension();
$noAnimMesg = wfMessageFallback('file-no-thumb-animation-' . $ext, 'file-no-thumb-animation')->plain();
$out->addWikiText(<<<EOT
<div class="mw-noanimatethumb">{$noAnimMesg}</div>
EOT
);
}
if (!$this->displayImg->isLocal()) {
$this->printSharedImageText();
}
} else {
# Image does not exist
if (!$this->getID()) {
# No article exists either
# Show deletion log to be consistent with normal articles
LogEventsList::showLogExtract($out, array('delete', 'move'), $this->getTitle()->getPrefixedText(), '', array('lim' => 10, 'conds' => array("log_action != 'revision'"), 'showIfEmpty' => false, 'msgKey' => array('moveddeleted-notice')));
}
if ($wgEnableUploads && $user->isAllowed('upload')) {
// Only show an upload link if the user can upload
$uploadTitle = SpecialPage::getTitleFor('Upload');
$nofile = array('filepage-nofile-link', $uploadTitle->getFullURL(array('wpDestFile' => $this->mPage->getFile()->getName())));
} else {
$nofile = 'filepage-nofile';
}
// Note, if there is an image description page, but
// no image, then this setRobotPolicy is overridden
// by Article::View().
$out->setRobotPolicy('noindex,nofollow');
$out->wrapWikiMsg("<div id='mw-imagepage-nofile' class='plainlinks'>\n\$1\n</div>", $nofile);
if (!$this->getID() && $wgSend404Code) {
// If there is no image, no shared image, and no description page,
// output a 404, to be consistent with articles.
$request->response()->header('HTTP/1.1 404 Not Found');
}
}
$out->setFileVersion($this->displayImg);
}
示例5: onContributionsToolLinks
public static function onContributionsToolLinks($id, $nt, &$tools)
{
global $wgOut, $wgCityId, $wgUser, $wgCityId;
wfProfileIn(__METHOD__);
$user = User::newFromId($id);
if (!empty($user)) {
$tools[] = Linker::link(SpecialPage::getSafeTitleFor('Log', 'chatban'), wfMessage('chat-chatban-log')->escaped(), array('class' => 'chat-ban-log'), array('page' => $user->getUserPage()->getPrefixedText()));
# Add chat ban log link (@author: Sactage)
if (Chat::getBanInformation($wgCityId, $user) !== false) {
$dir = "change";
LogEventsList::showLogExtract($wgOut, 'chatban', $nt->getPrefixedText(), '', array('lim' => 1, 'showIfEmpty' => false, 'msgKey' => array('chat-contributions-ban-notice', $nt->getText()), 'offset' => ''));
} else {
if ($wgUser->isAllowed('chatmoderator') && !$user->isAllowed('chatmoderator')) {
$tools[] = "<a class='chat-change-ban' data-user-id='{$id}' href='#'>" . wfMsg('chat-ban-contributions-heading') . "</a>";
}
}
}
wfProfileOut(__METHOD__);
return true;
}
示例6: showHeader
//.........这里部分代码省略.........
}
}
if ($this->missingComment) {
$wgOut->wrapWikiMsg("<div id='mw-missingcommenttext'>\n\$1\n</div>", 'missingcommenttext');
}
if ($this->missingSummary && $this->section != 'new') {
$wgOut->wrapWikiMsg("<div id='mw-missingsummary'>\n\$1\n</div>", 'missingsummary');
}
if ($this->missingSummary && $this->section == 'new') {
$wgOut->wrapWikiMsg("<div id='mw-missingcommentheader'>\n\$1\n</div>", 'missingcommentheader');
}
if ($this->hookError !== '') {
$wgOut->addWikiText($this->hookError);
}
if (!$this->checkUnicodeCompliantBrowser()) {
$wgOut->addWikiMsg('nonunicodebrowser');
}
if ($this->section != 'new') {
$revision = $this->mArticle->getRevisionFetched();
if ($revision) {
// Let sysop know that this will make private content public if saved
if (!$revision->userCan(Revision::DELETED_TEXT)) {
$wgOut->wrapWikiMsg("<div class='mw-warning plainlinks'>\n\$1\n</div>\n", 'rev-deleted-text-permission');
} elseif ($revision->isDeleted(Revision::DELETED_TEXT)) {
$wgOut->wrapWikiMsg("<div class='mw-warning plainlinks'>\n\$1\n</div>\n", 'rev-deleted-text-view');
}
if (!$revision->isCurrent()) {
$this->mArticle->setOldSubtitle($revision->getId());
$wgOut->addWikiMsg('editingold');
}
} elseif ($this->mTitle->exists()) {
// Something went wrong
$wgOut->wrapWikiMsg("<div class='errorbox'>\n\$1\n</div>\n", array('missing-article', $this->mTitle->getPrefixedText(), wfMsgNoTrans('missingarticle-rev', $this->oldid)));
}
}
}
if (wfReadOnly()) {
$wgOut->wrapWikiMsg("<div id=\"mw-read-only-warning\">\n\$1\n</div>", array('readonlywarning', wfReadOnlyReason()));
} elseif ($wgUser->isAnon()) {
if ($this->formtype != 'preview') {
$wgOut->wrapWikiMsg("<div id=\"mw-anon-edit-warning\">\n\$1</div>", 'anoneditwarning');
} else {
$wgOut->wrapWikiMsg("<div id=\"mw-anon-preview-warning\">\n\$1</div>", 'anonpreviewwarning');
}
} else {
if ($this->isCssJsSubpage) {
# Check the skin exists
if ($this->isWrongCaseCssJsPage) {
$wgOut->wrapWikiMsg("<div class='error' id='mw-userinvalidcssjstitle'>\n\$1\n</div>", array('userinvalidcssjstitle', $this->mTitle->getSkinFromCssJsSubpage()));
}
if ($this->getTitle()->isSubpageOf($wgUser->getUserPage())) {
if ($this->formtype !== 'preview') {
if ($this->isCssSubpage) {
$wgOut->wrapWikiMsg("<div id='mw-usercssyoucanpreview'>\n\$1\n</div>", array('usercssyoucanpreview'));
}
if ($this->isJsSubpage) {
$wgOut->wrapWikiMsg("<div id='mw-userjsyoucanpreview'>\n\$1\n</div>", array('userjsyoucanpreview'));
}
}
}
}
}
if ($this->mTitle->getNamespace() != NS_MEDIAWIKI && $this->mTitle->isProtected('edit')) {
# Is the title semi-protected?
if ($this->mTitle->isSemiProtected()) {
$noticeMsg = 'semiprotectedpagewarning';
} else {
# Then it must be protected based on static groups (regular)
$noticeMsg = 'protectedpagewarning';
}
LogEventsList::showLogExtract($wgOut, 'protect', $this->mTitle, '', array('lim' => 1, 'msgKey' => array($noticeMsg)));
}
if ($this->mTitle->isCascadeProtected()) {
# Is this page under cascading protection from some source pages?
list($cascadeSources, ) = $this->mTitle->getCascadeProtectionSources();
$notice = "<div class='mw-cascadeprotectedwarning'>\n\$1\n";
$cascadeSourcesCount = count($cascadeSources);
if ($cascadeSourcesCount > 0) {
# Explain, and list the titles responsible
foreach ($cascadeSources as $page) {
$notice .= '* [[:' . $page->getPrefixedText() . "]]\n";
}
}
$notice .= '</div>';
$wgOut->wrapWikiMsg($notice, array('cascadeprotectedwarning', $cascadeSourcesCount));
}
if (!$this->mTitle->exists() && $this->mTitle->getRestrictions('create')) {
LogEventsList::showLogExtract($wgOut, 'protect', $this->mTitle, '', array('lim' => 1, 'showIfEmpty' => false, 'msgKey' => array('titleprotectedwarning'), 'wrap' => "<div class=\"mw-titleprotectedwarning\">\n\$1</div>"));
}
if ($this->kblength === false) {
$this->kblength = (int) (strlen($this->textbox1) / 1024);
}
if ($this->tooBig || $this->kblength > $wgMaxArticleSize) {
$wgOut->wrapWikiMsg("<div class='error' id='mw-edit-longpageerror'>\n\$1\n</div>", array('longpageerror', $wgLang->formatNum($this->kblength), $wgLang->formatNum($wgMaxArticleSize)));
} else {
if (!wfMessage('longpage-hint')->isDisabled()) {
$wgOut->wrapWikiMsg("<div id='mw-edit-longpage-hint'>\n\$1\n</div>", array('longpage-hint', $wgLang->formatSize(strlen($this->textbox1)), strlen($this->textbox1)));
}
}
}
示例7: execute
public function execute($par)
{
$this->useTransactionalTimeLimit();
$this->checkPermissions();
$this->checkReadOnly();
$output = $this->getOutput();
$user = $this->getUser();
$this->setHeaders();
$this->outputHeader();
$request = $this->getRequest();
$this->submitClicked = $request->wasPosted() && $request->getBool('wpSubmit');
# Handle our many different possible input types.
$ids = $request->getVal('ids');
if (!is_null($ids)) {
# Allow CSV, for backwards compatibility, or a single ID for show/hide links
$this->ids = explode(',', $ids);
} else {
# Array input
$this->ids = array_keys($request->getArray('ids', array()));
}
// $this->ids = array_map( 'intval', $this->ids );
$this->ids = array_unique(array_filter($this->ids));
$this->typeName = $request->getVal('type');
$this->targetObj = Title::newFromText($request->getText('target'));
# For reviewing deleted files...
$this->archiveName = $request->getVal('file');
$this->token = $request->getVal('token');
if ($this->archiveName && $this->targetObj) {
$this->tryShowFile($this->archiveName);
return;
}
$this->typeName = RevisionDeleter::getCanonicalTypeName($this->typeName);
# No targets?
if (!$this->typeName || count($this->ids) == 0) {
throw new ErrorPageError('revdelete-nooldid-title', 'revdelete-nooldid-text');
}
# Allow the list type to adjust the passed target
$this->targetObj = RevisionDeleter::suggestTarget($this->typeName, $this->targetObj, $this->ids);
# We need a target page!
if ($this->targetObj === null) {
$output->addWikiMsg('undelete-header');
return;
}
$this->typeLabels = self::$UILabels[$this->typeName];
$list = $this->getList();
$list->reset();
$bitfield = $list->current()->getBits();
$this->mIsAllowed = $user->isAllowed(RevisionDeleter::getRestriction($this->typeName));
$canViewSuppressedOnly = $this->getUser()->isAllowed('viewsuppressed') && !$this->getUser()->isAllowed('suppressrevision');
$pageIsSuppressed = $bitfield & Revision::DELETED_RESTRICTED;
$this->mIsAllowed = $this->mIsAllowed && !($canViewSuppressedOnly && $pageIsSuppressed);
$this->otherReason = $request->getVal('wpReason');
# Give a link to the logs/hist for this page
$this->showConvenienceLinks();
# Initialise checkboxes
$this->checks = array(array($this->typeLabels['check-label'], 'wpHidePrimary', RevisionDeleter::getRevdelConstant($this->typeName)), array('revdelete-hide-comment', 'wpHideComment', Revision::DELETED_COMMENT), array('revdelete-hide-user', 'wpHideUser', Revision::DELETED_USER));
if ($user->isAllowed('suppressrevision')) {
$this->checks[] = array('revdelete-hide-restricted', 'wpHideRestricted', Revision::DELETED_RESTRICTED);
}
# Either submit or create our form
if ($this->mIsAllowed && $this->submitClicked) {
$this->submit($request);
} else {
$this->showForm();
}
$qc = $this->getLogQueryCond();
# Show relevant lines from the deletion log
$deleteLogPage = new LogPage('delete');
$output->addHTML("<h2>" . $deleteLogPage->getName()->escaped() . "</h2>\n");
LogEventsList::showLogExtract($output, 'delete', $this->targetObj, '', array('lim' => 25, 'conds' => $qc, 'useMaster' => $this->wasSaved));
# Show relevant lines from the suppression log
if ($user->isAllowed('suppressionlog')) {
$suppressLogPage = new LogPage('suppress');
$output->addHTML("<h2>" . $suppressLogPage->getName()->escaped() . "</h2>\n");
LogEventsList::showLogExtract($output, 'suppress', $this->targetObj, '', array('lim' => 25, 'conds' => $qc, 'useMaster' => $this->wasSaved));
}
}
示例8: showHistory
protected function showHistory()
{
$this->checkReadOnly();
$out = $this->getOutput();
if ($this->mAllowed) {
$out->addModules('mediawiki.special.undelete');
}
$out->wrapWikiMsg("<div class='mw-undelete-pagetitle'>\n\$1\n</div>\n", array('undeletepagetitle', wfEscapeWikiText($this->mTargetObj->getPrefixedText())));
$archive = new PageArchive($this->mTargetObj, $this->getConfig());
Hooks::run('UndeleteForm::showHistory', array(&$archive, $this->mTargetObj));
/*
$text = $archive->getLastRevisionText();
if( is_null( $text ) ) {
$out->addWikiMsg( 'nohistory' );
return;
}
*/
$out->addHTML('<div class="mw-undelete-history">');
if ($this->mAllowed) {
$out->addWikiMsg('undeletehistory');
$out->addWikiMsg('undeleterevdel');
} else {
$out->addWikiMsg('undeletehistorynoadmin');
}
$out->addHTML('</div>');
# List all stored revisions
$revisions = $archive->listRevisions();
$files = $archive->listFiles();
$haveRevisions = $revisions && $revisions->numRows() > 0;
$haveFiles = $files && $files->numRows() > 0;
# Batch existence check on user and talk pages
if ($haveRevisions) {
$batch = new LinkBatch();
foreach ($revisions as $row) {
$batch->addObj(Title::makeTitleSafe(NS_USER, $row->ar_user_text));
$batch->addObj(Title::makeTitleSafe(NS_USER_TALK, $row->ar_user_text));
}
$batch->execute();
$revisions->seek(0);
}
if ($haveFiles) {
$batch = new LinkBatch();
foreach ($files as $row) {
$batch->addObj(Title::makeTitleSafe(NS_USER, $row->fa_user_text));
$batch->addObj(Title::makeTitleSafe(NS_USER_TALK, $row->fa_user_text));
}
$batch->execute();
$files->seek(0);
}
if ($this->mAllowed) {
$action = $this->getPageTitle()->getLocalURL(array('action' => 'submit'));
# Start the form here
$top = Xml::openElement('form', array('method' => 'post', 'action' => $action, 'id' => 'undelete'));
$out->addHTML($top);
}
# Show relevant lines from the deletion log:
$deleteLogPage = new LogPage('delete');
$out->addHTML(Xml::element('h2', null, $deleteLogPage->getName()->text()) . "\n");
LogEventsList::showLogExtract($out, 'delete', $this->mTargetObj);
# Show relevant lines from the suppression log:
$suppressLogPage = new LogPage('suppress');
if ($this->getUser()->isAllowed('suppressionlog')) {
$out->addHTML(Xml::element('h2', null, $suppressLogPage->getName()->text()) . "\n");
LogEventsList::showLogExtract($out, 'suppress', $this->mTargetObj);
}
if ($this->mAllowed && ($haveRevisions || $haveFiles)) {
# Format the user-visible controls (comment field, submission button)
# in a nice little table
if ($this->getUser()->isAllowed('suppressrevision')) {
$unsuppressBox = "<tr>\n\t\t\t\t\t\t<td> </td>\n\t\t\t\t\t\t<td class='mw-input'>" . Xml::checkLabel($this->msg('revdelete-unsuppress')->text(), 'wpUnsuppress', 'mw-undelete-unsuppress', $this->mUnsuppress) . "</td>\n\t\t\t\t\t</tr>";
} else {
$unsuppressBox = '';
}
$table = Xml::fieldset($this->msg('undelete-fieldset-title')->text()) . Xml::openElement('table', array('id' => 'mw-undelete-table')) . "<tr>\n\t\t\t\t\t<td colspan='2' class='mw-undelete-extrahelp'>" . $this->msg('undeleteextrahelp')->parseAsBlock() . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('undeletecomment')->text(), 'wpComment') . "</td>\n\t\t\t\t<td class='mw-input'>" . Xml::input('wpComment', 50, $this->mComment, array('id' => 'wpComment', 'autofocus' => '')) . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td> </td>\n\t\t\t\t<td class='mw-submit'>" . Xml::submitButton($this->msg('undeletebtn')->text(), array('name' => 'restore', 'id' => 'mw-undelete-submit')) . ' ' . Xml::submitButton($this->msg('undeleteinvert')->text(), array('name' => 'invert', 'id' => 'mw-undelete-invert')) . "</td>\n\t\t\t</tr>" . $unsuppressBox . Xml::closeElement('table') . Xml::closeElement('fieldset');
$out->addHTML($table);
}
$out->addHTML(Xml::element('h2', null, $this->msg('history')->text()) . "\n");
if ($haveRevisions) {
# The page's stored (deleted) history:
$out->addHTML('<ul>');
$remaining = $revisions->numRows();
$earliestLiveTime = $this->mTargetObj->getEarliestRevTime();
foreach ($revisions as $row) {
$remaining--;
$out->addHTML($this->formatRevisionRow($row, $earliestLiveTime, $remaining));
}
$revisions->free();
$out->addHTML('</ul>');
} else {
$out->addWikiMsg('nohistory');
}
if ($haveFiles) {
$out->addHTML(Xml::element('h2', null, $this->msg('filehist')->text()) . "\n");
$out->addHTML('<ul>');
foreach ($files as $row) {
$out->addHTML($this->formatFileRow($row));
}
$files->free();
$out->addHTML('</ul>');
}
//.........这里部分代码省略.........
示例9: getUploadForm
/**
* Get an UploadForm instance with title and text properly set.
*
* @param string $message HTML string to add to the form
* @param string $sessionKey Session key in case this is a stashed upload
* @param bool $hideIgnoreWarning Whether to hide "ignore warning" check box
* @return UploadForm
*/
protected function getUploadForm($message = '', $sessionKey = '', $hideIgnoreWarning = false)
{
# Initialize form
$context = new DerivativeContext($this->getContext());
$context->setTitle($this->getPageTitle());
// Remove subpage
$form = new UploadForm(array('watch' => $this->getWatchCheck(), 'forreupload' => $this->mForReUpload, 'sessionkey' => $sessionKey, 'hideignorewarning' => $hideIgnoreWarning, 'destwarningack' => (bool) $this->mDestWarningAck, 'description' => $this->mComment, 'texttop' => $this->uploadFormTextTop, 'textaftersummary' => $this->uploadFormTextAfterSummary, 'destfile' => $this->mDesiredDestName), $context);
# Check the token, but only if necessary
if (!$this->mTokenOk && !$this->mCancelUpload && ($this->mUpload && $this->mUploadClicked)) {
$form->addPreText($this->msg('session_fail_preview')->parse());
}
# Give a notice if the user is uploading a file that has been deleted or moved
# Note that this is independent from the message 'filewasdeleted' that requires JS
$desiredTitleObj = Title::makeTitleSafe(NS_FILE, $this->mDesiredDestName);
$delNotice = '';
// empty by default
if ($desiredTitleObj instanceof Title && !$desiredTitleObj->exists()) {
LogEventsList::showLogExtract($delNotice, array('delete', 'move'), $desiredTitleObj, '', array('lim' => 10, 'conds' => array("log_action != 'revision'"), 'showIfEmpty' => false, 'msgKey' => array('upload-recreate-warning')));
}
$form->addPreText($delNotice);
# Add text to form
$form->addPreText('<div id="uploadtext">' . $this->msg('uploadtext', array($this->mDesiredDestName))->parseAsBlock() . '</div>');
# Add upload error message
$form->addPreText($message);
# Add footer to form
$uploadFooter = $this->msg('uploadfooter');
if (!$uploadFooter->isDisabled()) {
$form->addPostText('<div id="mw-upload-footer-message">' . $uploadFooter->parseAsBlock() . "</div>\n");
}
return $form;
}
示例10: showLogFragment
/**
* Show a rights log fragment for the specified user
*
* @param $user User to show log for
* @param $output OutputPage to use
*/
protected function showLogFragment($user, $output)
{
$output->addHTML(Xml::element('h2', null, LogPage::logName('rights') . "\n"));
LogEventsList::showLogExtract($output, 'rights', $user->getUserPage()->getPrefixedText());
}
示例11: showLogFragment
function showLogFragment($title, &$out)
{
$out->addHTML(Xml::element('h2', null, LogPage::logName('move')));
LogEventsList::showLogExtract($out, 'move', $title->getPrefixedText());
}
示例12: postText
/**
* Add footer elements to the form
* @return string
*/
protected function postText()
{
# Link to the user's contributions, if applicable
if ($this->target instanceof User) {
$contribsPage = SpecialPage::getTitleFor('Contributions', $this->target->getName());
$links[] = Linker::link($contribsPage, $this->msg('ipb-blocklist-contribs', $this->target->getName())->escaped());
}
# Link to unblock the specified user, or to a blank unblock form
if ($this->target instanceof User) {
$message = $this->msg('ipb-unblock-addr', $this->target->getName())->parse();
$list = SpecialPage::getTitleFor('Unblock', $this->target->getName());
} else {
$message = $this->msg('ipb-unblock')->parse();
$list = SpecialPage::getTitleFor('Unblock');
}
$links[] = Linker::linkKnown($list, $message, array());
# Link to the block list
$links[] = Linker::linkKnown(SpecialPage::getTitleFor('BlockList'), $this->msg('ipb-blocklist')->escaped());
$user = $this->getUser();
# Link to edit the block dropdown reasons, if applicable
if ($user->isAllowed('editinterface')) {
$links[] = Linker::link(Title::makeTitle(NS_MEDIAWIKI, 'Ipbreason-dropdown'), $this->msg('ipb-edit-dropdown')->escaped(), array(), array('action' => 'edit'));
}
$text = Html::rawElement('p', array('class' => 'mw-ipb-conveniencelinks'), $this->getLanguage()->pipeList($links));
if ($this->target instanceof User) {
# Get relevant extracts from the block and suppression logs, if possible
$userpage = $this->target->getUserPage();
$out = '';
LogEventsList::showLogExtract($out, 'block', $userpage, '', array('lim' => 10, 'msgKey' => array('blocklog-showlog', $userpage->getText()), 'showIfEmpty' => false));
$text .= $out;
# Add suppression block entries if allowed
if ($user->isAllowed('suppressionlog')) {
LogEventsList::showLogExtract($out, 'suppress', $userpage, '', array('lim' => 10, 'conds' => array('log_action' => array('block', 'reblock', 'unblock')), 'msgKey' => array('blocklog-showsuppresslog', $userpage->getText()), 'showIfEmpty' => false));
$text .= $out;
}
}
return $text;
}
示例13: showLogExtract
/**
* @param $username Title
* @param $type
* @param $out OutputPage
*/
function showLogExtract($username, $type, &$out)
{
# Show relevant lines from the logs:
$out->addHTML(Xml::element('h2', null, LogPage::logName($type)) . "\n");
LogEventsList::showLogExtract($out, $type, $username->getPrefixedText());
}
示例14: showLogExtract
/**
* Show the last 50 log entries
*/
function showLogExtract()
{
$text = '';
$numRows = LogEventsList::showLogExtract($text, array('globalauth', 'suppress'), '', '', array('conds' => array('log_action' => 'setstatus'), 'showIfEmpty' => true));
if ($numRows) {
$this->getOutput()->addHTML(Xml::fieldset($this->msg('centralauth-admin-logsnippet')->text(), $text));
}
}
示例15: showLogFragment
private function showLogFragment($out, $title)
{
global $wgUser;
// Used to support GENDER in 'blocklog-showlog' and 'blocklog-showsuppresslog'
$userBlocked = $title->getText();
LogEventsList::showLogExtract($out, 'block', $title->getPrefixedText(), '', array('lim' => 10, 'msgKey' => array('blocklog-showlog', $userBlocked), 'showIfEmpty' => false));
// Add suppression block entries if allowed
if ($wgUser->isAllowed('hideuser')) {
LogEventsList::showLogExtract($out, 'suppress', $title->getPrefixedText(), '', array('lim' => 10, 'conds' => array('log_action' => array('block', 'reblock', 'unblock')), 'msgKey' => array('blocklog-showsuppresslog', $userBlocked), 'showIfEmpty' => false));
}
}