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


PHP wfMsg函数代码示例

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


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

示例1: wfAutotimestamp

function wfAutotimestamp(&$article, &$user, &$text, &$summary, $minor, $watch, $sectionanchor, &$flags)
{
    if (strpos($text, "{{") !== false) {
        $t1 = preg_replace('/\\<nowiki\\>.*<\\/nowiki>/', '', $text);
        preg_match_all('/{{[^}]*}}/im', $t1, $matches);
        $templates = split(' ', strtolower(wfMsg('templates_needing_autotimestamps')));
        $templates = array_flip($templates);
        foreach ($matches[0] as $m) {
            $mm = preg_replace('/\\|[^}]*/', '', $m);
            $mm = preg_replace('/[}{]/', '', $mm);
            if (isset($templates[strtolower($mm)])) {
                if (strpos($m, "date=") === false) {
                    $m1 = str_replace("}}", "|date=" . date('Y-m-d') . "}}", $m);
                    $text = str_replace($m, $m1, $text);
                } else {
                    preg_match('/date=(.*)}}/', $m, $mmatches);
                    $mmm = $mmatches[1];
                    if ($mmm !== date('Y-m-d', strtotime($mmm))) {
                        $text = str_replace($mmm, date('Y-m-d', strtotime($mmm)), $text);
                    }
                }
            } else {
                //echo "wouldn't substitute on $m<br/>";
            }
        }
    }
    return true;
}
开发者ID:biribogos,项目名称:wikihow-src,代码行数:28,代码来源:AutotimestampTemplates.php

示例2: getDisabledMessage

 protected function getDisabledMessage()
 {
     if ($this->disabledExtension) {
         return wfMsg('oasis-toolbar-not-enabled-here');
     }
     return parent::getDisabledMessage();
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:7,代码来源:SpecialPageUserCommand.php

示例3: doTagRow

 function doTagRow($tag, $hitcount)
 {
     static $sk = null, $doneTags = array();
     if (!$sk) {
         global $wgUser;
         $sk = $wgUser->getSkin();
     }
     if (in_array($tag, $doneTags)) {
         return '';
     }
     $newRow = '';
     $newRow .= Xml::tags('td', null, Xml::element('tt', null, $tag));
     $disp = ChangeTags::tagDescription($tag);
     $disp .= ' (' . $sk->link(Title::makeTitle(NS_MEDIAWIKI, "Tag-{$tag}"), wfMsg('tags-edit')) . ')';
     $newRow .= Xml::tags('td', null, $disp);
     $desc = wfMsgExt("tag-{$tag}-description", 'parseinline');
     $desc = wfEmptyMsg("tag-{$tag}-description", $desc) ? '' : $desc;
     $desc .= ' (' . $sk->link(Title::makeTitle(NS_MEDIAWIKI, "Tag-{$tag}-description"), wfMsg('tags-edit')) . ')';
     $newRow .= Xml::tags('td', null, $desc);
     $hitcount = wfMsg('tags-hitcount', $hitcount);
     $hitcount = $sk->link(SpecialPage::getTitleFor('RecentChanges'), $hitcount, array(), array('tagfilter' => $tag));
     $newRow .= Xml::tags('td', null, $hitcount);
     $doneTags[] = $tag;
     return Xml::tags('tr', null, $newRow) . "\n";
 }
开发者ID:ruizrube,项目名称:spdef,代码行数:25,代码来源:SpecialTags.php

示例4: create

 /**
  * Create a new poll
  * @param wgRequest question
  * @param wgRequest answer   (expects PHP array style in the form <input name=answer[]>)
  * Page Content should be of a different style so we have to translate
  *	  *question 1\n
  *	  *question 2\n
  */
 public static function create()
 {
     wfProfileIn(__METHOD__);
     $app = F::app();
     $title = $app->wg->Request->getVal('question');
     $answers = $app->wg->Request->getArray('answer');
     // array
     $title_object = Title::newFromText($title, NS_WIKIA_POLL);
     if (is_object($title_object) && $title_object->exists()) {
         $res = array('success' => false, 'error' => $app->renderView('Error', 'Index', array(wfMsg('wikiapoll-error-duplicate'))));
     } else {
         if ($title_object == null) {
             $res = array('success' => false, 'error' => $app->renderView('Error', 'Index', array(wfMsg('wikiapoll-error-invalid-title'))));
         } else {
             $content = "";
             foreach ($answers as $answer) {
                 $content .= "*{$answer}\n";
             }
             /* @var $article WikiPage */
             $article = new Article($title_object, NS_WIKIA_POLL);
             $article->doEdit($content, 'Poll Created', EDIT_NEW, false, $app->wg->User);
             $title_object = $article->getTitle();
             // fixme: check status object
             $res = array('success' => true, 'pollId' => $article->getID(), 'url' => $title_object->getLocalUrl(), 'question' => $title_object->getPrefixedText());
         }
     }
     wfProfileOut(__METHOD__);
     return $res;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:37,代码来源:WikiaPollAjax.class.php

示例5: wfFormatEmail

function wfFormatEmail(&$to, &$from, &$subject, &$text)
{
    global $wgUser;
    $ul = $wgUser->getUserPage();
    $text = wfMsg('email_header') . $text . wfMsg('email_footer', $wgUser->getName(), $ul->getFullURL());
    return true;
}
开发者ID:biribogos,项目名称:wikihow-src,代码行数:7,代码来源:FormatEmail.php

示例6: getHtml

 /**
  * Returns the HTML which is added to $wgOut after the article text.
  *
  * @return string
  */
 protected function getHtml()
 {
     wfProfileIn(__METHOD__ . ' (SMW)');
     if ($this->limit > 0) {
         // limit==0: configuration setting to disable this completely
         $store = smwfGetStore();
         $description = new SMWConceptDescription($this->getDataItem());
         $query = SMWPageLister::getQuery($description, $this->limit, $this->from, $this->until);
         $queryResult = $store->getQueryResult($query);
         $diWikiPages = $queryResult->getResults();
         if ($this->until !== '') {
             $diWikiPages = array_reverse($diWikiPages);
         }
         $errors = $queryResult->getErrors();
     } else {
         $diWikiPages = array();
         $errors = array();
     }
     $pageLister = new SMWPageLister($diWikiPages, null, $this->limit, $this->from, $this->until);
     $this->mTitle->setFragment('#SMWResults');
     // Make navigation point to the result list.
     $navigation = $pageLister->getNavigationLinks($this->mTitle);
     $titleText = htmlspecialchars($this->mTitle->getText());
     $resultNumber = min($this->limit, count($diWikiPages));
     $result = "<a name=\"SMWResults\"></a><div id=\"mw-pages\">\n" . '<h2>' . wfMsg('smw_concept_header', $titleText) . "</h2>\n" . wfMsgExt('smw_conceptarticlecount', array('parsemag'), $resultNumber) . smwfEncodeMessages($errors) . "\n" . $navigation . $pageLister->formatList() . $navigation . "</div>\n";
     wfProfileOut(__METHOD__ . ' (SMW)');
     return $result;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:33,代码来源:SMW_ConceptPage.php

示例7: onGetPreferences

 /**
  * @param User $user
  * @param Array $defaultPreferences
  * @return bool
  */
 function onGetPreferences($user, &$defaultPreferences)
 {
     global $wgOut, $wgJsMimeType, $wgExtensionsPath, $wgCityId;
     $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$wgExtensionsPath}/wikia/SpecialUnsubscribe/UnsubscribePreferences.js\"></script>");
     $unsubscribe = array('unsubscribed' => array('type' => 'toggle', 'section' => 'personal/email', 'label-message' => 'unsubscribe-preferences-toggle'));
     $notice = array('no-email-notice-followedpages' => array('type' => 'info', 'section' => 'watchlist/basic', 'default' => wfMsg('unsubscribe-preferences-notice')));
     // move e-mail options higher up
     $emailAddress = array('emailaddress' => $defaultPreferences['emailaddress']);
     unset($defaultPreferences['emailaddress']);
     $defaultPreferences = self::insert($defaultPreferences, 'language', $emailAddress, false);
     // move founder emails higher up
     $founderEmailsFirstKey = "adoptionmails-label-{$wgCityId}";
     if (!empty($defaultPreferences[$founderEmailsFirstKey])) {
         $founderEmails = array($founderEmailsFirstKey => $defaultPreferences[$founderEmailsFirstKey]);
         unset($defaultPreferences[$founderEmailsFirstKey]);
         $defaultPreferences = self::insert($defaultPreferences, 'emailaddress', $founderEmails);
     }
     // add the unsubscribe checkbox
     $defaultPreferences = self::insert($defaultPreferences, 'emailauthentication', $unsubscribe);
     // add a notice if needed
     if ($user->getOption('unsubscribe')) {
         $defaultPreferences = self::insert($defaultPreferences, 'watchdefault', $notice, false);
     }
     $defaultPreferences = self::insert($defaultPreferences, 'language', $emailAddress, false);
     return true;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:31,代码来源:UnsubscribePreferences.class.php

示例8: tag_runphp

 public function tag_runphp(&$code, &$params, &$parser)
 {
     if (!self::checkExecuteRight($parser->mTitle)) {
         return 'SecurePHP: ' . wfMsg('badaccess');
     }
     return self::executeCode($code);
 }
开发者ID:clrh,项目名称:mediawiki,代码行数:7,代码来源:SecurePHP.body.php

示例9: index

 /**
  * @brief Displays the main menu for the admin dashboard
  *
  */
 public function index()
 {
     $this->wg->Out->setPageTitle(wfMsg('admindashboard-title'));
     if (!$this->wg->User->isAllowed('admindashboard')) {
         $this->displayRestrictionError();
         return false;
         // skip rendering
     }
     $this->tab = $this->getVal('tab', 'general');
     // links
     $this->urlThemeDesigner = Title::newFromText('ThemeDesigner', NS_SPECIAL)->getFullURL();
     $this->urlRecentChanges = Title::newFromText('RecentChanges', NS_SPECIAL)->getFullURL();
     $this->urlTopNavigation = Title::newFromText('Wiki-navigation', NS_MEDIAWIKI)->getFullURL('action=edit');
     $this->urlWikiFeatures = Title::newFromText('WikiFeatures', NS_SPECIAL)->getFullURL();
     $this->urlPageLayoutBuilder = Title::newFromText('PageLayoutBuilder', NS_SPECIAL)->getFullURL('action=list');
     $this->urlListUsers = Title::newFromText('ListUsers', NS_SPECIAL)->getFullURL();
     $this->urlUserRights = Title::newFromText('UserRights', NS_SPECIAL)->getFullURL();
     $this->urlCommunityCorner = Title::newFromText('Community-corner', NS_MEDIAWIKI)->getFullURL('action=edit');
     $this->urlAllCategories = Title::newFromText('Categories', NS_SPECIAL)->getFullURL();
     $this->urlAddPage = Title::newFromText('CreatePage', NS_SPECIAL)->getFullURL();
     $this->urlAddPhoto = Title::newFromText('Upload', NS_SPECIAL)->getFullURL();
     $this->urlCreateBlogPage = Title::newFromText('CreateBlogPage', NS_SPECIAL)->getFullURL();
     $this->urlMultipleUpload = Title::newFromText('MultipleUpload', NS_SPECIAL)->getFullURL();
     $this->urlGetPromoted = Title::newFromText('Promote', NS_SPECIAL)->getFullURL();
     // special:specialpages
     $this->advancedSection = (string) $this->app->sendRequest('AdminDashboardSpecialPage', 'getAdvancedSection', array());
     // icon display logic
     $this->displayPageLayoutBuilder = !empty($this->wg->EnablePageLayoutBuilder);
     $this->displayWikiFeatures = !empty($this->wg->EnableWikiFeatures);
     $this->displaySpecialPromote = !empty($this->wg->EnableSpecialPromoteExt);
     // add messages package
     F::build('JSMessages')->enqueuePackage('AdminDashboard', JSMessages::INLINE);
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:37,代码来源:AdminDashboardSpecialPageController.class.php

示例10: wfSpecialExport

/**
 *
 */
function wfSpecialExport($page = '')
{
    global $wgOut, $wgLang, $wgRequest;
    if ($wgRequest->getVal('action') == 'submit') {
        $page = $wgRequest->getText('pages');
        $curonly = $wgRequest->getCheck('curonly');
    } else {
        # Pre-check the 'current version only' box in the UI
        $curonly = true;
    }
    if ($page != '') {
        $wgOut->disable();
        header("Content-type: application/xml; charset=utf-8");
        $pages = explode("\n", $page);
        $db =& wfGetDB(DB_SLAVE);
        $history = $curonly ? MW_EXPORT_CURRENT : MW_EXPORT_FULL;
        $exporter = new WikiExporter($db, $history);
        $exporter->openStream();
        $exporter->pagesByName($pages);
        $exporter->closeStream();
        return;
    }
    $wgOut->addWikiText(wfMsg("exporttext"));
    $titleObj = Title::makeTitle(NS_SPECIAL, "Export");
    $action = $titleObj->escapeLocalURL('action=submit');
    $wgOut->addHTML("\n<form method='post' action=\"{$action}\">\n<input type='hidden' name='action' value='submit' />\n<textarea name='pages' cols='40' rows='10'></textarea><br />\n<label><input type='checkbox' name='curonly' value='true' checked='checked' />\n" . wfMsg("exportcuronly") . "</label><br />\n<input type='submit' />\n</form>\n");
}
开发者ID:BackupTheBerlios,项目名称:openzaurus-svn,代码行数:30,代码来源:SpecialExport.php

示例11: execute

 /**
  * Show the special page
  *
  * @param $par Mixed: parameter passed to the page or null
  */
 public function execute($par)
 {
     global $wgOut;
     $wgOut->setPageTitle(wfMsg('myip'));
     $ip = wfGetIP();
     $wgOut->addWikiText(wfMsg('myip-out') . " {$ip}");
 }
开发者ID:aahashderuffy,项目名称:extensions,代码行数:12,代码来源:MyIP_body.php

示例12: getHtmlResult

	function getHtmlResult() {
		$ballot = $this->election->getBallot();
		if ( !is_callable( array( $ballot, 'getColumnLabels' ) ) ) {
			throw new MWException( __METHOD__.': ballot type not supported by this tallier' );
		}
		$optionLabels = array();
		foreach ( $this->question->getOptions() as $option ) {
			$optionLabels[$option->getId()] = $option->parseMessageInline( 'text' );
		}

		$labels = $ballot->getColumnLabels( $this->question );
		$s = "<table class=\"securepoll-table\">\n" .
			"<tr>\n" .
			"<th>&#160;</th>\n";
		foreach ( $labels as $label ) {
			$s .= Xml::element( 'th', array(), $label ) . "\n";
		}
		$s .= Xml::element( 'th', array(), wfMsg( 'securepoll-average-score' ) );
		$s .= "</tr>\n";
		
		foreach ( $this->averages as $oid => $average ) {
			$s .= "<tr>\n" . 
				Xml::tags( 'td', array( 'class' => 'securepoll-results-row-heading' ),
					$optionLabels[$oid] ) .
				"\n";
			foreach ( $labels as $score => $label ) {
				$s .= Xml::element( 'td', array(), $this->histogram[$oid][$score] ) . "\n";
			}
			$s .= Xml::element( 'td', array(), $average ) . "\n";
			$s .= "</tr>\n";
		}
		$s .= "</table>\n";
		return $s;
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:34,代码来源:HistogramRangeTallier.php

示例13: execute

 public function execute($parameters)
 {
     global $wgOut, $wgRequest, $wgDisableTextSearch, $wgScript;
     $this->setHeaders();
     list($limit, $offset) = wfCheckLimits();
     $wgOut->addWikiText(wfMsgForContentNoTrans('proofreadpage_specialpage_text'));
     $this->searchList = null;
     $this->searchTerm = $wgRequest->getText('key');
     $this->suppressSqlOffset = false;
     if (!$wgDisableTextSearch) {
         $self = $this->getTitle();
         $wgOut->addHTML(Xml::openElement('form', array('action' => $wgScript)) . Html::hidden('title', $this->getTitle()->getPrefixedText()) . Xml::input('limit', false, $limit, array('type' => 'hidden')) . Xml::openElement('fieldset') . Xml::element('legend', null, wfMsg('proofreadpage_specialpage_legend')) . Xml::input('key', 20, $this->searchTerm) . ' ' . Xml::submitButton(wfMsg('ilsubmit')) . Xml::closeElement('fieldset') . Xml::closeElement('form'));
         if ($this->searchTerm) {
             $index_namespace = $this->index_namespace;
             $index_ns_index = MWNamespace::getCanonicalIndex(strtolower(str_replace(' ', '_', $index_namespace)));
             $searchEngine = SearchEngine::create();
             $searchEngine->setLimitOffset($limit, $offset);
             $searchEngine->setNamespaces(array($index_ns_index));
             $searchEngine->showRedirects = false;
             $textMatches = $searchEngine->searchText($this->searchTerm);
             $escIndex = preg_quote($index_namespace, '/');
             $this->searchList = array();
             while ($result = $textMatches->next()) {
                 $title = $result->getTitle();
                 if ($title->getNamespace() == $index_ns_index) {
                     array_push($this->searchList, $title->getDBkey());
                 }
             }
             $this->suppressSqlOffset = true;
         }
     }
     parent::execute($parameters);
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:33,代码来源:SpecialProofreadPages.php

示例14: addToolboxLink

	/**
	 * @param $tpl
	 * @return bool
	 */
	public static function addToolboxLink( &$tpl ) {
		global $wgOut, $wgShortUrlPrefix;

		if ( !is_string( $wgShortUrlPrefix ) ) {
			$urlPrefix = SpecialPage::getTitleFor( 'ShortUrl' )->getCanonicalUrl() . '/';
		} else {
			$urlPrefix = $wgShortUrlPrefix;
		}

		$title = $wgOut->getTitle();
		if ( ShortUrlUtils::needsShortUrl( $title ) ) {
			$shortId = ShortUrlUtils::encodeTitle( $title );
			$shortURL = $urlPrefix . $shortId;
			$html = Html::rawElement( 'li',	array( 'id' => 't-shorturl' ),
				Html::Element( 'a', array(
					'href' => $shortURL,
					'title' => wfMsg( 'shorturl-toolbox-title' )
				),
				wfMsg( 'shorturl-toolbox-text' ) )
			);

			echo $html;
		}
		return true;
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:29,代码来源:ShortUrl.hooks.php

示例15: efFastCatSelector

function efFastCatSelector(&$categories)
{
    global $wgTitle, $wgArticle;
    // BugId:26491
    if (empty($wgTitle) || empty($wgArticle)) {
        return true;
    }
    $artname = $wgTitle->getText();
    $artid = $wgArticle->getID();
    $spice = sha1("Kroko-katMeNot-" . $artid . "-" . $artname . "-NotMekat-Schnapp");
    $catUrl = Title::newFromText('FastCat', NS_SPECIAL)->getFullURL();
    $ret = "<form action=\"{$catUrl}\" method='post'>\n<p><b>" . wfMsg('fastcat-box-title') . "</b><br>\n<small>" . wfMsg('fastcat-box-intro') . "</small>\n</p>\n<input type='hidden' name='id' value='{$artid}'>\n<input type='hidden' name='spice' value='{$spice}'>\n<input type='hidden' name='artname' value='{$artname}'>\n<p style=\"text-indent:-1em;margin-left:1em\">";
    $kat = explode("\n", wfMsgForContent('fastcat-categories-list'));
    foreach ($kat as $k) {
        if (strpos($k, '* ') === 0) {
            $k = trim($k, '* ');
            $ret .= "</p><p style=\"text-indent:-1em;margin-left:1em\">\n";
            $ret .= "<button style=\"font-size:smaller;\" name=\"cat\" value=\"{$k}\"><b>{$k}</b></button>\n";
        } else {
            $k = trim($k, '* ');
            $ret .= "<button style=\"font-size:smaller;\" name=\"cat\" value=\"{$k}\">{$k}</button>\n";
        }
    }
    $ret .= <<<EORET
\t\t</p>
\t\t</form>
EORET;
    $categories = $ret;
    return true;
}
开发者ID:schwarer2006,项目名称:wikia,代码行数:30,代码来源:FastCat.php


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