本文整理汇总了PHP中LogEventsList类的典型用法代码示例。如果您正苦于以下问题:PHP LogEventsList类的具体用法?PHP LogEventsList怎么用?PHP LogEventsList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LogEventsList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: wfSpecialLog
/**
* constructor
*/
function wfSpecialLog($par = '')
{
global $wgRequest, $wgOut, $wgUser, $wgLogTypes;
# Get parameters
$parms = explode('/', $par = $par !== null ? $par : '');
$symsForAll = array('*', 'all');
if ($parms[0] != '' && (in_array($par, $wgLogTypes) || in_array($par, $symsForAll))) {
$type = $par;
$user = $wgRequest->getText('user');
} else {
if (count($parms) == 2) {
$type = $parms[0];
$user = $parms[1];
} else {
$type = $wgRequest->getVal('type');
$user = $par != '' ? $par : $wgRequest->getText('user');
}
}
$title = $wgRequest->getText('page');
$pattern = $wgRequest->getBool('pattern');
$y = $wgRequest->getIntOrNull('year');
$m = $wgRequest->getIntOrNull('month');
$tagFilter = $wgRequest->getVal('tagfilter');
# Don't let the user get stuck with a certain date
$skip = $wgRequest->getText('offset') || $wgRequest->getText('dir') == 'prev';
if ($skip) {
$y = '';
$m = '';
}
# Handle type-specific inputs
$qc = array();
if ($type == 'suppress') {
$offender = User::newFromName($wgRequest->getVal('offender'), false);
if ($offender && $offender->getId() > 0) {
$qc = array('ls_field' => 'target_author_id', 'ls_value' => $offender->getId());
} else {
if ($offender && IP::isIPAddress($offender->getName())) {
$qc = array('ls_field' => 'target_author_ip', 'ls_value' => $offender->getName());
}
}
}
# Create a LogPager item to get the results and a LogEventsList item to format them...
$loglist = new LogEventsList($wgUser->getSkin(), $wgOut, 0);
$pager = new LogPager($loglist, $type, $user, $title, $pattern, $qc, $y, $m, $tagFilter);
# Set title and add header
$loglist->showHeader($pager->getType());
# Show form options
$loglist->showOptions($pager->getType(), $pager->getUser(), $pager->getPage(), $pager->getPattern(), $pager->getYear(), $pager->getMonth(), $pager->getFilterParams(), $tagFilter);
# Insert list
$logBody = $pager->getBody();
if ($logBody) {
$wgOut->addHTML($pager->getNavigationBar() . $loglist->beginLogEventsList() . $logBody . $loglist->endLogEventsList() . $pager->getNavigationBar());
} else {
$wgOut->addWikiMsg('logempty');
}
}
开发者ID:rocLv,项目名称:conference,代码行数:59,代码来源:SpecialLog.php
示例2: 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());
}
开发者ID:NDKilla,项目名称:mediawiki-extensions-CentralAuth,代码行数:11,代码来源:SpecialGlobalGroupMembership.php
示例3: getHTML
/**
* @return string A HTML <li> element representing this revision, showing
* change tags and everything
*/
public function getHTML()
{
$date = htmlspecialchars($this->list->getLanguage()->userTimeAndDate($this->row->log_timestamp, $this->list->getUser()));
$title = Title::makeTitle($this->row->log_namespace, $this->row->log_title);
$formatter = LogFormatter::newFromRow($this->row);
$formatter->setContext($this->list->getContext());
$formatter->setAudience(LogFormatter::FOR_THIS_USER);
// Log link for this page
$loglink = Linker::link(SpecialPage::getTitleFor('Log'), $this->list->msg('log')->escaped(), array(), array('page' => $title->getPrefixedText()));
$loglink = $this->list->msg('parentheses')->rawParams($loglink)->escaped();
// User links and action text
$action = $formatter->getActionText();
// Comment
$comment = $this->list->getLanguage()->getDirMark() . $formatter->getComment();
if (LogEventsList::isDeleted($this->row, LogPage::DELETED_COMMENT)) {
$comment = '<span class="history-deleted">' . $comment . '</span>';
}
$content = "{$loglink} {$date} {$action} {$comment}";
$attribs = array();
$tags = $this->getTags();
if ($tags) {
list($tagSummary, $classes) = ChangeTags::formatSummaryRow($tags, 'edittags', $this->list->getContext());
$content .= " {$tagSummary}";
$attribs['class'] = implode(' ', $classes);
}
return Xml::tags('li', $attribs, $content);
}
开发者ID:OrBin,项目名称:mediawiki,代码行数:31,代码来源:ChangeTagsLogItem.php
示例4: execute
public function execute($par)
{
global $wgFlaggedRevsOversightAge;
$out = $this->getOutput();
$request = $this->getRequest();
$this->setHeaders();
$this->namespace = $request->getInt('namespace');
$this->level = $request->getIntOrNull('level');
$this->status = $request->getIntOrNull('status');
$this->automatic = $request->getIntOrNull('automatic');
$this->user = $request->getVal('user');
# Check if the user exists
$usertitle = Title::makeTitleSafe(NS_USER, $this->user);
$u = $usertitle ? User::idFromName($this->user) : false;
# Are the dropdown params given even valid?
$actions = $this->getActions();
if (empty($actions)) {
$out->addWikiMsg('qualityoversight-list', 0);
$out->addWikiMsg('logempty');
return;
}
# Get extra query conds
$conds = array('log_namespace' => $this->namespace, 'log_action' => $actions);
# Get cutoff time (mainly for performance)
if (!$u) {
$dbr = wfGetDB(DB_SLAVE);
$cutoff_unixtime = time() - $wgFlaggedRevsOversightAge;
$cutoff = $dbr->addQuotes($dbr->timestamp($cutoff_unixtime));
$conds[] = "log_timestamp >= {$cutoff}";
}
# Create a LogPager item to get the results and a LogEventsList item to format them...
$loglist = new LogEventsList($this->getContext()->getSkin(), $out, 0);
$pager = new LogPager($loglist, 'review', $this->user, '', '', $conds);
# Explanatory text
$out->addWikiMsg('qualityoversight-list', $this->getLanguage()->formatNum($pager->getNumRows()));
# Show form options
$this->showForm();
# Insert list
$logBody = $pager->getBody();
if ($logBody) {
$out->addHTML($pager->getNavigationBar() . $loglist->beginLogEventsList() . $logBody . $loglist->endLogEventsList() . $pager->getNavigationBar());
} else {
$out->addWikiMsg('logempty');
}
}
开发者ID:crippsy14,项目名称:orange-smorange,代码行数:45,代码来源:QualityOversight_body.php
示例5: 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;
}
开发者ID:jpena88,项目名称:mediawiki-dokku-deploy,代码行数:19,代码来源:Renameuser.hooks.php
示例6: canView
/**
* Check if a log item can be displayed
* @param int $field LogPage::DELETED_* constant
* @return bool
*/
protected function canView($field)
{
if ($this->audience == self::FOR_THIS_USER) {
return LogEventsList::userCanBitfield($this->entry->getDeleted(), $field, $this->context->getUser());
} else {
return !$this->entry->isDeleted($field);
}
}
开发者ID:D66Ha,项目名称:mediawiki,代码行数:13,代码来源:LogFormatter.php
示例7: showLogExtract
/**
* Show protection long extracts for this page
*
* @param $out OutputPage
* @access private
*/
function showLogExtract(&$out)
{
# Show relevant lines from the protection log:
$protectLogPage = new LogPage('protect');
$out->addHTML(Xml::element('h2', null, $protectLogPage->getName()->text()));
LogEventsList::showLogExtract($out, 'protect', $this->mTitle);
# Let extensions add other relevant log extracts
wfRunHooks('ProtectionForm::showLogExtract', array($this->mArticle, $out));
}
开发者ID:Tarendai,项目名称:spring-website,代码行数:15,代码来源:ProtectionForm.php
示例8: extractRowInfo
/**
* Extracts from a single sql row the data needed to describe one recent change.
*
* @param stdClass $row The row from which to extract the data.
* @return array An array mapping strings (descriptors) to their respective string values.
* @access public
*/
public function extractRowInfo($row)
{
/* Determine the title of the page that has been changed. */
$title = Title::makeTitle($row->rc_namespace, $row->rc_title);
$user = $this->getUser();
/* Our output data. */
$vals = array();
$type = intval($row->rc_type);
$vals['type'] = RecentChange::parseFromRCType($type);
$anyHidden = false;
/* Create a new entry in the result for the title. */
if ($this->fld_title || $this->fld_ids) {
if ($type === RC_LOG && $row->rc_deleted & LogPage::DELETED_ACTION) {
$vals['actionhidden'] = true;
$anyHidden = true;
}
if ($type !== RC_LOG || LogEventsList::userCanBitfield($row->rc_deleted, LogPage::DELETED_ACTION, $user)) {
if ($this->fld_title) {
ApiQueryBase::addTitleInfo($vals, $title);
}
if ($this->fld_ids) {
$vals['pageid'] = intval($row->rc_cur_id);
$vals['revid'] = intval($row->rc_this_oldid);
$vals['old_revid'] = intval($row->rc_last_oldid);
}
}
}
if ($this->fld_ids) {
$vals['rcid'] = intval($row->rc_id);
}
/* Add user data and 'anon' flag, if user is anonymous. */
if ($this->fld_user || $this->fld_userid) {
if ($row->rc_deleted & Revision::DELETED_USER) {
$vals['userhidden'] = true;
$anyHidden = true;
}
if (Revision::userCanBitfield($row->rc_deleted, Revision::DELETED_USER, $user)) {
if ($this->fld_user) {
$vals['user'] = $row->rc_user_text;
}
if ($this->fld_userid) {
$vals['userid'] = $row->rc_user;
}
if (!$row->rc_user) {
$vals['anon'] = true;
}
}
}
/* Add flags, such as new, minor, bot. */
if ($this->fld_flags) {
$vals['bot'] = (bool) $row->rc_bot;
$vals['new'] = $row->rc_type == RC_NEW;
$vals['minor'] = (bool) $row->rc_minor;
}
/* Add sizes of each revision. (Only available on 1.10+) */
if ($this->fld_sizes) {
$vals['oldlen'] = intval($row->rc_old_len);
$vals['newlen'] = intval($row->rc_new_len);
}
/* Add the timestamp. */
if ($this->fld_timestamp) {
$vals['timestamp'] = wfTimestamp(TS_ISO_8601, $row->rc_timestamp);
}
/* Add edit summary / log summary. */
if ($this->fld_comment || $this->fld_parsedcomment) {
if ($row->rc_deleted & Revision::DELETED_COMMENT) {
$vals['commenthidden'] = true;
$anyHidden = true;
}
if (Revision::userCanBitfield($row->rc_deleted, Revision::DELETED_COMMENT, $user)) {
if ($this->fld_comment && isset($row->rc_comment)) {
$vals['comment'] = $row->rc_comment;
}
if ($this->fld_parsedcomment && isset($row->rc_comment)) {
$vals['parsedcomment'] = Linker::formatComment($row->rc_comment, $title);
}
}
}
if ($this->fld_redirect) {
$vals['redirect'] = (bool) $row->page_is_redirect;
}
/* Add the patrolled flag */
if ($this->fld_patrolled) {
$vals['patrolled'] = $row->rc_patrolled == 1;
$vals['unpatrolled'] = ChangesList::isUnpatrolled($row, $user);
}
if ($this->fld_loginfo && $row->rc_type == RC_LOG) {
if ($row->rc_deleted & LogPage::DELETED_ACTION) {
$vals['actionhidden'] = true;
$anyHidden = true;
}
if (LogEventsList::userCanBitfield($row->rc_deleted, LogPage::DELETED_ACTION, $user)) {
$vals['logid'] = intval($row->rc_logid);
//.........这里部分代码省略.........
开发者ID:eliagbayani,项目名称:LiteratureEditor,代码行数:101,代码来源:ApiQueryRecentChanges.php
示例9: formatValue
/**
* @param string $field
* @param string $value
* @return string HTML
* @throws MWException
*/
function formatValue($field, $value)
{
/** @var $row object */
$row = $this->mCurrentRow;
$formatted = '';
switch ($field) {
case 'log_timestamp':
// when timestamp is null, this is a old protection row
if ($value === null) {
$formatted = Html::rawElement('span', array('class' => 'mw-protectedpages-unknown'), $this->msg('protectedpages-unknown-timestamp')->escaped());
} else {
$formatted = htmlspecialchars($this->getLanguage()->userTimeAndDate($value, $this->getUser()));
}
break;
case 'pr_page':
$title = Title::makeTitleSafe($row->page_namespace, $row->page_title);
if (!$title) {
$formatted = Html::element('span', array('class' => 'mw-invalidtitle'), Linker::getInvalidTitleDescription($this->getContext(), $row->page_namespace, $row->page_title));
} else {
$formatted = Linker::link($title);
}
if (!is_null($row->page_len)) {
$formatted .= $this->getLanguage()->getDirMark() . ' ' . Html::rawElement('span', array('class' => 'mw-protectedpages-length'), Linker::formatRevisionSize($row->page_len));
}
break;
case 'pr_expiry':
$formatted = htmlspecialchars($this->getLanguage()->formatExpiry($value, true));
$title = Title::makeTitleSafe($row->page_namespace, $row->page_title);
if ($this->getUser()->isAllowed('protect') && $title) {
$changeProtection = Linker::linkKnown($title, $this->msg('protect_change')->escaped(), array(), array('action' => 'unprotect'));
$formatted .= ' ' . Html::rawElement('span', array('class' => 'mw-protectedpages-actions'), $this->msg('parentheses')->rawParams($changeProtection)->escaped());
}
break;
case 'log_user':
// when timestamp is null, this is a old protection row
if ($row->log_timestamp === null) {
$formatted = Html::rawElement('span', array('class' => 'mw-protectedpages-unknown'), $this->msg('protectedpages-unknown-performer')->escaped());
} else {
$username = UserCache::singleton()->getProp($value, 'name');
if (LogEventsList::userCanBitfield($row->log_deleted, LogPage::DELETED_USER, $this->getUser())) {
if ($username === false) {
$formatted = htmlspecialchars($value);
} else {
$formatted = Linker::userLink($value, $username) . Linker::userToolLinks($value, $username);
}
} else {
$formatted = $this->msg('rev-deleted-user')->escaped();
}
if (LogEventsList::isDeleted($row, LogPage::DELETED_USER)) {
$formatted = '<span class="history-deleted">' . $formatted . '</span>';
}
}
break;
case 'pr_params':
$params = array();
// Messages: restriction-level-sysop, restriction-level-autoconfirmed
$params[] = $this->msg('restriction-level-' . $row->pr_level)->escaped();
if ($row->pr_cascade) {
$params[] = $this->msg('protect-summary-cascade')->escaped();
}
$formatted = $this->getLanguage()->commaList($params);
break;
case 'log_comment':
// when timestamp is null, this is an old protection row
if ($row->log_timestamp === null) {
$formatted = Html::rawElement('span', array('class' => 'mw-protectedpages-unknown'), $this->msg('protectedpages-unknown-reason')->escaped());
} else {
if (LogEventsList::userCanBitfield($row->log_deleted, LogPage::DELETED_COMMENT, $this->getUser())) {
$formatted = Linker::formatComment($value !== null ? $value : '');
} else {
$formatted = $this->msg('rev-deleted-comment')->escaped();
}
if (LogEventsList::isDeleted($row, LogPage::DELETED_COMMENT)) {
$formatted = '<span class="history-deleted">' . $formatted . '</span>';
}
}
break;
default:
throw new MWException("Unknown field '{$field}'");
}
return $formatted;
}
开发者ID:huatuoorg,项目名称:mediawiki,代码行数:88,代码来源:SpecialProtectedpages.php
示例10: 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());
}
开发者ID:NDKilla,项目名称:mediawiki-extensions-CentralAuth,代码行数:11,代码来源:SpecialGlobalGroupPermissions.php
示例11: showLogFragment
function showLogFragment($title)
{
$moveLogPage = new LogPage('pagelang');
$out1 = Xml::element('h2', null, $moveLogPage->getName()->text());
$out2 = '';
LogEventsList::showLogExtract($out2, 'pagelang', $title);
return $out1 . $out2;
}
开发者ID:GoProjectOwner,项目名称:mediawiki,代码行数:8,代码来源:SpecialPageLanguage.php
示例12: dumpFrom
/**
* @param string $cond
* @throws MWException
* @throws Exception
*/
protected function dumpFrom($cond = '')
{
wfProfileIn(__METHOD__);
# For logging dumps...
if ($this->history & self::LOGS) {
$where = array('user_id = log_user');
# Hide private logs
$hideLogs = LogEventsList::getExcludeClause($this->db);
if ($hideLogs) {
$where[] = $hideLogs;
}
# Add on any caller specified conditions
if ($cond) {
$where[] = $cond;
}
# Get logging table name for logging.* clause
$logging = $this->db->tableName('logging');
if ($this->buffer == WikiExporter::STREAM) {
$prev = $this->db->bufferResults(false);
}
$wrapper = null;
// Assuring $wrapper is not undefined, if exception occurs early
try {
$result = $this->db->select(array('logging', 'user'), array("{$logging}.*", 'user_name'), $where, __METHOD__, array('ORDER BY' => 'log_id', 'USE INDEX' => array('logging' => 'PRIMARY')));
$wrapper = $this->db->resultObject($result);
$this->outputLogStream($wrapper);
if ($this->buffer == WikiExporter::STREAM) {
$this->db->bufferResults($prev);
}
} catch (Exception $e) {
// Throwing the exception does not reliably free the resultset, and
// would also leave the connection in unbuffered mode.
// Freeing result
try {
if ($wrapper) {
$wrapper->free();
}
} catch (Exception $e2) {
// Already in panic mode -> ignoring $e2 as $e has
// higher priority
}
// Putting database back in previous buffer mode
try {
if ($this->buffer == WikiExporter::STREAM) {
$this->db->bufferResults($prev);
}
} catch (Exception $e2) {
// Already in panic mode -> ignoring $e2 as $e has
// higher priority
}
// Inform caller about problem
wfProfileOut(__METHOD__);
throw $e;
}
# For page dumps...
} else {
$tables = array('page', 'revision');
$opts = array('ORDER BY' => 'page_id ASC');
$opts['USE INDEX'] = array();
$join = array();
if (is_array($this->history)) {
# Time offset/limit for all pages/history...
$revJoin = 'page_id=rev_page';
# Set time order
if ($this->history['dir'] == 'asc') {
$op = '>';
$opts['ORDER BY'] = 'rev_timestamp ASC';
} else {
$op = '<';
$opts['ORDER BY'] = 'rev_timestamp DESC';
}
# Set offset
if (!empty($this->history['offset'])) {
$revJoin .= " AND rev_timestamp {$op} " . $this->db->addQuotes($this->db->timestamp($this->history['offset']));
}
$join['revision'] = array('INNER JOIN', $revJoin);
# Set query limit
if (!empty($this->history['limit'])) {
$opts['LIMIT'] = intval($this->history['limit']);
}
} elseif ($this->history & WikiExporter::FULL) {
# Full history dumps...
$join['revision'] = array('INNER JOIN', 'page_id=rev_page');
} elseif ($this->history & WikiExporter::CURRENT) {
# Latest revision dumps...
if ($this->list_authors && $cond != '') {
// List authors, if so desired
$this->do_list_authors($cond);
}
$join['revision'] = array('INNER JOIN', 'page_id=rev_page AND page_latest=rev_id');
} elseif ($this->history & WikiExporter::STABLE) {
# "Stable" revision dumps...
# Default JOIN, to be overridden...
$join['revision'] = array('INNER JOIN', 'page_id=rev_page AND page_latest=rev_id');
# One, and only one hook should set this, and return false
//.........这里部分代码省略.........
开发者ID:Habatchii,项目名称:wikibase-for-mediawiki,代码行数:101,代码来源:Export.php
示例13: extractRowInfo
private function extractRowInfo($row)
{
$vals = array();
if ($this->fld_ids) {
$vals['logid'] = intval($row->log_id);
$vals['pageid'] = intval($row->page_id);
}
if ($this->fld_title || $this->fld_parsedcomment) {
$title = Title::makeTitle($row->log_namespace, $row->log_title);
}
if ($this->fld_title) {
if (LogEventsList::isDeleted($row, LogPage::DELETED_ACTION)) {
$vals['actionhidden'] = '';
} else {
ApiQueryBase::addTitleInfo($vals, $title);
}
}
if ($this->fld_type || $this->fld_action) {
$vals['type'] = $row->log_type;
$vals['action'] = $row->log_action;
}
if ($this->fld_details && $row->log_params !== '') {
if (LogEventsList::isDeleted($row, LogPage::DELETED_ACTION)) {
$vals['actionhidden'] = '';
} else {
self::addLogParams($this->getResult(), $vals, $row->log_params, $row->log_type, $row->log_action, $row->log_timestamp);
}
}
if ($this->fld_user || $this->fld_userid) {
if (LogEventsList::isDeleted($row, LogPage::DELETED_USER)) {
$vals['userhidden'] = '';
} else {
if ($this->fld_user) {
$vals['user'] = $row->user_name;
}
if ($this->fld_userid) {
$vals['userid'] = $row->user_id;
}
if (!$row->log_user) {
$vals['anon'] = '';
}
}
}
if ($this->fld_timestamp) {
$vals['timestamp'] = wfTimestamp(TS_ISO_8601, $row->log_timestamp);
}
if (($this->fld_comment || $this->fld_parsedcomment) && isset($row->log_comment)) {
if (LogEventsList::isDeleted($row, LogPage::DELETED_COMMENT)) {
$vals['commenthidden'] = '';
} else {
if ($this->fld_comment) {
$vals['comment'] = $row->log_comment;
}
if ($this->fld_parsedcomment) {
global $wgUser;
$vals['parsedcomment'] = $wgUser->getSkin()->formatComment($row->log_comment, $title);
}
}
}
if ($this->fld_tags) {
if ($row->ts_tags) {
$tags = explode(',', $row->ts_tags);
$this->getResult()->setIndexedTagName($tags, 'tag');
$vals['tags'] = $tags;
} else {
$vals['tags'] = array();
}
}
return $vals;
}
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:70,代码来源:ApiQueryLogEvents.php
示例14: showEditForm
//.........这里部分代码省略.........
if (wfReadOnly()) {
$wgOut->wrapWikiMsg("<div id=\"mw-read-only-warning\">\n\$1\n</div>", array('readonlywarning', wfReadOnlyReason()));
# MeanEditor: visual editing makes no sense here
$this->noVisualEditor = true;
} elseif ($wgUser->isAnon() && $this->formtype != 'preview') {
$wgOut->wrapWikiMsg('<div id="mw-anon-edit-warning">$1</div>', 'anoneditwarning');
} else {
if ($this->isCssJsSubpage) {
# Check the skin exists
if ($this->isValidCssJsSubpage) {
if ($this->formtype !== 'preview') {
$wgOut->addWikiMsg('usercssjsyoucanpreview');
}
} else {
$wgOut->addWikiMsg('userinvalidcssjstitle', $wgTitle->getSkinFromCssJsSubpage());
}
}
}
$classes = array();
// Textarea CSS
if ($this->mTitle->getNamespace() == NS_MEDIAWIKI) {
} elseif ($this->mTitle->isProtected('edit')) {
# Is the title semi-protected?
if ($this->mTitle->isSemiProtected()) {
$noticeMsg = 'semiprotectedpagewarning';
$classes[] = 'mw-textarea-sprotected';
} else {
# Then it must be protected based on static groups (regular)
$noticeMsg = 'protectedpagewarning';
$classes[] = 'mw-textarea-protected';
}
$wgOut->addHTML("<div class='mw-warning-with-logexcerpt'>\n");
$wgOut->addWikiMsg($noticeMsg);
LogEventsList::showLogExtract($wgOut, 'protect', $this->mTitle->getPrefixedText(), '', 1);
$wgOut->addHTML("</div>\n");
}
if ($this->mTitle->isCascadeProtected()) {
# Is this page under cascading protection from some source pages?
list($cascadeSources, ) = $this->mTitle->getCascadeProtectionSources();
$notice = "<div class='mw-cascadeprotectedwarning'>\$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')) {
$wgOut->wrapWikiMsg('<div class="mw-titleprotectedwarning">$1</div>', 'titleprotectedwarning');
}
if ($this->kblength === false) {
# MeanEditor: the length will probably be different in HTML
$this->kblength = (int) (strlen($this->textbox1) / 1024);
}
if ($this->tooBig || $this->kblength > $wgMaxArticleSize) {
$wgOut->addHTML("<div class='error' id='mw-edit-longpageerror'>\n");
$wgOut->addWikiMsg('longpageerror', $wgLang->formatNum($this->kblength), $wgLang->formatNum($wgMaxArticleSize));
$wgOut->addHTML("</div>\n");
} elseif ($this->kblength > 29) {
$wgOut->addHTML("<div id='mw-edit-longpagewarning'>\n");
$wgOut->addWikiMsg('longpagewarning', $wgLang->formatNum($this->kblength));
$wgOut->addHTML("</div>\n");
}
开发者ID:erpel,项目名称:meaneditor,代码行数:67,代码来源:MeanEditorEditPage.body.php
示例15: 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);
}
开发者ID:Tarendai,项目名称:spring-website,代码行数:101,代码来源:ImagePage.php
示例16: 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;
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:20,代码来源:ChatHelper.php
示例17: showHistory
private function showHistory()
{
global $wgLang, $wgContLang, $wgUser, $wgOut;
$this->sk = $wgUser->getSkin();
$wgOut->setPagetitle(wfMsg("mergehistory"));
$this->showMergeForm();
# List all stored revisions
$revisions = new MergeHistoryPager($this, array(), $this->mTargetObj, $this->mDestObj);
$haveRevisions = $revisions && $revisions->getNumRows() > 0;
$titleObj = SpecialPage::getTitleFor("Mergehistory");
$action = $titleObj->getLocalURL("action=submit");
# Start the form here
$top = Xml::openElement('form', array('method' => 'post', 'action' => $action, 'id' => 'merge'));
$wgOut->addHTML($top);
if ($haveRevisions) {
# Format the user-visible controls (comment field, submission button)
# in a nice little table
$align = $wgContLang->isRtl() ? 'left' : 'right';
$table = Xml::openElement('fieldset') . Xml::openElement('table') . "<tr>\n\t\t\t\t\t\t<td colspan='2'>" . wfMsgExt('mergehistory-merge', array('parseinline'), $this->mTargetObj->getPrefixedText(), $this->mDestObj->getPrefixedText()) . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td align='{$align}'>" . Xml::label(wfMsg('undeletecomment'), 'wpComment') . "</td>\n\t\t\t\t\t\t<td>" . Xml::input('wpComment', 50, $this->mComment) . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td> </td>\n\t\t\t\t\t\t<td>" . Xml::submitButton(wfMsg('mergehistory-submit'), array('name' => 'merge', 'id' => 'mw-merge-submit')) . "</td>\n\t\t\t\t\t</tr>" . Xml::closeElement('table') . Xml::closeElement('fieldset');
$wgOut->addHTML($table);
}
$wgOut->addHTML("<h2 id=\"mw-mergehistory\">" . wfMsgHtml("mergehistory-list") . "</h2>\n");
if ($haveRevisions) {
$wgOut->addHTML($revisions->getNavigationBar());
$wgOut->addHTML("<ul>");
$wgOut->addHTML($revisions->getBody());
$wgOut->addHTML("</ul>");
$wgOut->addHTML($revisions->getNavigationBar());
} else {
$wgOut->addWikiMsg("mergehistory-empty");
}
# Show relevant lines from the deletion log:
$wgOut->addHTML("<h2>" . htmlspecialchars(LogPage::logName('merge')) . "</h2>\n");
LogEventsList::showLogExtract($wgOut, 'merge', $this->mTargetObj->getPrefixedText());
# 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 = Xml::hidden('targetID', $this->mTargetObj->getArticleID());
$misc .= Xml::hidden('destID', $this->mDestObj->getArticleID());
$misc .= Xml::hidden('target', $this->mTarget);
$misc .= Xml::hidden('dest', $this->mDest);
$misc .= Xml::hidden('wpEditToken', $wgUser->editToken());
$misc .= Xml::closeElement('form');
$wgOut->addHTML($misc);
return true;
}
开发者ID:amjadtbssm,项目名称:website,代码行数:45,代码来源:SpecialMergeHistory.php
示例18: execut |
请发表评论