本文整理匯總了PHP中LogPage::getName方法的典型用法代碼示例。如果您正苦於以下問題:PHP LogPage::getName方法的具體用法?PHP LogPage::getName怎麽用?PHP LogPage::getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類LogPage
的用法示例。
在下文中一共展示了LogPage::getName方法的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: getLogTitle
function getLogTitle($rc)
{
$logtype = $rc->getAttribute('rc_log_type');
$logpage = new LogPage($logtype);
$logname = $logpage->getName()->escaped();
$titleObj = SpecialPage::getTitleFor('Log', $logtype);
return '(' . $this->skin->makeKnownLinkObj($titleObj, $logname) . ')';
}
示例3: showForm
//.........這裏部分代碼省略.........
$title = $this->form->getPage();
$oldConfig = $form->getOldConfig();
$s = '';
// form HTML string
# Add any error messages
if ("" != $err) {
$out->setSubtitle($this->msg('formerror'));
$out->addHTML("<p class='error'>{$err}</p>\n");
}
# Add header text
if (!$form->isAllowed()) {
$s .= $this->msg('stabilization-perm', $title->getPrefixedText())->parseAsBlock();
} else {
$s .= $this->msg('stabilization-text', $title->getPrefixedText())->parseAsBlock();
}
# Traditionally, the list of reasons for stabilization is the same as
# for protection. In some cases, however, it might be desirable to
# use a different list for stabilization.
$defaultReasons = $this->msg('stabilization-dropdown');
if ($defaultReasons->isDisabled()) {
$defaultReasons = $this->msg('protect-dropdown');
}
$reasonDropDown = Xml::listDropDown('wpReasonSelection', $defaultReasons->inContentLanguage()->text(), $this->msg('protect-otherreason-op')->inContentLanguage()->text(), $form->getReasonSelection(), 'mwStabilize-reason', 4);
$scExpiryOptions = $this->msg('protect-expiry-options')->inContentLanguage()->text();
$showProtectOptions = $scExpiryOptions !== '-' && $form->isAllowed();
$dropdownOptions = array();
// array of <label,value>
# Add the current expiry as a dropdown option
if ($oldConfig['expiry'] && $oldConfig['expiry'] != 'infinity') {
$timestamp = $this->getLanguage()->timeanddate($oldConfig['expiry']);
$d = $this->getLanguage()->date($oldConfig['expiry']);
$t = $this->getLanguage()->time($oldConfig['expiry']);
$dropdownOptions[] = array($this->msg('protect-existing-expiry', $timestamp, $d, $t)->text(), 'existing');
}
# Add "other time" expiry dropdown option
$dropdownOptions[] = array($this->msg('protect-othertime-op')->text(), 'othertime');
# Add custom expiry dropdown options (from MediaWiki message)
foreach (explode(',', $scExpiryOptions) as $option) {
if (strpos($option, ":") === false) {
$show = $value = $option;
} else {
list($show, $value) = explode(":", $option);
}
$dropdownOptions[] = array($show, $value);
}
# Actually build the options HTML...
$expiryFormOptions = '';
foreach ($dropdownOptions as $option) {
$show = htmlspecialchars($option[0]);
$value = htmlspecialchars($option[1]);
$expiryFormOptions .= Xml::option($show, $value, $form->getExpirySelection() === $value) . "\n";
}
# Build up the form...
$s .= Xml::openElement('form', array('name' => 'stabilization', 'action' => $this->getPageTitle()->getLocalUrl(), 'method' => 'post'));
# Add stable version override and selection options
$s .= Xml::fieldset($this->msg('stabilization-def')->text(), false) . "\n" . Xml::radioLabel($this->msg('stabilization-def1')->text(), 'wpStableconfig-override', 1, 'default-stable', 1 == $form->getOverride(), $this->disabledAttr()) . '<br />' . "\n" . Xml::radioLabel($this->msg('stabilization-def2')->text(), 'wpStableconfig-override', 0, 'default-current', 0 == $form->getOverride(), $this->disabledAttr()) . "\n" . Xml::closeElement('fieldset');
# Add autoreview restriction select
$s .= Xml::fieldset($this->msg('stabilization-restrict')->text(), false) . $this->buildSelector($form->getAutoreview()) . Xml::closeElement('fieldset') . Xml::fieldset($this->msg('stabilization-leg')->text(), false) . Xml::openElement('table');
# Add expiry dropdown to form...
if ($showProtectOptions && $form->isAllowed()) {
$s .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('stabilization-expiry')->text(), 'mwStabilizeExpirySelection') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::tags('select', array('id' => 'mwStabilizeExpirySelection', 'name' => 'wpExpirySelection', 'onchange' => 'onFRChangeExpiryDropdown()') + $this->disabledAttr(), $expiryFormOptions) . "</td>\n\t\t\t\t</tr>";
}
# Add custom expiry field to form...
$attribs = array('id' => "mwStabilizeExpiryOther", 'onkeyup' => 'onFRChangeExpiryField()') + $this->disabledAttr();
$s .= "\n\t\t\t<tr>\n\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('stabilization-othertime')->text(), 'mwStabilizeExpiryOther') . '</td>
<td class="mw-input">' . Xml::input("mwStabilize-expiry", 50, $form->getExpiryCustom(), $attribs) . '</td>
</tr>';
# Add comment input and submit button
if ($form->isAllowed()) {
$watchLabel = $this->msg('watchthis')->parse();
$watchAttribs = array('accesskey' => $this->msg('accesskey-watch')->text(), 'id' => 'wpWatchthis');
$watchChecked = $this->getUser()->getOption('watchdefault') || $title->userIsWatching();
$reviewLabel = $this->msg('stabilization-review')->parse();
$s .= ' <tr>
<td class="mw-label">' . xml::label($this->msg('stabilization-comment')->text(), 'wpReasonSelection') . '</td>
<td class="mw-input">' . $reasonDropDown . '</td>
</tr>
<tr>
<td class="mw-label">' . Xml::label($this->msg('stabilization-otherreason')->text(), 'wpReason') . '</td>
<td class="mw-input">' . Xml::input('wpReason', 70, $form->getReasonExtra(), array('id' => 'wpReason', 'maxlength' => 255)) . '</td>
</tr>
<tr>
<td></td>
<td class="mw-input">' . Xml::check('wpReviewthis', $form->getReviewThis(), array('id' => 'wpReviewthis')) . "<label for='wpReviewthis'>{$reviewLabel}</label>" . '     ' . Xml::check('wpWatchthis', $watchChecked, $watchAttribs) . " <label for='wpWatchthis' " . Xml::expandAttributes(array('title' => Linker::titleAttrib('watch', 'withaccess'))) . ">{$watchLabel}</label>" . '</td>
</tr>
<tr>
<td></td>
<td class="mw-submit">' . Xml::submitButton($this->msg('stabilization-submit')->text()) . '</td>
</tr>' . Xml::closeElement('table') . Html::hidden('title', $this->getPageTitle()->getPrefixedDBKey()) . Html::hidden('page', $title->getPrefixedText()) . Html::hidden('wpEditToken', $this->getUser()->getEditToken());
} else {
$s .= Xml::closeElement('table');
}
$s .= Xml::closeElement('fieldset') . Xml::closeElement('form');
$out->addHTML($s);
$log = new LogPage('stable');
$out->addHTML(Xml::element('h2', null, htmlspecialchars($log->getName())));
LogEventsList::showLogExtract($out, 'stable', $title->getPrefixedText(), '', array('lim' => 25));
# Add some javascript for expiry dropdowns
$out->addScript("<script type=\"text/javascript\">\n\t\t\t\tfunction onFRChangeExpiryDropdown() {\n\t\t\t\t\tdocument.getElementById('mwStabilizeExpiryOther').value = '';\n\t\t\t\t}\n\t\t\t\tfunction onFRChangeExpiryField() {\n\t\t\t\t\tdocument.getElementById('mwStabilizeExpirySelection').value = 'othertime';\n\t\t\t\t}\n\t\t\t</script>");
}
示例4: showLogFragment
/**
* @param $group
* @param $output OutputPage
*/
protected function showLogFragment($group, $output)
{
$title = SpecialPage::getTitleFor('GlobalUsers', $group);
$logPage = new LogPage('gblrights');
$output->addHTML(Xml::element('h2', null, $logPage->getName()->text() . "\n"));
LogEventsList::showLogExtract($output, 'gblrights', $title->getPrefixedText());
}
示例5: showHistory
private function showHistory()
{
$this->showMergeForm();
# List all stored revisions
$revisions = new MergeHistoryPager($this, [], $this->mTargetObj, $this->mDestObj);
$haveRevisions = $revisions && $revisions->getNumRows() > 0;
$out = $this->getOutput();
$titleObj = $this->getPageTitle();
$action = $titleObj->getLocalURL(['action' => 'submit']);
# Start the form here
$top = Xml::openElement('form', ['method' => 'post', 'action' => $action, 'id' => 'merge']);
$out->addHTML($top);
if ($haveRevisions) {
# Format the user-visible controls (comment field, submission button)
# in a nice little table
$table = Xml::openElement('fieldset') . $this->msg('mergehistory-merge', $this->mTargetObj->getPrefixedText(), $this->mDestObj->getPrefixedText())->parse() . Xml::openElement('table', ['id' => 'mw-mergehistory-table']) . '<tr>
<td class="mw-label">' . Xml::label($this->msg('mergehistory-reason')->text(), 'wpComment') . '</td>
<td class="mw-input">' . Xml::input('wpComment', 50, $this->mComment, ['id' => 'wpComment']) . '</td>
</tr>
<tr>
<td> </td>
<td class="mw-submit">' . Xml::submitButton($this->msg('mergehistory-submit')->text(), ['name' => 'merge', 'id' => 'mw-merge-submit']) . '</td>
</tr>' . Xml::closeElement('table') . Xml::closeElement('fieldset');
$out->addHTML($table);
}
$out->addHTML('<h2 id="mw-mergehistory">' . $this->msg('mergehistory-list')->escaped() . "</h2>\n");
if ($haveRevisions) {
$out->addHTML($revisions->getNavigationBar());
$out->addHTML('<ul>');
$out->addHTML($revisions->getBody());
$out->addHTML('</ul>');
$out->addHTML($revisions->getNavigationBar());
} else {
$out->addWikiMsg('mergehistory-empty');
}
# Show relevant lines from the merge log:
$mergeLogPage = new LogPage('merge');
$out->addHTML('<h2>' . $mergeLogPage->getName()->escaped() . "</h2>\n");
LogEventsList::showLogExtract($out, 'merge', $this->mTargetObj);
# When we submit, go by page ID to avoid some nasty but unlikely collisions.
# Such would happen if a page was renamed after the form loaded, but before submit
$misc = Html::hidden('targetID', $this->mTargetObj->getArticleID());
$misc .= Html::hidden('destID', $this->mDestObj->getArticleID());
$misc .= Html::hidden('target', $this->mTarget);
$misc .= Html::hidden('dest', $this->mDest);
$misc .= Html::hidden('wpEditToken', $this->getUser()->getEditToken());
$misc .= Xml::closeElement('form');
$out->addHTML($misc);
return true;
}
示例6: 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));
}
}
示例7: 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>');
}
//.........這裏部分代碼省略.........
示例8: addHeader
/**
* Set page title and show header for this log type
* @param string $type
* @since 1.19
*/
protected function addHeader($type)
{
$page = new LogPage($type);
$this->getOutput()->setPageTitle($page->getName());
$this->getOutput()->addHTML($page->getDescription()->setContext($this->getContext())->parseAsBlock());
}
示例9: getTypeSelector
/**
* Returns log page selector.
* @return XmlSelect
* @since 1.19
*/
public function getTypeSelector()
{
$typesByName = array();
// Temporary array
// First pass to load the log names
foreach (LogPage::validTypes() as $type) {
$page = new LogPage($type);
$restriction = $page->getRestriction();
if ($this->getUser()->isAllowed($restriction)) {
$typesByName[$type] = $page->getName()->text();
}
}
// Second pass to sort by name
asort($typesByName);
// Always put "All public logs" on top
$public = $typesByName[''];
unset($typesByName['']);
$typesByName = array('' => $public) + $typesByName;
$select = new XmlSelect('type');
foreach ($typesByName as $type => $name) {
$select->addOption($name, $type);
}
return $select;
}
示例10: showLogExtract
/**
* @param $username Title
* @param $type
* @param $out OutputPage
*/
function showLogExtract($username, $type, &$out)
{
# Show relevant lines from the logs:
$logPage = new LogPage($type);
$out->addHTML(Xml::element('h2', null, $logPage->getName()->text()) . "\n");
LogEventsList::showLogExtract($out, $type, $username->getPrefixedText());
}
示例11: getLogLink
private function getLogLink($logType)
{
$logtitle = SpecialPage::getTitleFor('Log', $logType);
$logpage = new LogPage($logType);
$logname = $logpage->getName()->escaped();
$logLink = $this->context->msg('parentheses')->rawParams(Linker::linkKnown($logtitle, $logname))->escaped();
return $logLink;
}
示例12: recentChangesLine
/**
* Format a line for enhanced recentchange (aka with javascript and block of lines).
*
* @param $baseRC RecentChange
* @param $watched bool
*
* @return string
*/
public function recentChangesLine(&$baseRC, $watched = false)
{
wfProfileIn(__METHOD__);
# Create a specialised object
$rc = RCCacheEntry::newFromParent($baseRC);
# If it's a new day, add the headline and flush the cache
$date = $this->getLanguage()->date($rc->mAttribs['rc_timestamp'], true);
$ret = '';
if ($date != $this->lastdate) {
# Process current cache
$ret = $this->recentChangesBlock();
$this->rc_cache = array();
$ret .= Xml::element('h4', null, $date) . "\n";
$this->lastdate = $date;
}
# Should patrol-related stuff be shown?
$rc->unpatrolled = $this->showAsUnpatrolled($rc);
$linksCache = $this->lineLinksCache($rc, $rc->unpatrolled);
$showdifflinks = true;
# Make article link
$type = $rc->mAttribs['rc_type'];
$logType = $rc->mAttribs['rc_log_type'];
// Page moves, very old style, not supported anymore
if ($type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT) {
// New unpatrolled pages
} elseif ($rc->unpatrolled && $type == RC_NEW) {
$clink = $linksCache['clink_unpatrolled'];
// Log entries
} elseif ($type == RC_LOG) {
if ($logType) {
$logtitle = SpecialPage::getTitleFor('Log', $logType);
$logpage = new LogPage($logType);
$logname = $logpage->getName()->escaped();
$clink = '(' . Linker::linkKnown($logtitle, $logname) . ')';
} else {
$clink = $linksCache['clink'];
}
$watched = false;
// Log entries (old format) and special pages
} elseif ($rc->mAttribs['rc_namespace'] == NS_SPECIAL) {
wfDebug("Unexpected special page in recentchanges\n");
$clink = '';
// Edits
} else {
$clink = $linksCache['clink'];
}
# Don't show unusable diff links
if (!ChangesList::userCan($rc, Revision::DELETED_TEXT, $this->getUser())) {
$showdifflinks = false;
}
$time = $this->getLanguage()->time($rc->mAttribs['rc_timestamp'], true, true);
$rc->watched = $watched;
$rc->link = $clink;
$rc->timestamp = $time;
$rc->numberofWatchingusers = $baseRC->numberofWatchingusers;
if (!$showdifflinks) {
$curLink = $this->message['cur'];
$diffLink = $this->message['diff'];
} else {
$rc->curlink = $linksCache['cur'];
$rc->difflink = $linksCache['diff'];
}
# Make "last" link
if (!$showdifflinks || !$lastOldid) {
$lastLink = $this->message['last'];
} else {
$rc->lastlink = $linksCache['last'];
}
# Make user links
$rc->userlink = $linksCache['userlink'];
$rc->usertalklink = $linksCache['usertalklink'];
# Put accumulated information into the cache, for later display
# Page moves go on their own line
$title = $rc->getTitle();
$secureName = $title->getPrefixedDBkey();
if ($type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT) {
# Use an @ character to prevent collision with page names
$this->rc_cache['@@' . $this->rcMoveIndex++] = array($rc);
} else {
# Logs are grouped by type
if ($type == RC_LOG) {
$secureName = SpecialPage::getTitleFor('Log', $logType)->getPrefixedDBkey();
}
// Start of Wikia change - @author unknown
wfRunHooks('ChangesListMakeSecureName', array($this, &$secureName, $rc));
// End of Wikia change
if (!isset($this->rc_cache[$secureName])) {
$this->rc_cache[$secureName] = array();
}
array_push($this->rc_cache[$secureName], $rc);
}
wfProfileOut(__METHOD__);
//.........這裏部分代碼省略.........
示例13: insertLog
/**
* @param string $s HTML to update
* @param Title $title
* @param string $logtype
*/
public function insertLog(&$s, $title, $logtype)
{
$page = new LogPage($logtype);
$logname = $page->getName()->setContext($this->getContext())->text();
$s .= $this->msg('parentheses')->rawParams($this->linkRenderer->makeKnownLink($title, $logname))->escaped();
}
示例14: showLogFragment
/**
* @param string $number
*/
protected function showLogFragment($number)
{
$title = SpecialPage::getTitleFor('WikiSets', $number);
$logPage = new LogPage('gblrights');
$out = $this->getOutput();
$out->addHTML(Xml::element('h2', null, $logPage->getName()->text() . "\n"));
LogEventsList::showLogExtract($out, 'gblrights', $title->getPrefixedText());
}
示例15: showHistory
private function showHistory()
{
# List all stored revisions
$revisions = new MergeHistoryPager($this, [], $this->mTargetObj, $this->mDestObj);
$haveRevisions = $revisions && $revisions->getNumRows() > 0;
$out = $this->getOutput();
$header = '<h2 id="mw-mergehistory">' . $this->msg('mergehistory-list')->escaped() . "</h2>\n";
if ($haveRevisions) {
$hiddenFields = ['merge' => true, 'target' => $this->mOpts->getValue('target'), 'dest' => $this->mOpts->getValue('dest')];
$formDescriptor = ['reason' => ['type' => 'text', 'name' => 'reason', 'label-message' => 'mergehistory-reason']];
$mergeText = $this->msg('mergehistory-merge', $this->mTargetObj->getPrefixedText(), $this->mDestObj->getPrefixedText())->parse();
$history = $header . $revisions->getNavigationBar() . '<ul>' . $revisions->getBody() . '</ul>' . $revisions->getNavigationBar();
$form = HTMLForm::factory('ooui', $formDescriptor, $this->getContext())->addHiddenFields($hiddenFields)->setPreText($mergeText)->setFooterText($history)->setSubmitTextMsg('mergehistory-submit')->setMethod('post')->prepareForm()->displayForm(false);
} else {
$out->addHTML($header);
$out->addWikiMsg('mergehistory-empty');
}
# Show relevant lines from the merge log:
$mergeLogPage = new LogPage('merge');
$out->addHTML('<h2>' . $mergeLogPage->getName()->escaped() . "</h2>\n");
LogEventsList::showLogExtract($out, 'merge', $this->mTargetObj);
}