本文整理汇总了PHP中OutputPage::addWikiMsg方法的典型用法代码示例。如果您正苦于以下问题:PHP OutputPage::addWikiMsg方法的具体用法?PHP OutputPage::addWikiMsg怎么用?PHP OutputPage::addWikiMsg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputPage
的用法示例。
在下文中一共展示了OutputPage::addWikiMsg方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doModLangs
/**
* @param $group MessageGroup
*/
public function doModLangs($group)
{
global $wgLang;
$languages = array_keys(Language::getLanguageNames(false));
$modified = $codes = array();
foreach ($languages as $code) {
if ($code === 'en') {
continue;
}
$cache = new MessageGroupCache($group, $code);
if ($cache->isValid()) {
continue;
}
$link = $this->skin->link($this->getTitle(), htmlspecialchars(TranslateUtils::getLanguageName($code, false, $wgLang->getCode()) . " ({$code})"), array(), array('group' => $group->getId(), 'language' => $code));
if (!$cache->exists()) {
$modified[] = wfMsgHtml('translate-manage-modlang-new', $link);
} else {
$modified[] = $link;
}
$codes[] = $code;
}
if (count($modified)) {
$this->out->addWikiMsg('translate-manage-modlangs', $wgLang->formatNum(count($modified)));
if ($this->user->isAllowed('translate-manage')) {
$this->out->addHTML($this->rebuildButton($group, $codes, 'import'));
}
$this->out->addHTML('<ul><li>' . implode("</li>\n<li>", $modified) . '</li></ul>');
}
}
示例2: showEmail
protected function showEmail( $step ) {
$header = new HtmlTag( 'h2' );
$step_message = 'translate-fs-email-title';
$header->style( 'opacity', 0.4 )->content( wfMsg( $step_message ) );
if ( $step && ( $step !== 'translate-fs-target-title' && $step !== 'translate-fs-permissions-title' ) ) {
$this->out->addHtml( $header );
return $step;
}
if ( $this->user->isEmailConfirmed() ) {
$header->content( $header->content . wfMsg( 'translate-fs-pagetitle-done' ) );
$this->out->addHtml( $header );
return $step; // Start translating step
}
$this->out->addHtml( $header->style( 'opacity', false ) );
$this->out->addWikiMsg( 'translate-fs-email-text' );
return $step_message;
}
示例3: setBottomText
function setBottomText(OutputPage $out, FormOptions $opts)
{
if (isset($this->mTargetTitle) && is_object($this->mTargetTitle)) {
global $wgUser;
$out->setFeedAppendQuery("target=" . urlencode($this->mTargetTitle->getPrefixedDBkey()));
}
if (isset($this->mResultEmpty) && $this->mResultEmpty) {
$out->addWikiMsg('recentchangeslinked-noresult');
}
}
示例4: execute
//.........这里部分代码省略.........
} else {
// Check processing time
if ( !isset( $this->time ) ) {
$this->time = wfTimestamp();
}
$message = self::doAction(
$action,
$group,
$key,
$code,
$value
);
$key = array_shift( $message );
$params = $message;
$message = wfMsgExt( $key, 'parseinline', $params );
$changed[] = "<li>$message</li>";
if ( $this->checkProcessTime() ) {
$process = false;
$duration = $wgLang->formatNum( $this->processingTime );
$message = wfMsgExt( 'translate-manage-toolong', 'parseinline', $duration );
$changed[] = "<li>$message</li></ul>";
}
continue;
}
}
$alldone = false;
$actions = $this->getActions();
$defaction = $this->getDefaultAction( $fuzzy, $action );
$act = array();
foreach ( $actions as $action ) {
$label = wfMsg( "translate-manage-action-$action" );
$name = self::escapeNameForPHP( "action-$type-$key" );
$id = Sanitizer::escapeId( "action-$key-$action" );
$act[] = Xml::radioLabel( $label, $name, $action, $id, $action === $defaction );
}
$name = wfMsg( 'translate-manage-import-diff',
'<code style="font-weight:normal;">' . htmlspecialchars( $key ) . '</code>',
implode( ' ', $act )
);
$changed[] = self::makeSectionElement( $name, $type, $text );
}
}
if ( !$process ) {
$collection->filter( 'hastranslation', false );
$keys = $collection->getMessageKeys();
$diff = array_diff( $keys, array_keys( $messages ) );
foreach ( $diff as $s ) {
// @todo FIXME: Use CSS file.
$name = wfMsgHtml( 'translate-manage-import-deleted',
'<code style="font-weight:normal;">' . htmlspecialchars( $s ) . '</code>'
);
$text = TranslateUtils::convertWhiteSpaceToHTML( $collection[$s]->translation() );
$changed[] = self::makeSectionElement( $name, 'deleted', $text );
}
}
if ( $process || ( !count( $changed ) && $code !== 'en' ) ) {
if ( !count( $changed ) ) {
$this->out->addWikiMsg( 'translate-manage-nochanges-other' );
}
if ( !count( $changed ) || strpos( $changed[count( $changed ) - 1], '<li>' ) !== 0 ) {
$changed[] = '<ul>';
}
$message = wfMsgExt( 'translate-manage-import-done', 'parseinline' );
$changed[] = "<li>$message</li></ul>";
$this->out->addHTML( implode( "\n", $changed ) );
} else {
// END
if ( count( $changed ) ) {
if ( $code === 'en' ) {
$this->out->addWikiMsg( 'translate-manage-intro-en' );
} else {
$lang = TranslateUtils::getLanguageName( $code, false, $wgLang->getCode() );
$this->out->addWikiMsg( 'translate-manage-intro-other', $lang );
}
$this->out->addHTML( Html::hidden( 'language', $code ) );
$this->out->addHTML( implode( "\n", $changed ) );
$this->out->addHTML( Xml::submitButton( wfMsg( 'translate-manage-submit' ) ) );
} else {
$this->out->addWikiMsg( 'translate-manage-nochanges' );
}
}
$this->out->addHTML( $this->doFooter() );
return $alldone;
}
示例5: showDeletionLog
/**
* If there are rows in the deletion log for this page, show them,
* along with a nice little note for the user
*
* @param OutputPage $out
*/
protected function showDeletionLog($out)
{
global $wgUser;
$loglist = new LogEventsList($wgUser->getSkin(), $out);
$pager = new LogPager($loglist, 'delete', false, $this->mTitle->getPrefixedText());
$count = $pager->getNumRows();
if ($count > 0) {
$pager->mLimit = 10;
$out->addHTML('<div class="mw-warning-with-logexcerpt">');
$out->addWikiMsg('recreate-deleted-warn');
$out->addHTML($loglist->beginLogEventsList() . $pager->getBody() . $loglist->endLogEventsList());
if ($count > 10) {
$out->addHTML($wgUser->getSkin()->link(SpecialPage::getTitleFor('Log'), wfMsgHtml('deletelog-fulllog'), array(), array('type' => 'delete', 'page' => $this->mTitle->getPrefixedText())));
}
$out->addHTML('</div>');
return true;
}
return false;
}
示例6: showDeletionLog
/**
* If there are rows in the deletion log for this page, show them,
* along with a nice little note for the user
*
* @param OutputPage $out
*/
private function showDeletionLog($out)
{
$title = $this->mTitle;
$reader = new LogReader(new FauxRequest(array('page' => $title->getPrefixedText(), 'type' => 'delete')));
if ($reader->hasRows()) {
$out->addHtml('<div id="mw-recreate-deleted-warn">');
$out->addWikiMsg('recreate-deleted-warn');
$viewer = new LogViewer($reader);
$viewer->showList($out);
$out->addHtml('</div>');
}
}
示例7: showDeletionLog
/**
* If there are rows in the deletion log for this file, show them,
* along with a nice little note for the user
*
* @param OutputPage $out
* @param string filename
*/
private function showDeletionLog($out, $filename)
{
global $wgUser;
$loglist = new LogEventsList($wgUser->getSkin(), $out);
$pager = new LogPager($loglist, 'delete', false, $filename);
if ($pager->getNumRows() > 0) {
$out->addHTML('<div class="mw-warning-with-logexcerpt">');
$out->addWikiMsg('upload-wasdeleted');
$out->addHTML($loglist->beginLogEventsList() . $pager->getBody() . $loglist->endLogEventsList());
$out->addHTML('</div>');
}
}
示例8: setBottomText
function setBottomText(OutputPage $out, FormOptions $opts)
{
if (isset($this->mResultEmpty) && $this->mResultEmpty) {
$out->addWikiMsg('recentchangeslinked-noresult');
}
}
示例9: showDeletionLog
/**
* If there are rows in the deletion log for this file, show them,
* along with a nice little note for the user
*
* @param OutputPage $out
* @param string filename
*/
private function showDeletionLog($out, $filename)
{
$reader = new LogReader(new FauxRequest(array('page' => $filename, 'type' => 'delete')));
if ($reader->hasRows()) {
$out->addHtml('<div id="mw-upload-deleted-warn">');
$out->addWikiMsg('upload-wasdeleted');
$viewer = new LogViewer($reader);
$viewer->showList($out);
$out->addHtml('</div>');
}
}
示例10: execute
public function execute($messages)
{
$context = RequestContext::getMain();
$this->out = $context->getOutput();
// Set up diff engine
$diff = new DifferenceEngine();
$diff->showDiffStyle();
$diff->setReducedLineNumbers();
// Check whether we do processing
$process = $this->allowProcess();
// Initialise collection
$group = $this->getGroup();
$code = $this->getCode();
$collection = $group->initCollection($code);
$collection->loadTranslations();
$this->out->addHTML($this->doHeader());
// Determine changes
$alldone = $process;
$changed = array();
foreach ($messages as $key => $value) {
$fuzzy = $old = false;
if (isset($collection[$key])) {
$old = $collection[$key]->translation();
}
// No changes at all, ignore
if (strval($old) === strval($value)) {
continue;
}
if ($old === false) {
$para = '<code class="mw-tmi-new">' . htmlspecialchars($key) . '</code>';
$name = $context->msg('translate-manage-import-new')->rawParams($para)->escaped();
$text = TranslateUtils::convertWhiteSpaceToHTML($value);
$changed[] = self::makeSectionElement($name, 'new', $text);
} else {
$oldContent = ContentHandler::makeContent($old, $diff->getTitle());
$newContent = ContentHandler::makeContent($value, $diff->getTitle());
$diff->setContent($oldContent, $newContent);
$text = $diff->getDiff('', '');
$type = 'changed';
$action = $context->getRequest()->getVal(self::escapeNameForPHP("action-{$type}-{$key}"));
if ($process) {
if (!count($changed)) {
$changed[] = '<ul>';
}
if ($action === null) {
$message = $context->msg('translate-manage-inconsistent', wfEscapeWikiText("action-{$type}-{$key}"))->parse();
$changed[] = "<li>{$message}</li></ul>";
$process = false;
} else {
// Check processing time
if (!isset($this->time)) {
$this->time = wfTimestamp();
}
$message = self::doAction($action, $group, $key, $code, $value);
$key = array_shift($message);
$params = $message;
$message = $context->msg($key, $params)->parse();
$changed[] = "<li>{$message}</li>";
if ($this->checkProcessTime()) {
$process = false;
$message = $context->msg('translate-manage-toolong')->numParams($this->processingTime)->parse();
$changed[] = "<li>{$message}</li></ul>";
}
continue;
}
}
$alldone = false;
$actions = $this->getActions();
$defaction = $this->getDefaultAction($fuzzy, $action);
$act = array();
// Give grep a chance to find the usages:
// translate-manage-action-import, translate-manage-action-conflict,
// translate-manage-action-ignore, translate-manage-action-fuzzy
foreach ($actions as $action) {
$label = $context->msg("translate-manage-action-{$action}")->text();
$name = self::escapeNameForPHP("action-{$type}-{$key}");
$id = Sanitizer::escapeId("action-{$key}-{$action}");
$act[] = Xml::radioLabel($label, $name, $action, $id, $action === $defaction);
}
$param = '<code class="mw-tmi-diff">' . htmlspecialchars($key) . '</code>';
$name = $context->msg('translate-manage-import-diff', $param, implode(' ', $act))->text();
$changed[] = self::makeSectionElement($name, $type, $text);
}
}
if (!$process) {
$collection->filter('hastranslation', false);
$keys = $collection->getMessageKeys();
$diff = array_diff($keys, array_keys($messages));
foreach ($diff as $s) {
$para = '<code class="mw-tmi-deleted">' . htmlspecialchars($s) . '</code>';
$name = $context->msg('translate-manage-import-deleted')->rawParams($para)->escaped();
$text = TranslateUtils::convertWhiteSpaceToHTML($collection[$s]->translation());
$changed[] = self::makeSectionElement($name, 'deleted', $text);
}
}
if ($process || !count($changed) && $code !== 'en') {
if (!count($changed)) {
$this->out->addWikiMsg('translate-manage-nochanges-other');
}
if (!count($changed) || strpos($changed[count($changed) - 1], '<li>') !== 0) {
//.........这里部分代码省略.........