當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。