本文整理汇总了PHP中wfMsgNoTrans函数的典型用法代码示例。如果您正苦于以下问题:PHP wfMsgNoTrans函数的具体用法?PHP wfMsgNoTrans怎么用?PHP wfMsgNoTrans使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wfMsgNoTrans函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($view, $thread)
{
parent::__construct();
$this->thread = $thread;
$this->view = $view;
self::$change_names = array(Threads::CHANGE_EDITED_ROOT => wfMsgNoTrans('lqt_hist_comment_edited'), Threads::CHANGE_EDITED_SUMMARY => wfMsgNoTrans('lqt_hist_summary_changed'), Threads::CHANGE_REPLY_CREATED => wfMsgNoTrans('lqt_hist_reply_created'), Threads::CHANGE_NEW_THREAD => wfMsgNoTrans('lqt_hist_thread_created'), Threads::CHANGE_DELETED => wfMsgNoTrans('lqt_hist_deleted'), Threads::CHANGE_UNDELETED => wfMsgNoTrans('lqt_hist_undeleted'), Threads::CHANGE_MOVED_TALKPAGE => wfMsgNoTrans('lqt_hist_moved_talkpage'), Threads::CHANGE_EDITED_SUBJECT => wfMsgNoTrans('lqt_hist_edited_subject'), Threads::CHANGE_SPLIT => wfMsgNoTrans('lqt_hist_split'), Threads::CHANGE_MERGED_FROM => wfMsgNoTrans('lqt_hist_merged_from'), Threads::CHANGE_MERGED_TO => wfMsgNoTrans('lqt_hist_merged_to'), Threads::CHANGE_SPLIT_FROM => wfMsgNoTrans('lqt_hist_split_from'), Threads::CHANGE_ROOT_BLANKED => wfMsgNoTrans('lqt_hist_root_blanked'), Threads::CHANGE_ADJUSTED_SORTKEY => wfMsgNoTrans('lqt_hist_adjusted_sortkey'));
}
示例2: getContributorsText
public function getContributorsText($title)
{
global $wgUser, $wgLang;
$this->target = $title;
$contribText = '';
if ($this->target->exists()) {
$total = 0;
$skin = $wgUser->getSkin();
$link = $skin->makeKnownLinkObj($this->target);
$contribText .= '<h2>' . wfMsgHtml('contributors-subtitle', $link) . '</h2>';
list($contributors, $others) = $this->getMainContributors($title);
$contribText .= '<ul>';
foreach ($contributors as $username => $info) {
list($id, $count) = $info;
$line = $skin->userLink($id, $username) . $skin->userToolLinks($id, $username);
$line .= ' [' . $wgLang->formatNum($count) . ']';
$contribText .= '<li>' . $line . '</li>';
}
$contribText .= '</ul>';
if ($others > 0) {
$others = $wgLang->formatNum($others);
$contribText .= wfMsgNoTrans('contributors-others-long', $others);
}
} else {
$contribText .= '<p>' . htmlspecialchars(wfMsg('contributors-nosuchpage', $this->target->getPrefixedText())) . '</p>';
}
return preg_replace('/"/', '\\"', $contribText);
}
示例3: addJSLocalisation
/**
* Adds the needed JS messages to the page output.
* This is for backward compatibility with pre-RL MediaWiki.
*
* @since 0.1
*/
protected static function addJSLocalisation()
{
global $egLTJSMessages, $wgOut;
$data = array();
foreach ($egLTJSMessages as $msg) {
$data[$msg] = wfMsgNoTrans($msg);
}
$wgOut->addInlineScript('var wgLTEMessages = ' . FormatJson::encode($data) . ';');
}
示例4: msg
/**
* Get a message from i18n
*
* @param $key String: message name
* @param $fallback String: default message if the message cache can't be
* called by the exception
* The function also has other parameters that are arguments for the message
* @return String message with arguments replaced
*/
function msg($key, $fallback)
{
$args = array_slice(func_get_args(), 2);
if ($this->useMessageCache()) {
return wfMsgNoTrans($key, $args);
} else {
return wfMsgReplaceArgs($fallback, $args);
}
}
示例5: execute
/**
* Main execution function
* @param $par Parameters passed to the page
*/
function execute($par)
{
global $wgRequest, $wgOut, $wgMakeBotPrivileged, $wgUser;
$this->setHeaders();
if ($par) {
$this->target = $par;
} else {
$this->target = $wgRequest->getVal('target', wfMsg('rootcategory'));
}
$this->target = trim($this->target);
#HACK for undefined root category
if ($this->target == '<rootcategory>' || $this->target == '<rootcategory>') {
$this->target = NULL;
}
$this->mode = $wgRequest->getVal('mode', CT_MODE_CATEGORIES);
if ($this->mode == 'all') {
$this->mode = CT_MODE_ALL;
} else {
if ($this->mode == 'pages') {
$this->mode = CT_MODE_PAGES;
} else {
if ($this->mode == 'categories') {
$this->mode = CT_MODE_CATEGORIES;
}
}
}
$this->mode = (int) $this->mode;
$wgOut->addWikiText(wfMsgNoTrans('categorytree-header'));
$wgOut->addHtml($this->makeInputForm());
if ($this->target !== '' && $this->target !== NULL) {
CategoryTree::setHeaders($wgOut);
$title = CategoryTree::makeTitle($this->target);
if ($title && $title->getArticleID()) {
$html = '';
$html .= wfOpenElement('div', array('class' => 'CategoryTreeParents'));
$html .= wfElement('span', array('class' => 'CategoryTreeParents'), wfMsg('categorytree-parents')) . ': ';
$ct = new CategoryTree();
$parents = $ct->renderParents($title, $this->mode);
if ($parents == '') {
$html .= wfMsg('categorytree-nothing-found');
} else {
$html .= $parents;
}
$html .= wfCloseElement('div');
$html .= wfOpenElement('div', array('class' => 'CategoryTreeResult'));
$html .= $ct->renderNode($title, $this->mode, true, false);
$html .= wfCloseElement('div');
$wgOut->addHtml($html);
} else {
$wgOut->addHtml(wfOpenElement('div', array('class' => 'CategoryTreeNotice')));
$wgOut->addWikiText(wfMsg('categorytree-not-found', $this->target));
$wgOut->addHtml(wfCloseElement('div'));
}
}
}
示例6: wfExtensionCommentbox_Add
function wfExtensionCommentbox_Add(&$op, &$text)
{
global $wgUser, $wgRequest, $wgCommentboxNamespaces, $wgCommentboxRows, $wgCommentboxColumns;
$title = $op->getTitle();
if (!$title->exists()) {
return true;
}
if (!$title->userCan('edit', true)) {
return true;
}
if (!array_key_exists($title->getNamespace(), $wgCommentboxNamespaces) || !$wgCommentboxNamespaces[$title->getNamespace()]) {
return true;
}
$action = $wgRequest->getVal('action', 'view');
if (!($action == 'view' || $action == 'purge' || $action == 'submit')) {
return true;
}
if ($wgRequest->getCheck('wpPreview') || $wgRequest->getCheck('wpLivePreview') || $wgRequest->getCheck('wpDiff')) {
return true;
}
if (!is_null($wgRequest->getVal('preview'))) {
return true;
}
if (!is_null($wgRequest->getVal('diff'))) {
return true;
}
$newaction = Title::newFromText('AddComment', NS_SPECIAL)->escapeFullURL();
$name = '';
if (!$wgUser->isLoggedIn()) {
$namecomment = wfMsgExt('commentbox-name-explanation', 'parseinline');
$namelabel = wfMsgExt('commentbox-name', 'parseinline');
$name = '<br />' . $namelabel;
$name .= ' <input name="wpAuthor" tabindex="2" type="text" size="30" maxlength="50" /> ';
$name .= $namecomment;
}
$inhalt = wfMsgNoTrans('commentbox-prefill');
$save = wfMsgExt('commentbox-savebutton', 'escapenoentities');
$texttitle = htmlspecialchars(Title::makeName($title->getNamespace(), $title->getText()));
$intro = wfMsgExt('commentbox-intro', 'parse');
$text .= <<<END
\t<form id="commentform" name="commentform" method="post"
action="{$newaction}" enctype="multipart/form-data">
\t{$intro}
\t<textarea tabindex='1' accesskey="," name="wpComment" id="wpComment"
\t rows='{$wgCommentboxRows}' cols='{$wgCommentboxColumns}'
\t\t >{$inhalt}</textarea>
\t{$name}
\t<br />
\t<input type="hidden" name="wpPageName" value="{$texttitle}" />
\t<input id="wpSave" name="wpSave" type="submit" tabindex="3" value="{$save}"
\t accesskey="s" title="{$save} [alt-s]" />
\t</form>
END;
return true;
}
示例7: ucscOutputBeforeHTML
public static function ucscOutputBeforeHTML(&$out, &$text)
{
# We are done if the trust tab isn't selected
global $wgRequest;
$use_trust = $wgRequest->getVal('trust');
if (!isset($use_trust) || $wgRequest->getVal('action') && $wgRequest->getVal('action') != 'purge') {
return true;
}
wfLoadExtensionMessages('WikiTrust');
self::color_addFileRefs($out);
$ctext_html = "<div id='text-button'><input type='button' name='ctext' value='getColoredText' onclick='startGetColoredText()'></div>";
$vtext_html = "<div id='vote-button'><input type='button' name='vote' value='" . wfMsgNoTrans("wgVoteText") . "' onclick='startVote()' /></div><div id='vote-button-done'>" . wfMsgNoTrans("wgThankYouForVoting") . "</div>";
$out->addHTML($ctext_html);
$out->addHTML($vtext_html);
return true;
}
示例8: wfSpecialAllmessages
/**
* Constructor.
*/
function wfSpecialAllmessages()
{
global $wgOut, $wgRequest, $wgMessageCache, $wgTitle;
global $wgUseDatabaseMessages, $wgLang;
# The page isn't much use if the MediaWiki namespace is not being used
if (!$wgUseDatabaseMessages) {
$wgOut->addWikiMsg('allmessagesnotsupportedDB');
return;
}
wfProfileIn(__METHOD__);
wfProfileIn(__METHOD__ . '-setup');
$ot = $wgRequest->getText('ot');
$navText = wfMsg('allmessagestext');
# Make sure all extension messages are available
$wgMessageCache->loadAllMessages();
$sortedArray = array_merge(Language::getMessagesFor('en'), $wgMessageCache->getExtensionMessagesFor('en'));
ksort($sortedArray);
$messages = array();
foreach ($sortedArray as $key => $value) {
$messages[$key]['enmsg'] = $value;
$messages[$key]['statmsg'] = wfMsgReal($key, array(), false, false, false);
$messages[$key]['msg'] = wfMsgNoTrans($key);
$sortedArray[$key] = NULL;
// trade bytes from $sortedArray to this
}
unset($sortedArray);
// trade bytes from $sortedArray to this
wfProfileOut(__METHOD__ . '-setup');
wfProfileIn(__METHOD__ . '-output');
$wgOut->addScriptFile('allmessages.js');
if ($ot == 'php') {
$navText .= wfAllMessagesMakePhp($messages);
$wgOut->addHTML($wgLang->pipeList(array('PHP', '<a href="' . $wgTitle->escapeLocalUrl('ot=html') . '">HTML</a>', '<a href="' . $wgTitle->escapeLocalUrl('ot=xml') . '">XML</a>' . '<pre>' . htmlspecialchars($navText) . '</pre>')));
} else {
if ($ot == 'xml') {
$wgOut->disable();
header('Content-type: text/xml');
echo wfAllMessagesMakeXml($messages);
} else {
$wgOut->addHTML($wgLang->pipeList(array('<a href="' . $wgTitle->escapeLocalUrl('ot=php') . '">PHP</a>', 'HTML', '<a href="' . $wgTitle->escapeLocalUrl('ot=xml') . '">XML</a>')));
$wgOut->addWikiText($navText);
$wgOut->addHTML(wfAllMessagesMakeHTMLText($messages));
}
}
wfProfileOut(__METHOD__ . '-output');
wfProfileOut(__METHOD__);
}
示例9: show
function show()
{
$filter = $this->mPage->mFilter;
global $wgUser, $wgRequest, $wgOut;
$sk = $wgUser->getSkin();
if (!$wgUser->isAllowed('abusefilter-revert')) {
$wgOut->permissionRequired('abusefilter-revert');
return;
}
$this->loadParameters();
if ($this->attemptRevert()) {
return;
}
$wgOut->addWikiMsg('abusefilter-revert-intro', $filter);
$wgOut->setPageTitle(wfMsg('abusefilter-revert-title', $filter));
// First, the search form.
$searchFields = array();
$searchFields['abusefilter-revert-filter'] = Xml::element('strong', null, $filter);
$searchFields['abusefilter-revert-periodstart'] = Xml::input('wpPeriodStart', 45, $this->origPeriodStart);
$searchFields['abusefilter-revert-periodend'] = Xml::input('wpPeriodEnd', 45, $this->origPeriodEnd);
$searchForm = Xml::buildForm($searchFields, 'abusefilter-revert-search');
$searchForm .= "\n" . Xml::hidden('submit', 1);
$searchForm = Xml::tags('form', array('action' => $this->getTitle("revert/{$filter}")->getLocalURL(), 'method' => 'POST'), $searchForm);
$searchForm = Xml::fieldset(wfMsg('abusefilter-revert-search-legend'), $searchForm);
$wgOut->addHTML($searchForm);
if ($this->mSubmit) {
// Add a summary of everything that will be reversed.
$wgOut->addWikiMsg('abusefilter-revert-preview-intro');
// Look up all of them.
$results = $this->doLookup();
$list = array();
foreach ($results as $result) {
$displayActions = array();
global $wgLang;
$displayActions = array_map(array('AbuseFilter', 'getActionDisplay'), $result['actions']);
$msg = wfMsgExt('abusefilter-revert-preview-item', array('parseinline', 'replaceafter'), array($wgLang->timeanddate($result['timestamp'], true), $sk->userLink($result['userid'], $result['user']), $result['action'], $sk->link($result['title']), $wgLang->commaList($displayActions), $sk->link(SpecialPage::getTitleFor('AbuseLog'), wfMsgNoTrans('abusefilter-log-detailslink'), array(), array('details' => $result['id']))));
$list[] = Xml::tags('li', null, $msg);
}
$wgOut->addHTML(Xml::tags('ul', null, implode("\n", $list)));
// Add a button down the bottom.
$confirmForm = Xml::hidden('editToken', $wgUser->editToken("abusefilter-revert-{$filter}")) . Xml::hidden('title', $this->getTitle("revert/{$filter}")->getPrefixedText()) . Xml::hidden('wpPeriodStart', $this->origPeriodStart) . Xml::hidden('wpPeriodEnd', $this->origPeriodEnd) . Xml::inputLabel(wfMsg('abusefilter-revert-reasonfield'), 'wpReason', 'wpReason', 45) . "\n" . Xml::submitButton(wfMsg('abusefilter-revert-confirm'));
$confirmForm = Xml::tags('form', array('action' => $this->getTitle("revert/{$filter}")->getLocalURL(), 'method' => 'post'), $confirmForm);
$wgOut->addHTML($confirmForm);
}
}
示例10: execute
function execute($par)
{
global $wgOut, $wgRequest, $haclgContLang, $wgTitle;
if (!function_exists('curl_init')) {
$wgOut->showErrorPage('iacl-selftest-no-curl', 'iacl-selftest-no-curl-text');
return;
}
$this->access_denied_page = preg_quote(SpecialPage::getTitleFor('Badtitle')->getPrefixedText()) . '|' . preg_quote($haclgContLang->getPermissionDeniedPage());
$q = $wgRequest->getValues();
if (!empty($q['do'])) {
$wgOut->disable();
$this->doChecks(!empty($q['quiet']));
} else {
$wgOut->setPageTitle(wfMsg('iacl-selftest-title'));
$wgOut->addWikiText(wfMsgNoTrans('iacl-selftest-info', $wgTitle->getFullUrl(array('do' => 1, 'quiet' => 1))));
$wgOut->addHTML('<iframe style="border-width: 0; width: 100%; height: 500px" src="' . $wgTitle->getLocalUrl(array('do' => 1)) . '"></iframe>');
}
}
示例11: wfSpecialStatistics
/**
* Show the special page
*
* @param mixed $par (not used)
*/
function wfSpecialStatistics($par = '')
{
global $wgOut, $wgLang, $wgRequest;
$dbr = wfGetDB(DB_SLAVE);
$views = SiteStats::views();
$edits = SiteStats::edits();
$good = SiteStats::articles();
$images = SiteStats::images();
$total = SiteStats::pages();
$users = SiteStats::users();
$admins = SiteStats::admins();
$numJobs = SiteStats::jobs();
if ($wgRequest->getVal('action') == 'raw') {
$wgOut->disable();
header('Pragma: nocache');
echo "total={$total};good={$good};views={$views};edits={$edits};users={$users};admins={$admins};images={$images};jobs={$numJobs}\n";
return;
} else {
$text = "__NOTOC__\n";
$text .= '==' . wfMsgNoTrans('sitestats') . "==\n";
$text .= wfMsgExt('sitestatstext', array('parsemag'), $wgLang->formatNum($total), $wgLang->formatNum($good), $wgLang->formatNum($views), $wgLang->formatNum($edits), $wgLang->formatNum(sprintf('%.2f', $total ? $edits / $total : 0)), $wgLang->formatNum(sprintf('%.2f', $edits ? $views / $edits : 0)), $wgLang->formatNum($numJobs), $wgLang->formatNum($images)) . "\n";
$text .= "==" . wfMsgNoTrans('userstats') . "==\n";
$text .= wfMsgExt('userstatstext', array('parsemag'), $wgLang->formatNum($users), $wgLang->formatNum($admins), '[[' . wfMsgForContent('grouppage-sysop') . ']]', $wgLang->formatNum(sprintf('%.2f', $admins / $users * 100)), User::makeGroupLinkWiki('sysop')) . "\n";
global $wgDisableCounters, $wgMiserMode, $wgUser, $wgLang, $wgContLang;
if (!$wgDisableCounters && !$wgMiserMode) {
$res = $dbr->select('page', array('page_namespace', 'page_title', 'page_counter'), array('page_is_redirect' => 0, 'page_counter > 0'), __METHOD__, array('ORDER BY' => 'page_counter DESC', 'LIMIT' => 10));
if ($res->numRows() > 0) {
$text .= "==" . wfMsgNoTrans('statistics-mostpopular') . "==\n";
while ($row = $res->fetchObject()) {
$title = Title::makeTitleSafe($row->page_namespace, $row->page_title);
if ($title instanceof Title) {
$text .= '* [[:' . $title->getPrefixedText() . ']] (' . $wgLang->formatNum($row->page_counter) . ")\n";
}
}
$res->free();
}
}
$footer = wfMsgNoTrans('statistics-footer');
if (!wfEmptyMsg('statistics-footer', $footer) && $footer != '') {
$text .= "\n" . $footer;
}
$wgOut->addWikiText($text);
}
}
示例12: process
/**
* Process the 'delvote' action.
* @param Article $article The article to endorse/object to deletion of.
*/
public function process($article)
{
global $wgRequest, $wgOut, $wgUser;
$errs = $article->mTitle->getUserPermissionsErrors('deletequeue-vote', $wgUser);
if (count($errs) > 0) {
$wgOut->showPermissionsErrorPage($errs);
return;
}
$dqi = DeleteQueueItem::newFromArticle($article);
$wgOut->setPageTitle(wfMsg('deletequeue-vote-title', $article->mTitle->getPrefixedText()));
// Load form data
$token = $wgRequest->getVal('wpEditToken');
$action = $wgRequest->getVal('wpVote');
$comments = $wgRequest->getText('wpComments');
if ($wgUser->matchEditToken($token) && in_array($action, array('endorse', 'object'))) {
$dqi->addVote($action, $comments);
if ($action == 'object' && $dqi->getQueue() == 'prod') {
$dbw = wfGetDB(DB_MASTER);
$dbw->begin();
$dqi->setQueue('deletediscuss', $dqi->getReason());
$lp = new LogPage('delete');
$lp->addEntry('requeue', $article->mTitle, $comments, array(wfMsgForContent('deletequeue-queue-prod'), wfMsgForContent("deletequeue-queue-deletediscuss")));
$dbw->commit();
$wgOut->addWikiMsg('deletequeue-vote-requeued', wfMsgNoTrans('deletequeue-queue-deletediscuss'));
} else {
$wgOut->addWikiMsg("deletequeue-vote-success-{$action}");
}
return;
}
$wgOut->addWikiMsg('deletequeue-vote-text', $article->mTitle->getPrefixedText(), $dqi->getReason());
// Add main form.
$fields = array();
$options = Xml::tags('p', null, Xml::radioLabel(wfMsg('deletequeue-vote-endorse'), 'wpVote', 'endorse', 'mw-deletequeue-vote-endorse'));
$options .= Xml::tags('p', null, Xml::radioLabel(wfMsg('deletequeue-vote-object'), 'wpVote', 'object', 'mw-deletequeue-vote-object'));
$fields['deletequeue-vote-action'] = $options;
$fields['deletequeue-vote-reason'] = Xml::input('wpComments', 45, $comments);
$article_id = $article->getId();
$title = $this->getTitle("vote/{$article_id}");
$form = Xml::buildForm($fields, 'deletequeue-vote-submit') . Html::Hidden('wpEditToken', $wgUser->editToken()) . Html::Hidden('title', $title->getPrefixedText());
$form = Xml::tags('form', array('action' => $title->getLocalURL(), 'method' => 'POST'), $form);
$form = Xml::fieldset(wfMsg('deletequeue-vote-legend'), $form);
$wgOut->addHTML($form);
}
示例13: makeForm
/**
* Generate a form allowing users to enter information
*
* @param $title Value for context title field
* @param $input Value for input textbox
* @return string
*/
private function makeForm($title, $input)
{
$self = $this->getTitle();
$form = Xml::openElement('form', array('method' => 'post', 'action' => $self->getLocalUrl()));
$form .= "<fieldset><legend>" . wfMsgHtml('expandtemplates') . "</legend>\n";
$form .= '<p>' . Xml::inputLabel(wfMsgNoTrans('expand_templates_title'), 'contexttitle', 'contexttitle', 60, $title) . '</p>';
$form .= '<p>' . Xml::label(wfMsg('expand_templates_input'), 'input') . '</p>';
$form .= Xml::openElement('textarea', array('name' => 'input', 'id' => 'input', 'rows' => 10, 'cols' => 10));
$form .= htmlspecialchars($input);
$form .= Xml::closeElement('textarea');
$form .= '<p>' . Xml::checkLabel(wfMsg('expand_templates_remove_comments'), 'removecomments', 'removecomments', $this->removeComments) . '</p>';
$form .= '<p>' . Xml::checkLabel(wfMsg('expand_templates_remove_nowiki'), 'removenowiki', 'removenowiki', $this->removeNowiki) . '</p>';
if ($this->isNewParser) {
$form .= '<p>' . Xml::checkLabel(wfMsg('expand_templates_generate_xml'), 'generate_xml', 'generate_xml', $this->generateXML) . '</p>';
}
$form .= '<p>' . Xml::submitButton(wfMsg('expand_templates_ok'), array('accesskey' => 's')) . '</p>';
$form .= "</fieldset>\n";
$form .= Xml::closeElement('form');
return $form;
}
示例14: view
function view()
{
global $wgOut, $wgShowEXIF, $wgRequest, $wgUser;
$diff = $wgRequest->getVal('diff');
$diffOnly = $wgRequest->getBool('diffonly', $wgUser->getOption('diffonly'));
if ($this->mTitle->getNamespace() != NS_VIDEO || isset($diff) && $diffOnly) {
return Article::view();
}
# No need to display noarticletext, we use our own message, output in openShowImage()
if ($this->getID()) {
Article::view();
} else {
# Just need to set the right headers
$wgOut->setStatusCode(404);
$wgOut->setArticleFlag(true);
$wgOut->setRobotpolicy('noindex,nofollow');
$wgOut->setPageTitle($this->mTitle->getPrefixedText());
$this->viewUpdates();
}
# Show shared description, if needed
if ($this->mExtraDescription) {
$fol = wfMsgNoTrans('shareddescriptionfollows');
if ($fol != '-' && !wfEmptyMsg('shareddescriptionfollows', $fol)) {
$wgOut->addWikiText($fol);
}
$wgOut->addHTML('<div id="shared-image-desc">' . $this->mExtraDescription . '</div>');
}
$this->videoLinks();
$this->videoHistory();
if ($showmeta) {
global $wgStylePath, $wgStyleVersion;
$expand = htmlspecialchars(wfEscapeJsString(wfMsg('metadata-expand')));
$collapse = htmlspecialchars(wfEscapeJsString(wfMsg('metadata-collapse')));
$wgOut->addHTML(Xml::element('h2', array('id' => 'metadata'), wfMsg('metadata')) . "\n");
$wgOut->addWikiText($this->makeMetadataTable($formattedMetadata));
$wgOut->addHTML("<script type=\"text/javascript\" src=\"{$wgStylePath}/common/metadata.js?{$wgStyleVersion}\"></script>\n" . "<script type=\"text/javascript\">attachMetadataToggle('mw_metadata', '{$expand}', '{$collapse}');</script>\n");
}
}
示例15: __construct
/**
* Take a bit of WikiText that looks like
* <rss max=5>http://example.com/</rss>
* and return an object that can produce rendered output.
*/
function __construct($url, $args)
{
$this->url = $url;
# Get max number of headlines from argument-array
if (isset($args['max'])) {
$this->maxheads = $args['max'];
}
# Get reverse flag from argument array
if (isset($args['reverse'])) {
$this->reversed = true;
}
# Get date format from argument array
# FIXME: not used yet
if (isset($args['date'])) {
$this->date = $args['date'];
}
# Get highlight terms from argument array
if (isset($args['highlight'])) {
# mapping to lowercase here so the regex can be case insensitive below.
$this->highlight = self::explodeOnSpaces($args['highlight']);
}
# Get filter terms from argument array
if (isset($args['filter'])) {
$this->filter = self::explodeOnSpaces($args['filter']);
}
if (isset($args['filterout'])) {
$this->filterOut = self::explodeOnSpaces($args['filterout']);
}
if (isset($args['template'])) {
$titleObject = Title::newFromText($args['template'], NS_TEMPLATE);
$article = new Article($titleObject, 0);
$this->itemTemplate = $article->fetchContent();
} else {
$templateName = isset($args['templatename']) ? $args['templatename'] : 'RSSPost';
$this->itemTemplate = wfMsgNoTrans('rss-item', $templateName);
}
}