本文整理汇总了PHP中wfMsgNoTrans函数的典型用法代码示例。如果您正苦于以下问题:PHP wfMsgNoTrans函数的具体用法?PHP wfMsgNoTrans怎么用?PHP wfMsgNoTrans使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wfMsgNoTrans函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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'));
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:7,代码来源:ThreadHistoryPager.php
示例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);
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:28,代码来源:ContributorsAddonClass.php
示例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) . ';');
}
开发者ID:JeroenDeDauw,项目名称:LiveTranslate,代码行数:15,代码来源:LiveTranslate_Functions.php
示例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);
}
}
开发者ID:yusufchang,项目名称:app,代码行数:18,代码来源:Exception.php
示例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'));
}
}
}
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:59,代码来源:CategoryTreePage.php
示例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;
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:55,代码来源:Commentbox.php
示例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;
}
开发者ID:xzhao314,项目名称:WikiTrust,代码行数:16,代码来源:RemoteMode.php
示例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__);
}
开发者ID:ruizrube,项目名称:spdef,代码行数:50,代码来源:SpecialAllmessages.php
示例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);
}
}
开发者ID:ErdemA,项目名称:wikihow,代码行数:45,代码来源:AbuseFilterViewRevert.php
示例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>');
}
}
开发者ID:hermannschwaerzlerUIBK,项目名称:IntraACL,代码行数:18,代码来源:SpecialSelftest.php
示例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);
}
}
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:49,代码来源:SpecialStatistics.php
示例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);
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:47,代码来源:DeleteQueueViewVote.php
示例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;
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:27,代码来源:ExpandTemplates_body.php
示例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");
}
}
开发者ID:ErdemA,项目名称:wikihow,代码行数:38,代码来源:VideoPage.class.php
示例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);
}
}
开发者ID:rduecyg,项目名称:OU,代码行数:42,代码来源:RSSParser.php
示例16: getWikiText
/**
* Get the error list as a wikitext formatted list
* @param string $shortContext A short enclosing context message name, to be used
* when there is a single error
* @param string $longContext A long enclosing context message name, for a list
*/
function getWikiText($shortContext = false, $longContext = false)
{
if (count($this->errors) == 0) {
if ($this->ok) {
$this->fatal('internalerror_info', __METHOD__ . " called for a good result, this is incorrect\n");
} else {
$this->fatal('internalerror_info', __METHOD__ . ": Invalid result object: no error text but not OK\n");
}
}
if (count($this->errors) == 1) {
$params = array_map('wfEscapeWikiText', $this->cleanParams($this->errors[0]['params']));
$s = wfMsgReal($this->errors[0]['message'], $params, true, false, false);
if ($shortContext) {
$s = wfMsgNoTrans($shortContext, $s);
} elseif ($longContext) {
$s = wfMsgNoTrans($longContext, "* {$s}\n");
}
} else {
$s = '';
foreach ($this->errors as $error) {
$params = array_map('wfEscapeWikiText', $this->cleanParams($error['params']));
$s .= '* ' . wfMsgReal($error['message'], $params, true, false, false) . "\n";
}
if ($longContext) {
$s = wfMsgNoTrans($longContext, $s);
} elseif ($shortContext) {
$s = wfMsgNoTrans($shortContext, "\n* {$s}\n");
}
}
return $s;
}
开发者ID:amjadtbssm,项目名称:website,代码行数:37,代码来源:Status.php
示例17: addJSLocalisation
/**
* Adds the needed JS messages to the page output.
* This is for backward compatibility with pre-RL MediaWiki.
*
* @since 0.1
*/
protected function addJSLocalisation() {
global $egRatingsStarsJSMessages;
$data = array();
foreach ( $egRatingsStarsJSMessages as $msg ) {
$data[$msg] = wfMsgNoTrans( $msg );
}
$this->parser->getOutput()->addHeadItem( Html::inlineScript( 'var wgRatingsStarsMessages = ' . json_encode( $data ) . ';' ) );
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:17,代码来源:RatingsStars.php
示例18: articleSaveComplete_SaveEmbedded
/**
* This method handles embedded content protection.
* Must be set onto ArticleSaveComplete hook AFTER articleSaveComplete_SaveSD
* in order to handle newly created page SDs.
*/
public static function articleSaveComplete_SaveEmbedded(&$article, &$user, $text)
{
// Flag to prevent recursion
static $InsideSaveEmbedded;
if ($InsideSaveEmbedded) {
return true;
}
$InsideSaveEmbedded = true;
global $wgRequest, $wgOut, $haclgContLang, $wgUser;
$isACL = $article->getTitle()->getNamespace() == HACL_NS_ACL;
if ($isACL) {
$articleSD = IACLDefinition::newFromTitle($article->getTitle(), false);
if (!$articleSD || $articleSD['pe_type'] != IACL::PE_PAGE) {
// This is not a page SD, do nothing.
return true;
}
} else {
// FIXME possibly use the category SD for category pages
// the problem here is that in ACL editor two different SDs
// may be created and queried for embedded content:
// for category article and for category itself
$articleSD = IACLDefinition::getSDForPE(IACL::PE_PAGE, $article->getId());
if (!$articleSD) {
return true;
}
}
// Handle embedded content protection
$errors = array();
foreach ($wgRequest->getValues() as $k => $v) {
if (substr($k, 0, 7) == 'sd_emb_' && $v) {
$wgRequest->setVal($k, false);
// clear value to handle embedded content only one time
$emb_pe_id = intval(substr($k, 7));
$emb_title = Title::newFromId($emb_pe_id);
list($req_sd_type, $req_sd_id, $emb_sd_revid) = explode('-', $v, 3);
if ($emb_title) {
$emb_sd_title = Title::newFromText(IACLDefinition::nameOfSD(IACL::PE_PAGE, $emb_title));
$emb_sd_article = new WikiPage($emb_sd_title);
}
// Check for errors:
if (!$emb_title || !$emb_title->getArticleId() || !$emb_sd_title->userCan('edit')) {
// Embedded content deleted || Manage access denied
$errors[] = array($emb_title, 'canedit');
} elseif ($req_sd_type && $req_sd_id && "{$req_sd_type}-{$req_sd_id}" != $articleSD['key']) {
// Invalid SD requested for protection
$errors[] = array($emb_title, 'invalidsd');
} elseif (!$emb_sd_revid && $emb_sd_title->exists() || $emb_sd_revid && $emb_sd_title->getLatestRevId() != $emb_sd_revid) {
// Mid-air collision: SD created/changed by someone in the meantime
$errors[] = array($emb_title, 'midair');
} else {
// Save embedded element SD
$emb_sd_article->doEdit('{{#predefined right: ' . $articleSD['def_title'] . '}}', wfMsg('hacl_comment_protect_embedded', '' . $articleSD['def_title']), EDIT_FORCE_BOT);
}
}
}
// Display errors to the user, if any
// This is safe to do as we are definitely in interactive non-batch edit mode
if ($errors) {
foreach ($errors as &$e) {
$e = "[[:" . $e[0]->getPrefixedText() . "]] (" . wfMsg('hacl_embedded_error_' . $e[1]) . ")";
}
$wgOut->setTitle(Title::newFromText('Special:IntraACL'));
$wgOut->addWikiText(wfMsgNoTrans('hacl_embedded_not_saved', implode(", ", $errors), $article->getTitle()->getPrefixedText()));
$wgOut->setPageTitle(wfMsg('hacl_embedded_not_saved_title'));
$wgOut->output();
// FIXME terminate MediaWiki more correctly
wfGetDB(DB_MASTER)->commit();
exit;
}
// Clear flag and continue hook processing
$InsideSaveEmbedded = false;
return true;
}
开发者ID:hermannschwaerzlerUIBK,项目名称:IntraACL,代码行数:78,代码来源:Toolbar.php
示例19: direction
static private function direction($raw, $speakers, $block, Parser $parser, PPFrame $frame){
if ($block === true){
return '<font class="sternographDirection sternographDirectionBlock">'.
Sternograph::expandSpeakers(wfMsgNoTrans('sternograph-block-pre').
$raw.wfMsgNoTrans('sternograph-block-post'),
$speakers, $parser, $frame).'</font>';
}else{
return '<font class="sternographDirection sternographDirectionInline">'.
Sternograph::expandSpeakers(wfMsgNoTrans('sternograph-inline-pre').
$raw.wfMsgNoTrans('sternograph-inline-post'),
$speakers, $parser, $frame).'</font>';
}
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:13,代码来源:Sternograph.body.php
示例20: doDelete
/**
* Perform a deletion and output success or failure messages
*/
public function doDelete($reason, $suppress = false)
{
global $wgOut, $wgUser;
$id = $this->mTitle->getArticleID(Title::GAID_FOR_UPDATE);
$error = '';
if (wfRunHooks('ArticleDelete', array(&$this, &$wgUser, &$reason, &$error))) {
if ($this->doDeleteArticle($reason, $suppress, $id)) {
$deleted = $this->mTitle->getPrefixedText();
$wgOut->setPagetitle(wfMsg('actioncomplete'));
$wgOut->setRobotPolicy('noindex,nofollow');
$loglink = '[[Special:Log/delete|' . wfMsgNoTrans('deletionlog') . ']]';
$wgOut->addWikiMsg('deletedtext', $deleted, $loglink);
$wgOut->returnToMain(false);
wfRunHooks('ArticleDeleteComplete', array(&$this, &$wgUser, $reason, $id));
}
} else {
if ($error == '') {
$wgOut->showFatalError(Html::rawElement('div', array('class' => 'error mw-error-cannotdelete'), wfMsgExt('cannotdelete', array('parse'), $this->mTitle->getPrefixedText())));
$wgOut->addHTML(Xml::element('h2', null, LogPage::logName('delete')));
LogEventsList::showLogExtract($wgOut, 'delete', $this->mTitle->getPrefixedText());
} else {
$wgOut->showFatalError($error);
}
}
}
开发者ID:GodelDesign,项目名称:Godel,代码行数:28,代码来源:Article.php
注:本文中的wfMsgNoTrans函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论