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


PHP wfUrlencode函数代码示例

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


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

示例1: wfElggWatchlistDisplayForm

function wfElggWatchlistDisplayForm($action, &$wgArticle)
{
    global $wgOut;
    if ($action == 'myact') {
        $title = $wgArticle->getTitle();
        //$page = $title->getIndexTitle();
        $page = wfUrlencode($title->getPrefixedDBkey());
        $ts = time();
        $elgg_url = ELGG_URL;
        $html = <<<END
\t\t\t<script type="text/javascript">

\t\t\t\$(document).ready(function()
\t\t\t\t{
\t\t\t\t\t\$('#elggwiki_watch_form').load("{$elgg_url}mod/mediawiki/get_watch_form_groups.php?page={$page}&ts={$ts}");
\t\t\t\t}
\t\t\t);

\t\t\t</script>

\t\t\t<div id="elggwiki_watch_form"></div>
END;
        //$wgOut->addHTML( 'The page name is ' . $title->getText() . ' and you are ' . $wgArticle->getUserText() );
        $wgOut->addHTML($html);
    }
    return false;
}
开发者ID:surevine-elgg,项目名称:mediawiki,代码行数:27,代码来源:elgg_watchlist.php

示例2: wfSpecialCiteNav

function wfSpecialCiteNav(&$skintemplate, &$nav_urls, &$oldid, &$revid)
{
    if ($skintemplate->mTitle->isContentPage() && $revid !== 0) {
        $nav_urls['cite'] = array('text' => wfMsg('cite_article_link'), 'href' => $skintemplate->makeSpecialUrl('Cite', "page=" . wfUrlencode("{$skintemplate->thispage}") . "&id={$revid}"));
    }
    return true;
}
开发者ID:ErdemA,项目名称:wikihow,代码行数:7,代码来源:SpecialCite.php

示例3: efTSPollRender

function efTSPollRender( $input, $args, $parser ) {

	// Control if the "id" is set. If not, it output a error
  if ( isset( $args['id'] ) && $args['id'] != "" ) {
		$id = wfUrlencode( $args['id'] );
	} else {
		
		return wfMsg( 'tspoll-id-error' );
	}
  
  // Control if "dev" is set. If not, it use the normal skript, else, it use the dev skript
  if ( isset( $args['dev'] ) && $args['dev'] == "1" ) { // If the arrgument dev is given, use the TSPoll-Dev-Version
      $get_server = Http::get( 'http://toolserver.org/~jan/poll/dev/main.php?page=wiki_output&id='.$id );
  } else { // sonst die normale Version verwenden
      $get_server = Http::get( 'http://toolserver.org/~jan/poll/main.php?page=wiki_output&id='.$id );
  }
 
  // If $get_server is empty it output a error
	if ( $get_server != '' ) {
		return $get_server;
	}
	else {
		
		return wfMsg( 'tspoll-fetch-error' );
	}
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:26,代码来源:TSPoll.php

示例4: wfSpecialCiteNav

/**
 * @param $skintemplate SkinTemplate
 * @param $nav_urls
 * @param $oldid
 * @param $revid
 * @return bool
 */
function wfSpecialCiteNav(&$skintemplate, &$nav_urls, &$oldid, &$revid)
{
    // check whether we’re in the right namespace, the $revid has the correct type and is not empty
    // (what would mean that the current page doesn’t exist)
    if ($skintemplate->getTitle()->isContentPage() && $revid !== 0 && !empty($revid)) {
        $nav_urls['cite'] = array('args' => "page=" . wfUrlencode("{$skintemplate->thispage}") . "&id={$revid}");
    }
    return true;
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:16,代码来源:SpecialCite.php

示例5: _redirectToCreateSP

 private function _redirectToCreateSP($listName = null)
 {
     global $wgOut;
     $specialPageTitle = Title::newFromText('CreateTopList', NS_SPECIAL);
     $url = $specialPageTitle->getFullUrl();
     if (!empty($listName)) {
         $url .= '/' . wfUrlencode($listName);
     }
     $wgOut->redirect($url);
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:10,代码来源:SpecialEditTopList.class.php

示例6: buildContentActionUrls

 function buildContentActionUrls()
 {
     global $wgKiwixStaticDump;
     $content_actions = array();
     $nskey = $this->getNameSpaceKey();
     if (isset($wgKiwixStaticDump)) {
         $content_actions['current'] = array('text' => wfMsg('currentrev'), 'href' => str_replace('$1', wfUrlencode($this->mTitle->getPrefixedDBkey()), $wgKiwixStaticDump->oldArticlePath), 'class' => false);
     }
     return $content_actions;
 }
开发者ID:kiwix,项目名称:tools,代码行数:10,代码来源:KiwixStaticDump.php

示例7: efNamepacePathsGetURL

function efNamepacePathsGetURL($title, &$url)
{
    global $wgNamespacePaths;
    // Ensure that the context of this url is one we'd do article path replacements in
    $ns = $title->getNamespace();
    if (array_key_exists($ns, $wgNamespacePaths)) {
        $url = str_replace('$1', wfUrlencode($title->getDBkey()), $wgNamespacePaths[$ns]);
    }
    return true;
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:10,代码来源:NamespacePaths.php

示例8: addLanguageAction

 /**
  * Add the language action to the list of content actions
  */
 public static function addLanguageAction(&$content_actions)
 {
     global $wgTitle;
     if ($wgTitle->getArticleId()) {
         $specialTitle = Title::newFromText("Special:MultiLanguageManager");
         if (get_class($specialTitle) != "Title") {
             return;
         }
         $content_actions['language'] = array('class' => false, 'text' => wfMsg('multilanguagemanager_language'), 'href' => $specialTitle->getLocalUrl("cible=" . wfUrlencode($wgTitle->getPrefixedDBkey())));
     }
 }
开发者ID:Avalanche85,项目名称:mw-extensions,代码行数:14,代码来源:MultiLanguageManager_body.php

示例9: wfSpecialEmailuser

/**
 * 	Constructor for Special:Emailuser.
 */
function wfSpecialEmailuser($par)
{
    global $wgRequest, $wgUser, $wgOut;
    if (!EmailUserForm::userEmailEnabled()) {
        $wgOut->showErrorPage('nosuchspecialpage', 'nospecialpagetext');
        return;
    }
    $action = $wgRequest->getVal('action');
    $target = isset($par) ? $par : $wgRequest->getVal('target');
    $targetUser = EmailUserForm::validateEmailTarget($target);
    if (!$targetUser instanceof User) {
        $wgOut->showErrorPage($targetUser . 'title', $targetUser . 'text');
        return;
    }
    $form = new EmailUserForm($targetUser, $wgRequest->getText('wpText'), $wgRequest->getText('wpSubject'), $wgRequest->getBool('wpCCMe'));
    if ($action == 'success') {
        $form->showSuccess();
        return;
    }
    $error = EmailUserForm::getPermissionsError($wgUser, $wgRequest->getVal('wpEditToken'));
    if ($error) {
        switch ($error) {
            case 'blockedemailuser':
                $wgOut->blockedPage();
                return;
            case 'actionthrottledtext':
                $wgOut->rateLimited();
                return;
            case 'sessionfailure':
                $form->showForm();
                return;
            case 'mailnologin':
                $wgOut->showErrorPage('mailnologin', 'mailnologintext');
                return;
            default:
                // It's a hook error
                list($title, $msg, $params) = $error;
                $wgOut->showErrorPage($title, $msg, $params);
                return;
        }
    }
    if ("submit" == $action && $wgRequest->wasPosted()) {
        $result = $form->doSubmit();
        if (!is_null($result)) {
            $wgOut->addHTML(wfMsg("usermailererror") . ' ' . htmlspecialchars($result->getMessage()));
        } else {
            $titleObj = SpecialPage::getTitleFor("Emailuser");
            $encTarget = wfUrlencode($form->getTarget()->getName());
            $wgOut->redirect($titleObj->getFullURL("target={$encTarget}&action=success"));
        }
    } else {
        $form->showForm();
    }
}
开发者ID:rocLv,项目名称:conference,代码行数:57,代码来源:SpecialEmailuser.php

示例10: buildContentActionUrls

 function buildContentActionUrls()
 {
     global $wgHTMLDump;
     $content_actions = array();
     $nskey = $this->getNameSpaceKey();
     $content_actions[$nskey] = $this->tabAction($this->mTitle->getSubjectPage(), $nskey, !$this->mTitle->isTalkPage());
     $content_actions['talk'] = $this->tabAction($this->mTitle->getTalkPage(), 'talk', $this->mTitle->isTalkPage(), '', true);
     if (isset($wgHTMLDump)) {
         $content_actions['current'] = array('text' => wfMsg('currentrev'), 'href' => str_replace('$1', wfUrlencode($this->mTitle->getPrefixedDBkey()), $wgHTMLDump->oldArticlePath), 'class' => false);
     }
     return $content_actions;
 }
开发者ID:evopedia,项目名称:evopedia_python,代码行数:12,代码来源:SkinOffline.php

示例11: titleURLString

	/**
	 * Creates the name of the page that appears in the URL;
	 * this method is necessary because Title::getPartialURL(), for
	 * some reason, doesn't include the namespace
	 */
	public static function titleURLString( $title ) {
		$namespace = wfUrlencode( $title->getNsText() );
		if ( $namespace !== '' ) {
			$namespace .= ':';
		}
		if ( MWNamespace::isCapitalized( $title->getNamespace() ) ) {
			global $wgContLang;
			return $namespace . $wgContLang->ucfirst( $title->getPartialURL() );
		} else {
			return $namespace . $title->getPartialURL();
		}
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:17,代码来源:SF_Utils.php

示例12: encodePage

 /**
  * @since 2.2
  *
  * @param DIWikiPage $diWikiPage
  *
  * @return string
  */
 public static function encodePage(DIWikiPage $diWikiPage)
 {
     $localName = '';
     if ($diWikiPage->getInterwiki() !== '') {
         $localName = $diWikiPage->getInterwiki() . ':';
     }
     if ($diWikiPage->getNamespace() !== 0) {
         $localName .= str_replace(' ', '_', $GLOBALS['wgContLang']->getNSText($diWikiPage->getNamespace())) . ':' . $diWikiPage->getDBkey();
     } else {
         $localName .= $diWikiPage->getDBkey();
     }
     return self::encodeUri(wfUrlencode($localName));
 }
开发者ID:WolfgangFahl,项目名称:SemanticMediaWiki,代码行数:20,代码来源:Escaper.php

示例13: verifyEncodingFor

 /**
  * Internal helper that actually run the test.
  * Called by the public methods testEncodingUrlWith...()
  *
  */
 private function verifyEncodingFor($server, $input, $expectations)
 {
     $expected = $this->extractExpect($server, $expectations);
     // save up global
     $old = isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : null;
     $_SERVER['SERVER_SOFTWARE'] = $server;
     wfUrlencode(null);
     // do the requested test
     $this->assertEquals($expected, wfUrlencode($input), "Encoding '{$input}' for server '{$server}' should be '{$expected}'");
     // restore global
     if ($old === null) {
         unset($_SERVER['SERVER_SOFTWARE']);
     } else {
         $_SERVER['SERVER_SOFTWARE'] = $old;
     }
     wfUrlencode(null);
 }
开发者ID:ptoomey3,项目名称:mediawiki,代码行数:22,代码来源:wfUrlencodeTest.php

示例14: wfElggNotifyCurlUpdate

/**
 * wfElggNotifyCurlUpdate 
 * 
 * @param object $article 
 * @param object $user 
 * @param bool $isMinor 
 * @param bool $isWatch 
 * @return bool
 */
function wfElggNotifyCurlUpdate($article, $user, $text, $summary, $isMinor, $isWatch, $section, $flags, $revision)
{
    if ($isMinor) {
        $editStatus = 'minor';
    } else {
        $editStatus = 'major';
    }
    $title = $article->getTitle();
    $page = wfUrlencode($title->getPrefixedDBkey());
    $username = $user->mName;
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, ELGG_URL . "mod/mediawiki/edit_notify.php");
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "page={$page}&mediawiki_username={$username}&edit_status={$editStatus}");
    curl_exec($ch);
    curl_close($ch);
    return true;
}
开发者ID:surevine-elgg,项目名称:mediawiki,代码行数:27,代码来源:elgg_notify.php

示例15: getPageUrl

 /**
  * Returns the (partial) URL for the given page (including any section identifier).
  *
  * @param TitleValue $page The link's target
  * @param array $params any additional URL parameters.
  *
  * @return string
  */
 public function getPageUrl(TitleValue $page, $params = array())
 {
     //TODO: move the code from Linker::linkUrl here!
     //The below is just a rough estimation!
     $name = $this->formatter->getPrefixedText($page);
     $name = str_replace(' ', '_', $name);
     $name = wfUrlencode($name);
     $url = $this->baseUrl . $name;
     if ($params) {
         $separator = strpos($url, '?') ? '&' : '?';
         $url .= $separator . wfArrayToCgi($params);
     }
     $fragment = $page->getFragment();
     if ($fragment !== '') {
         $url = $url . '#' . wfUrlencode($fragment);
     }
     return $url;
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:26,代码来源:MediaWikiPageLinkRenderer.php


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