本文整理汇总了PHP中wfLoadExtensionMessages函数的典型用法代码示例。如果您正苦于以下问题:PHP wfLoadExtensionMessages函数的具体用法?PHP wfLoadExtensionMessages怎么用?PHP wfLoadExtensionMessages使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wfLoadExtensionMessages函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: execute
function execute($par)
{
global $wgRequest, $wgUser, $wgOut;
wfLoadExtensionMessages('OpenID');
$this->setHeaders();
if ($wgUser->getID() == 0) {
$wgOut->showErrorPage('openiderror', 'notloggedin');
return;
}
$this->outputHeader();
switch ($par) {
case 'Finish':
$this->finish();
break;
case 'Delete':
$this->delete();
break;
default:
$openid_url = $wgRequest->getText('openid_url');
if (isset($openid_url) && strlen($openid_url) > 0) {
$this->convert($openid_url);
} else {
$this->form();
}
}
}
开发者ID:ErdemA,项目名称:wikihow,代码行数:26,代码来源:SpecialOpenIDConvert.body.php
示例2: loadMessages
public static function loadMessages()
{
global $wgVersion;
if (version_compare($wgVersion, '1.16', '<')) {
wfLoadExtensionMessages('DataTransfer');
}
}
开发者ID:seedbank,项目名称:old-repo,代码行数:7,代码来源:DT_Utils.php
示例3: wfNewuserlogHook
function wfNewuserlogHook($user = null, $byEmail = false)
{
global $wgUser, $wgContLang, $wgVersion;
wfLoadExtensionMessages('Newuserlog');
if (is_null($user)) {
// Compatibility with old versions which didn't pass the parameter
$user = $wgUser;
}
$talk = $wgContLang->getFormattedNsText(NS_TALK);
$contribs = wfMsgForContent('contribslink');
$block = wfMsgForContent('blocklink');
if ($user->getName() == $wgUser->getName()) {
$message = '';
$action = 'create';
} else {
// Links not necessary for self-creations, they will appear already in
// recentchanges and special:log view for the creating user.
// For compatability: From 1.10alpha the 'user tools' are used at special:log
// see bug 4756: Long usernames break block link in new user log entries
$action = 'create2';
$message = '';
if (version_compare($wgVersion, '1.10alpha', '>=')) {
if ($byEmail) {
$message = wfMsgForContent('newuserlog-byemail');
}
} else {
$message = wfMsgForContent('newuserlog-create-text', $user->getName(), $talk, $contribs, $block);
}
}
$log = new LogPage('newusers');
$log->addEntry($action, $user->getUserPage(), $message, array($user->getId()));
return true;
}
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:33,代码来源:Newuserlog.php
示例4: execute
function execute($subpage = '')
{
global $wgOut, $wgRequest;
wfLoadExtensionMessages('EditMessages');
if ($wgUser->isBlocked()) {
$wgOut->blockedPage();
return;
}
if (wfReadOnly()) {
$wgOut->readOnlyPage();
return;
}
if (!$wgUser->isAllowed('siteadmin')) {
$this->displayRestrictionError();
return;
}
$this->setHeaders();
$messageName = $wgRequest->getVal('messageName');
if ($wgRequest->getVal('editmsg_search')) {
$this->showEditForm($messageName);
} elseif ($wgRequest->getVal('editmsg_get_patch')) {
$this->generatePatch();
} elseif ($wgRequest->getVal('editmsg_apply_patch')) {
$this->applyPatch();
} else {
$this->showSearchForm($messageName);
}
}
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:28,代码来源:EditMessages_body.php
示例5: execute
/**
* main()
*/
public function execute($par)
{
global $wgRequest, $wgOut, $wgContLang;
wfLoadExtensionMessages('Editcount');
$target = isset($par) ? $par : $wgRequest->getText('username');
list($username, $namespace) = $this->extractParamaters($target);
$username = Title::newFromText($username);
$username = is_object($username) ? $username->getText() : '';
$uid = User::idFromName($username);
if ($this->including()) {
if ($namespace === null) {
if ($uid != 0) {
$out = $wgContLang->formatNum(User::edits($uid));
} else {
$out = "";
}
} else {
$out = $wgContLang->formatNum($this->editsInNs($uid, $namespace));
}
$wgOut->addHTML($out);
} else {
if ($uid != 0) {
$total = $this->getTotal($nscount = $this->editsByNs($uid));
}
$html = new EditcountHTML();
$html->outputHTML($username, $uid, @$nscount, @$total);
}
}
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:31,代码来源:SpecialEditcount_body.php
示例6: execute
function execute($par)
{
global $wgRequest, $wgUser, $wgLanguageCode, $wgContLang, $wgOut;
wfLoadExtensionMessages('GPlusLogin');
//disconnecting?
if ($wgRequest->getVal('disconnect')) {
self::userDisco();
return;
}
//returning to the community dashboard
$this->returnto = $wgLanguageCode == 'en' ? wfMsg('gpl_returnto') : "/" . $wgContLang->getNSText(NS_PROJECT) . ":" . wfMsg('communityportal');
//set that user (if we can)
$this->userid = $wgRequest->getVal('gplus_id') ? $wgRequest->getVal('gplus_id') : $wgRequest->getVal('user_id');
if ($this->userid) {
$this->setWgUser();
}
if ($wgRequest->wasPosted() && $wgRequest->getVal('gplus_id')) {
self::processForm();
return;
}
//get user's G+ info
$gp_id = $wgRequest->getVal('user_id');
$gp_name = $wgRequest->getVal('user_name');
$gp_email = $wgRequest->getVal('user_email');
$gp_avatar = $wgRequest->getVal('user_avatar');
self::showForm($gp_id, $gp_name, $gp_email, $gp_avatar);
}
开发者ID:ErdemA,项目名称:wikihow,代码行数:27,代码来源:GPlusLogin.body.php
示例7: __construct
public function __construct()
{
// Initialize special page
parent::__construct('Drafts');
// Internationalization
wfLoadExtensionMessages('Drafts');
}
开发者ID:biribogos,项目名称:wikihow-src,代码行数:7,代码来源:Drafts.pages.php
示例8: parserFunction
public static function parserFunction($parser, $vid = null, $img = null)
{
global $wgTitle, $wgContLang;
wfLoadExtensionMessages('WHVid');
if ($vid === null || $img === null) {
return '<div class="errorbox">' . wfMsg('missing-params') . '</div>';
}
$vid = htmlspecialchars($vid);
$divId = "whvid-" . md5($vid . mt_rand(1, 1000));
$vidUrl = self::getVidUrl($vid);
$imgTitle = Title::newFromURL($img, NS_IMAGE);
$imgUrl = null;
if ($imgTitle) {
$imgFile = RepoGroup::singleton()->findFile($imgTitle);
$smallImgUrl = '';
$largeImgUrl = '';
if ($imgFile) {
$width = 550;
$height = 309;
$thumb = $imgFile->getThumbnail($width, $height);
$largeImgUrl = wfGetPad($thumb->getUrl());
$width = 240;
//$height = 135;
$thumb = $imgFile->getThumbnail($width);
$smallImgUrl = wfGetPad($thumb->getUrl());
}
}
return $parser->insertStripItem(wfMsgForContent('embed-html', $divId, $vidUrl, $largeImgUrl, $smallImgUrl));
}
开发者ID:ErdemA,项目名称:wikihow,代码行数:29,代码来源:WHVid.body.php
示例9: wfEmbedVideoParserFunction
function wfEmbedVideoParserFunction($parser, $service = null, $id = null, $width = null)
{
global $wgTitle;
if ($service === null || $id === null) {
return '<div class="errorbox">' . wfMsg('embedvideo-missing-params') . '</div>';
}
wfLoadExtensionMessages('EmbedVideo');
$params = array('service' => trim($service), 'id' => trim($id), 'width' => $width === null ? null : trim($width));
global $wgEmbedVideoMinWidth, $wgEmbedVideoMaxWidth;
if (!is_numeric($wgEmbedVideoMinWidth) || $wgEmbedVideoMinWidth < 100) {
$wgEmbedVideoMinWidth = 100;
}
if (!is_numeric($wgEmbedVideoMaxWidth) || $wgEmbedVideoMaxWidth > 1024) {
$wgEmbedVideoMaxWidth = 1024;
}
global $wgEmbedVideoServiceList;
$service = $wgEmbedVideoServiceList[$params['service']];
if (!$service) {
return '<div class="errorbox">' . wfMsg('embedvideo-unrecognized-service', @htmlspecialchars($params['service'])) . '</div>';
}
$id = htmlspecialchars($params['id']);
$idpattern = isset($service['id_pattern']) ? $service['id_pattern'] : '%[^A-Za-z0-9_\\-]%';
#echo wfBacktrace(); print_r($params); echo $id; exit;
if ($id == null || $idpattern != '' && preg_match($idpattern, $id)) {
return '<div class="errorbox">' . wfMsgForContent('embedvideo-bad-id', $id, @htmlspecialchars($params['service'])) . '</div>';
}
# Build URL and output embedded flash object
$ratio = 425 / 350;
$width = 425;
if ($params['width'] !== null) {
if (!is_numeric($params['width']) || $params['width'] < $wgEmbedVideoMinWidth || $params['width'] > $wgEmbedVideoMaxWidth) {
return '<div class="errorbox">' . wfMsgForContent('embedvideo-illegal-width', @htmlspecialchars($params['width'])) . '</div>';
}
$width = $params['width'];
}
$height = round($width / $ratio);
$url = wfMsgReplaceArgs($service['url'], array($id, $width, $height));
if ($params['service'] == 'videojug') {
return $parser->insertStripItem(wfMsgForContent('embedvideo-embed-clause-videojug', $url, $width, $height));
} else {
if ($params['service'] == 'popcorn') {
return $parser->insertStripItem(wfMsgForContent('embedvideo-embed-clause-popcorn', $url, $width, $height));
} else {
if ($params['service'] == 'wonderhowto') {
$id = str_replace("&61;", "=", htmlspecialchars_decode($id));
// youtube now requires a ? after the http://www.youtube.com/v/[^?&]+). If you use
// an ampersand things will autoplay. Very bad!
$id = preg_replace("@(http://www.youtube.com/v/[^?&]+)(&)autoplay=@", "\$1?", $id);
return $parser->insertStripItem($id);
} else {
if ($params['service'] == 'howcast') {
return $parser->insertStripItem(wfMsgForContent('embedvideo-embed-clause-howcast', $url, $width, $height));
} else {
return $parser->insertStripItem(wfMsgForContent('embedvideo-embed-clause', $url, $width, $height));
}
}
}
}
#return wfMsgForContent('embedvideo-embed-clause', $url, $width, $height);
}
开发者ID:ErdemA,项目名称:wikihow,代码行数:60,代码来源:EmbedVideo.php
示例10: getTopLevelCategories
function getTopLevelCategories()
{
global $wgCategoriesArticle;
wfLoadExtensionMessages('Sitemap');
$results = array();
$revision = Revision::newFromTitle(Title::newFromText(wfMsg('categories_article')));
if (!$revision) {
return $results;
}
// INTL: If there is a redirect to a localized page name, follow it
if (strpos($revision->getText(), "#REDIRECT") !== false) {
$revision = Revision::newFromTitle(Title::newFromRedirect($revision->getText()));
}
$lines = split("\n", $revision->getText());
foreach ($lines as $line) {
if (preg_match('/^\\*[^\\*]/', $line)) {
$line = trim(substr($line, 1));
switch ($line) {
case "Other":
case "wikiHow":
break;
default:
$results[] = $line;
}
}
}
return $results;
}
开发者ID:ErdemA,项目名称:wikihow,代码行数:28,代码来源:Sitemap.body.php
示例11: DSMWGeneralExhibits
function DSMWGeneralExhibits()
{
if (defined('SRF_VERSION')) {
SpecialPage::SpecialPage('DSMWGeneralExhibits');
}
wfLoadExtensionMessages('DSMW');
}
开发者ID:hala54,项目名称:DSMW,代码行数:7,代码来源:DSMWGeneralExhibits.php
示例12: wfSpecialCiteToolbox
function wfSpecialCiteToolbox(&$monobook)
{
wfLoadExtensionMessages('SpecialCite');
if (isset($monobook->data['nav_urls']['cite'])) {
if ($monobook->data['nav_urls']['cite']['href'] == '') {
?>
<li id="t-iscite"><?php
echo $monobook->msg('cite_article_link');
?>
</li><?php
} else {
?>
<li id="t-cite"><?php
?>
<a href="<?php
echo htmlspecialchars($monobook->data['nav_urls']['cite']['href']);
?>
"><?php
echo $monobook->msg('cite_article_link');
?>
</a><?php
?>
</li><?php
}
}
return true;
}
开发者ID:ErdemA,项目名称:wikihow,代码行数:27,代码来源:SpecialCite.php
示例13: execute
/**
* Main execution function
* @param $par Parameters passed to the page
*/
function execute($par)
{
global $wgOut, $wgUser;
wfLoadExtensionMessages('Gadgets');
$skin = $wgUser->getSkin();
$this->setHeaders();
$wgOut->setPagetitle(wfMsg("gadgets-title"));
$wgOut->addWikiText(wfMsg("gadgets-pagetext"));
$gadgets = wfLoadGadgetsStructured();
if (!$gadgets) {
return;
}
$listOpen = false;
$msgOpt = array('parseinline', 'parsemag');
foreach ($gadgets as $section => $entries) {
if ($section !== false && $section !== '') {
$t = Title::makeTitleSafe(NS_MEDIAWIKI, "Gadget-section-{$section}");
$lnk = $t ? $skin->makeLinkObj($t, wfMsgHTML("edit")) : htmlspecialchars($section);
$ttext = wfMsgExt("gadget-section-{$section}", $msgOpt);
if ($listOpen) {
$wgOut->addHTML('</ul>');
$listOpen = false;
}
$wgOut->addHTML("\n<h2>{$ttext} [{$lnk}]</h2>\n");
}
foreach ($entries as $gname => $code) {
$t = Title::makeTitleSafe(NS_MEDIAWIKI, "Gadget-{$gname}");
if (!$t) {
continue;
}
$lnk = $skin->makeLinkObj($t, wfMsgHTML("edit"));
$ttext = wfMsgExt("gadget-{$gname}", $msgOpt);
if (!$listOpen) {
$listOpen = true;
$wgOut->addHTML('<ul>');
}
$wgOut->addHTML("<li>");
$wgOut->addHTML("{$ttext} [{$lnk}]<br/>");
$wgOut->addHTML(wfMsgHTML("gadgets-uses") . ": ");
$first = true;
foreach ($code as $codePage) {
$t = Title::makeTitleSafe(NS_MEDIAWIKI, "Gadget-{$codePage}");
if (!$t) {
continue;
}
if ($first) {
$first = false;
} else {
$wgOut->addHTML(", ");
}
$lnk = $skin->makeLinkObj($t, htmlspecialchars($t->getText()));
$wgOut->addHTML($lnk);
}
$wgOut->addHtml("</li>");
}
}
if ($listOpen) {
$wgOut->addHTML('</ul>');
}
}
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:64,代码来源:SpecialGadgets.php
示例14: wfNewuserlogAutoCreate
function wfNewuserlogAutoCreate($user)
{
wfLoadExtensionMessages('Newuserlog');
$log = new LogPage('newusers');
$log->addEntry('autocreate', $user->getUserPage(), '', array($user->getId()));
return true;
}
开发者ID:ErdemA,项目名称:wikihow,代码行数:7,代码来源:Newuserlog.php
示例15: processLogoutRequest
function processLogoutRequest()
{
global $wgUser;
$wgUser->logout();
wfLoadExtensionMessages('AjaxLogin');
return new AjaxResponse(wfMsg('ajaxlogin-nowloggedout'));
}
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:7,代码来源:AjaxLogin.body.php
示例16: execute
function execute($par)
{
global $wgOut, $wgRequest, $wgUseTidy;
wfLoadExtensionMessages('SpecialCite');
// Having tidy on causes whitespace and <pre> tags to
// be generated around the output of the CiteOutput
// class TODO FIXME.
$wgUseTidy = false;
$this->setHeaders();
$this->outputHeader();
$page = isset($par) ? $par : $wgRequest->getText('page');
$id = $wgRequest->getInt('id');
$title = Title::newFromText($page);
if ($title) {
$article = new Article($title);
}
$cform = new CiteForm($title);
if (!$title || !$article->exists()) {
$cform->execute();
} else {
$cform->execute();
$cout = new CiteOutput($title, $article, $id);
$cout->execute();
}
}
开发者ID:ui-libraries,项目名称:TIRW,代码行数:25,代码来源:SpecialCite_body.php
示例17: __construct
function __construct()
{
parent::__construct('Metasearch');
wfLoadExtensionMessages('Metasearch');
#$this->controller = MsController::get_instance();
// (important for global function setup)
}
开发者ID:BackupTheBerlios,项目名称:biokemika-svn,代码行数:7,代码来源:MetaSearch_body.php
示例18: sendEmail
function sendEmail(&$u, &$content)
{
global $wgServer;
wfLoadExtensionMessages('ThumbsEmailNotifications');
$email = $u->getEmail();
$userText = $u->getName();
$semi_rand = md5(time());
$mime_boundary = "==MULTIPART_BOUNDARY_{$semi_rand}";
$mime_boundary_header = chr(34) . $mime_boundary . chr(34);
$userPageLink = self::getUserPageLink($userText);
$html_text = wfMsg('tn_email_html', wfGetPad(''), $userPageLink, $content);
$plain_text = wfMsg('tn_email_plain', $userText, $u->getTalkPage()->getFullURL());
$body = "This is a multi-part message in MIME format.\n\n--{$mime_boundary}\nContent-Type: text/plain; charset=us-ascii\nContent-Transfer-Encoding: 7bit\n\n{$plain_text}\n\n--{$mime_boundary}\nContent-Type: text/html; charset=us-ascii\nContent-Transfer-Encoding: 7bit\n\n{$html_text}";
$from = new MailAddress(wfMsg('aen_from'));
$subject = "Congratulations! You just got a thumbs up";
$isDev = false;
if (strpos($_SERVER['HOSTNAME'], "wikidiy.com") !== false || strpos($wgServer, "wikidiy.com") !== false) {
wfDebug("AuthorEmailNotification in dev not notifying: TO: " . $userText . ",FROM: {$from_name}\n");
$isDev = true;
$subject = "[FROM DEV] {$subject}";
}
if (!$isDev) {
$to = new MailAddress($email);
UserMailer::send($to, $from, $subject, $body, null, "multipart/alternative;\n" . " boundary=" . $mime_boundary_header);
}
// send one to our test email account for debugging
/*
$to = new MailAddress ('[email protected]');
UserMailer::send($to, $from, $subject, $body, null, "multipart/alternative;\n" .
" boundary=" . $mime_boundary_header) ;
*/
return true;
}
开发者ID:ErdemA,项目名称:wikihow,代码行数:33,代码来源:ThumbsEmailNotifications.body.php
示例19: getResultText
protected function getResultText($res, $outputmode)
{
$result = '';
if ($outputmode == SMW_OUTPUT_FILE) {
// make CSV file
$result .= parent::getResultText($res, $outputmode);
} else {
// just make link to feed
if ($this->getSearchLabel($outputmode)) {
$label = $this->getSearchLabel($outputmode);
} else {
wfLoadExtensionMessages('SemanticMediaWiki');
$label = wfMsgForContent('smw_csv_link');
}
$link = $res->getQueryLink($label);
$link->setParameter('csv', 'format');
$link->setParameter($this->m_sep, 'sep');
if (array_key_exists('limit', $this->m_params)) {
$link->setParameter($this->m_params['limit'], 'limit');
} else {
// use a reasonable default limit
$link->setParameter(100, 'limit');
}
// KK: support merge option
if (array_key_exists('merge', $this->m_params)) {
$link->setParameter($this->m_params['merge'], 'merge');
}
$result .= $link->getText($outputmode, $this->mLinker);
$this->isHTML = $outputmode == SMW_OUTPUT_HTML;
// yes, our code can be viewed as HTML if requested, no more parsing needed
}
return $result;
}
开发者ID:seedbank,项目名称:old-repo,代码行数:33,代码来源:SMW_QP_Halo.php
示例20: personalUrls
public static function personalUrls(&$personal_urls, &$title)
{
global $wgUser, $wgOptInAlwaysShowPersonalLink;
global $wgOptInNeverShowPersonalLink, $wgRequest;
if ($wgOptInNeverShowPersonalLink || !SpecialOptIn::isOptedIn($wgUser) && !$wgOptInAlwaysShowPersonalLink) {
// Don't show the link
return true;
}
// Loads opt-in messages
wfLoadExtensionMessages('OptInLink');
$fromquery = array();
if (!$wgRequest->wasPosted()) {
$fromquery = $wgRequest->getValues();
unset($fromquery['title']);
}
$query = array('from' => $title->getPrefixedDBKey(), 'fromquery' => wfArrayToCGI($fromquery));
// Make sure we don't create links that return to
// Special:UsabilityOptIn itself
if ($title->equals(SpecialPage::getTitleFor('OptIn'))) {
$query['from'] = $wgRequest->getVal('from');
$query['fromquery'] = $wgRequest->getVal('fromquery');
}
$addLinks = array();
// For opted-in users, add a feedback link
if (SpecialOptIn::isOptedIn($wgUser)) {
$addLinks['optin-feedback'] = array('text' => wfMsg('optin-feedback'), 'key' => 'optin-feedback', 'href' => SpecialPage::getTitleFor('OptIn')->getFullURL(array_merge($query, array('opt' => 'feedback'))), 'class' => 'no-text-transform');
}
// Inserts a link into personal tools
$key = SpecialOptIn::isOptedIn($wgUser) ? 'optin-leave' : 'optin-try';
$addLinks[$key] = array('text' => wfMsg($key), 'href' => SpecialPage::getTitleFor('OptIn')->getFullURL($query), 'class' => 'no-text-transform');
// Add the links
$personal_urls = array_merge($addLinks, $personal_urls);
return true;
}
开发者ID:BackupTheBerlios,项目名称:swahili-dict,代码行数:34,代码来源:OptIn.hooks.php
注:本文中的wfLoadExtensionMessages函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论