当前位置: 首页>>代码示例>>PHP>>正文


PHP wfMsgReal函数代码示例

本文整理汇总了PHP中wfMsgReal函数的典型用法代码示例。如果您正苦于以下问题:PHP wfMsgReal函数的具体用法?PHP wfMsgReal怎么用?PHP wfMsgReal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了wfMsgReal函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: WikiErrorMsg

 /**
  * @param $message String: wiki message name
  * @param ... parameters to pass to wfMsg()
  */
 function WikiErrorMsg($message)
 {
     $args = func_get_args();
     array_shift($args);
     $this->mMessage = wfMsgReal($message, $args, true);
     $this->mMsgKey = $message;
     $this->mMsgArgs = $args;
 }
开发者ID:rocLv,项目名称:conference,代码行数:12,代码来源:WikiError.php

示例2: msg

 function msg($key, $fallback)
 {
     $args = array_slice(func_get_args(), 2);
     if ($this->useMessageCache()) {
         return wfMsgReal($key, $args);
     } else {
         return wfMsgReplaceArgs($fallback, $args);
     }
 }
开发者ID:negabaro,项目名称:alfresco,代码行数:9,代码来源:Exception.php

示例3: intFunction

 static function intFunction($parser, $part1 = '')
 {
     if (strval($part1) !== '') {
         $args = array_slice(func_get_args(), 2);
         return wfMsgReal($part1, $args, true);
     } else {
         return array('found' => false);
     }
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:9,代码来源:CoreParserFunctions.php

示例4: notifyUser

 /**
  * Notifies a single user of the changes made to properties in a single edit.
  *
  * @since 0.1
  *
  * @param SWLGroup $group
  * @param User $user
  * @param SWLChangeSet $changeSet
  * @param boolean $describeChanges
  *
  * @return Status
  */
 public static function notifyUser(SWLGroup $group, User $user, SWLChangeSet $changeSet, $describeChanges)
 {
     global $wgLang, $wgPasswordSender, $wgPasswordSenderName;
     $emailText = wfMsgExt('swl-email-propschanged-long', 'parse', $GLOBALS['wgSitename'], $changeSet->getEdit()->getUser()->getName(), SpecialPage::getTitleFor('SemanticWatchlist')->getFullURL(), $wgLang->time($changeSet->getEdit()->getTime()), $wgLang->date($changeSet->getEdit()->getTime()));
     if ($describeChanges) {
         $emailText .= '<h3> ' . wfMsgExt('swl-email-changes', 'parse', $changeSet->getEdit()->getTitle()->getFullText(), $changeSet->getEdit()->getTitle()->getFullURL()) . ' </h3>';
         $emailText .= self::getChangeListHTML($changeSet, $group);
     }
     $title = wfMsgReal('swl-email-propschanged', array($changeSet->getEdit()->getTitle()->getFullText()), true, $user->getOption('language'));
     wfRunHooks('SWLBeforeEmailNotify', array($group, $user, $changeSet, $describeChanges, &$title, &$emailText));
     return UserMailer::send(new MailAddress($user), new MailAddress($wgPasswordSender, $wgPasswordSenderName), $title, $emailText, null, 'text/html; charset=ISO-8859-1');
 }
开发者ID:nischayn22,项目名称:mediawiki-extensions-SemanticWatchlist,代码行数:24,代码来源:SWL_Emailer.php

示例5: 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

示例6: parseResponse

	function parseResponse( $text ) {
		if ( strval( $text ) == '' ) {
			// lastError should have been set by post/postFile, but just in case, we'll
			// set a fallback message here.
			if ( strval( $this->lastError ) == '' ) {
				$this->setError( 'webstore_no_response' );
			}
			return false;
		}
		wfSuppressWarnings();
		try {
			$response = new SimpleXMLElement( $text );
		} catch ( Exception $e ) {
			$response = false;
		}
		wfRestoreWarnings();
		if ( !$response ) {
			$this->setError( 'webstore_invalid_response', $text ) . "\n";
			return false;
		}
		if ( $response->errors ) {
			$errors = array();
			foreach ( $response->errors->children() as $error ) {
				$message = strval( $error->message );
				$params = array();
				if ( isset( $error->params ) ) {
					foreach ( $error->params->children as $param ) {
						$params[] = strval( $param );
					}
				}
				$errors[] = wfMsgReal( $message, $params );
			}
			if ( count( $errors ) == 1 ) {
				$this->lastError = wfMsg( 'webstore_backend_error', $errors[0] ) . "\n";
			} else {
				$errorsText = '';
				foreach ( $errors as $error ) {
					$errorsText .= '* ' . str_replace( "\n", ' ', $error );
				}
				$this->lastError = wfMsg( 'webstore_backend_error', $errorsText ) . "\n";
			}
		}
		return $response;
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:44,代码来源:WebStoreClient.php

示例7: doSubmit

 /**
  * UI entry point for blocking
  * Wraps around doBlock()
  */
 function doSubmit()
 {
     global $wgOut;
     $retval = $this->doBlock();
     if (empty($retval)) {
         $titleObj = SpecialPage::getTitleFor('Blockip');
         $wgOut->redirect($titleObj->getFullURL('action=success&ip=' . urlencode($this->BlockAddress)));
         return;
     }
     $key = array_shift($retval);
     $this->showForm(wfMsgReal($key, $retval));
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:16,代码来源:SpecialBlockip.php

示例8: actionText

 /**
  * @static
  */
 function actionText($type, $action, $title = NULL, $skin = NULL, $params = array(), $filterWikilinks = false, $translate = false)
 {
     global $wgLang, $wgContLang, $wgLogActions;
     $key = "{$type}/{$action}";
     if (isset($wgLogActions[$key])) {
         if (is_null($title)) {
             $rv = wfMsg($wgLogActions[$key]);
         } else {
             if ($skin) {
                 switch ($type) {
                     case 'move':
                         $titleLink = $skin->makeLinkObj($title, $title->getPrefixedText(), 'redirect=no');
                         $params[0] = $skin->makeLinkObj(Title::newFromText($params[0]), $params[0]);
                         break;
                     case 'block':
                         if (substr($title->getText(), 0, 1) == '#') {
                             $titleLink = $title->getText();
                         } else {
                             $titleLink = $skin->makeLinkObj($title, $title->getText());
                             $titleLink .= ' (' . $skin->makeKnownLinkObj(Title::makeTitle(NS_SPECIAL, 'Contributions/' . $title->getDBkey()), wfMsg('contribslink')) . ')';
                         }
                         break;
                     case 'rights':
                         $text = $wgContLang->ucfirst($title->getText());
                         $titleLink = $skin->makeLinkObj(Title::makeTitle(NS_USER, $text));
                         break;
                     default:
                         $titleLink = $skin->makeLinkObj($title);
                 }
             } else {
                 $titleLink = $title->getPrefixedText();
             }
             if ($key == 'rights/rights') {
                 if ($skin) {
                     $rightsnone = wfMsg('rightsnone');
                 } else {
                     $rightsnone = wfMsgForContent('rightsnone');
                 }
                 if (!isset($params[0]) || trim($params[0]) == '') {
                     $params[0] = $rightsnone;
                 }
                 if (!isset($params[1]) || trim($params[1]) == '') {
                     $params[1] = $rightsnone;
                 }
             }
             if (count($params) == 0) {
                 if ($skin) {
                     $rv = wfMsg($wgLogActions[$key], $titleLink);
                 } else {
                     $rv = wfMsgForContent($wgLogActions[$key], $titleLink);
                 }
             } else {
                 array_unshift($params, $titleLink);
                 if ($translate && $key == 'block/block') {
                     $params[1] = $wgLang->translateBlockExpiry($params[1]);
                 }
                 $rv = wfMsgReal($wgLogActions[$key], $params, true, !$skin);
             }
         }
     } else {
         wfDebug("LogPage::actionText - unknown action {$key}\n");
         $rv = "{$action}";
     }
     if ($filterWikilinks) {
         $rv = str_replace("[[", "", $rv);
         $rv = str_replace("]]", "", $rv);
     }
     return $rv;
 }
开发者ID:puring0815,项目名称:OpenKore,代码行数:72,代码来源:LogPage.php

示例9: setMsg

 public function setMsg($msg, $params)
 {
     $this->_labels['MSG'] = wfMsgReal($msg, $params, true);
 }
开发者ID:nemphis,项目名称:mw-editwarning,代码行数:4,代码来源:EditWarningMessage.class.php

示例10: showMessage

 /**
  * Show a short informational message.
  * Output looks like a list.
  *
  * @param $msg string
  */
 public function showMessage($msg)
 {
     $args = func_get_args();
     array_shift($args);
     $html = '<div class="config-message">' . $this->parse(wfMsgReal($msg, $args, false, false, false)) . "</div>\n";
     $this->output->addHTML($html);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:13,代码来源:WebInstaller.php

示例11: sp_getMessageText

	function sp_getMessageText( $id ) {
		foreach ( $this->errors as $error ) {
			if ( $error['securepoll-id'] !== $id ) {
				continue;
			}
			return wfMsgReal( $error['message'], $error['params'] );
		}
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:8,代码来源:Ballot.php

示例12: __construct

 function __construct($msg, $width, $height)
 {
     $args = array_slice(func_get_args(), 3);
     $htmlArgs = array_map('htmlspecialchars', $args);
     $htmlArgs = array_map('nl2br', $htmlArgs);
     $this->htmlMsg = wfMsgReplaceArgs(htmlspecialchars(wfMsgGetKey($msg, true)), $htmlArgs);
     $this->textMsg = wfMsgReal($msg, $args);
     $this->width = intval($width);
     $this->height = intval($height);
     $this->url = false;
     $this->path = false;
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:12,代码来源:MediaTransformOutput.php

示例13: msg

 /**
  * Get a CategoryTree message, "categorytree-" prefix added automatically
  */
 static function msg($msg)
 {
     wfLoadExtensionMessages('CategoryTree');
     if ($msg === false) {
         return null;
     }
     $args = func_get_args();
     $msg = array_shift($args);
     if ($msg == '') {
         return wfMsgReal($msg, $args);
     } else {
         return wfMsgReal("categorytree-{$msg}", $args);
     }
 }
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:17,代码来源:CategoryTreeFunctions.php

示例14: actionText

 /**
  * @static
  */
 function actionText($type, $action, $title = NULL, $skin = NULL, $params = array(), $filterWikilinks = false)
 {
     static $actions = array('block/block' => 'blocklogentry', 'block/unblock' => 'unblocklogentry', 'protect/protect' => 'protectedarticle', 'protect/unprotect' => 'unprotectedarticle', 'rights/rights' => 'bureaucratlogentry', 'rights/addgroup' => 'addgrouplogentry', 'rights/rngroup' => 'renamegrouplogentry', 'rights/chgroup' => 'changegrouplogentry', 'delete/delete' => 'deletedarticle', 'delete/restore' => 'undeletedarticle', 'upload/upload' => 'uploadedimage', 'upload/revert' => 'uploadedimage', 'move/move' => '1movedto2', 'move/move_redir' => '1movedto2_redir');
     $key = "{$type}/{$action}";
     if (isset($actions[$key])) {
         if (is_null($title)) {
             $rv = wfMsgForContent($actions[$key]);
         } else {
             if ($skin) {
                 if ($type == 'move') {
                     $titleLink = $skin->makeLinkObj($title, $title->getPrefixedText(), 'redirect=no');
                     // Change $param[0] into a link to the title specified in $param[0]
                     $movedTo = Title::newFromText($params[0]);
                     $params[0] = $skin->makeLinkObj($movedTo, $params[0]);
                 } else {
                     $titleLink = $skin->makeLinkObj($title);
                 }
             } else {
                 $titleLink = $title->getPrefixedText();
             }
             if (count($params) == 0) {
                 $rv = wfMsgForContent($actions[$key], $titleLink);
             } else {
                 array_unshift($params, $titleLink);
                 $rv = wfMsgReal($actions[$key], $params, true, true);
             }
         }
     } else {
         wfDebug("LogPage::actionText - unknown action {$key}\n");
         $rv = "{$action}";
     }
     if ($filterWikilinks) {
         $rv = str_replace("[[", "", $rv);
         $rv = str_replace("]]", "", $rv);
     }
     return $rv;
 }
开发者ID:BackupTheBerlios,项目名称:openzaurus-svn,代码行数:40,代码来源:LogPage.php

示例15: __construct

	/**
	 * Constructor.
	 * 
	 * In addition to a message key, the constructor may include optional
	 * arguments of any number, as in:
	 * new WCException( 'message-1', ... );
	 * @param messageKey string The message key
	 * @param optionalArgs string = any number of arguments
	 * @return string Value of object.
	 */
	public function __construct( $messageKey ) {
		$args = func_get_args();
		array_shift( $args );
		$transformedMessage = wfMsgReal( $messageKey, $args, true );
		parent::__construct( $transformedMessage );
    }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:16,代码来源:WCException.php


注:本文中的wfMsgReal函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。