本文整理汇总了PHP中Skin::makeSpecialUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Skin::makeSpecialUrl方法的具体用法?PHP Skin::makeSpecialUrl怎么用?PHP Skin::makeSpecialUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skin
的用法示例。
在下文中一共展示了Skin::makeSpecialUrl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBadgesData
private function getBadgesData() {
global $wgContLang;
// get achievement lists
$rankingService = new AchRankingService();
$userProfileService = new AchUserProfileService();
$userProfileService->getHTML(); // have to call this because it creates our data as a side effect
$this->ownerName = $userProfileService->mUserOwner->getName();
$this->ownerBadges = $userProfileService->mOwnerBadgesSimple;
$this->ownerCounters = $userProfileService->mOwnerCounters;
$this->ownerRank = $rankingService->getUserRankingPosition($userProfileService->mUserOwner);
$this->ownerScore = $wgContLang->formatNum($rankingService->getUserScore($userProfileService->mUserOwner->getId()));
if($userProfileService->mUserViewer && $userProfileService->mUserViewer->isLoggedIn() && $userProfileService->mUserViewer->getId() == $userProfileService->mUserOwner->getId()) {
$this->viewer_is_owner = true;
$challengesBadges = $userProfileService->mChallengesBadges;
// Let's prune the challengesBadges list to the correct length before passing it to the template
if ($this->max_challenges != "all") {
while (count($challengesBadges) > $this->max_challenges) array_pop($challengesBadges);
}
$this->challengesBadges = $challengesBadges;
}
// UI elements
$this->leaderboard_url = Skin::makeSpecialUrl("Leaderboard");
if($userProfileService->mUserViewer && $userProfileService->mUserViewer->isAllowed('editinterface')) {
$this->customize_url = Skin::makeSpecialUrl("AchievementsCustomize");
}
}
示例2: setupPersonalUrls
/**
* Modify personal URLs list
*/
private function setupPersonalUrls()
{
global $wgUser;
// Import the starting set of urls from the skin template
$this->personal_urls = F::app()->getSkinTemplateObj()->data['personal_urls'];
if ($wgUser->isAnon()) {
// add login and register links for anons
//$skin = RequestContext::getMain()->getSkin();
// where to redirect after login
$query = F::app()->wg->Request->getValues();
if (isset($query['title'])) {
if (!self::isBlacklisted($query['title'])) {
$returnto = $query['title'];
} else {
$returnto = Title::newMainPage()->getPartialURL();
}
} else {
$returnto = Title::newMainPage()->getPartialURL();
}
$returnto = wfGetReturntoParam($returnto);
$this->personal_urls['login'] = array('text' => wfMsg('login'), 'href' => Skin::makeSpecialUrl('UserLogin', $returnto), 'class' => 'ajaxLogin', 'afterText' => Xml::element('img', array('src' => $this->wg->BlankImgUrl, 'class' => 'chevron', 'width' => '0', 'height' => '0'), ''));
$this->personal_urls['register'] = array('text' => wfMsg('oasis-signup'), 'href' => Skin::makeSpecialUrl('UserSignup'), 'class' => 'ajaxRegister');
} else {
// use Mypage message for userpage entry
$this->personal_urls['userpage']['text'] = wfMsg('mypage');
}
}
示例3: getUsersData
private function getUsersData($usersObjects)
{
$key = 0;
$usersInvolved = array();
$sorting = array();
foreach ($usersObjects as $user) {
if ($user->isAnon()) {
$name = wfMsg('oasis-anon-user');
}
$username = $user->getName();
$userpage = $user->getUserPage()->getFullUrl();
$usersInvolved[$key]['userpage'] = $userpage;
if (empty($name)) {
$usersInvolved[$key]['name1'] = $username;
$sorting[$key] = $username;
} else {
$usersInvolved[$key]['name1'] = $name;
$usersInvolved[$key]['name2'] = $username;
// if user has real name and is not an anon use the real name
// if he's an anon use username
$sorting[$key] = $user->isAnon() ? $username : $name;
}
$usersInvolved[$key]['username'] = $username;
$usersInvolved[$key]['userpage'] = $userpage;
$usersInvolved[$key]['userwall'] = Title::newFromText($username, NS_USER_WALL)->getFullUrl();
$usersInvolved[$key]['usertalk'] = Title::newFromText($username, NS_USER_TALK)->getFullUrl();
$usersInvolved[$key]['usercontribs'] = Skin::makeSpecialUrl('Contributions') . '/' . $username;
$usersInvolved[$key]['userblock'] = Skin::makeSpecialUrl('Block') . '/' . $username;
$key++;
}
$sorting = array_map('mb_strtolower', $sorting);
array_multisort($sorting, SORT_ASC, SORT_STRING, $usersInvolved);
return $usersInvolved;
}
示例4: getHTML
public function getHTML()
{
wfProfileIn(__METHOD__);
if ($this->isVisible()) {
$ownerName = $this->ownerUser->getName();
$tmplData = array();
$tmplData['ownerBadges'] = $this->getBadgesAnnotated();
$tmplData['challengesBadges'] = $this->getChallengesAnnotated();
$tmplData['title_no'] = wfMsg('achievements-profile-title-no', $ownerName);
$tmplData['title'] = wfMsgExt('achievements-profile-title', array('parsemag'), $ownerName, $this->owner->getBadgesCount());
$tmplData['title_challenges'] = wfMsg('achievements-profile-title-challenges', $ownerName);
$tmplData['leaderboard_url'] = Skin::makeSpecialUrl("Leaderboard");
if ($this->owner->getBadgesCount() > 0) {
$rankingService = new AchRankingService();
$tmplData['user_rank'] = $rankingService->getUserRankingPosition($this->ownerUser);
}
if ($this->viewerUser->isAllowed('editinterface')) {
$tmplData['customize_url'] = Skin::makeSpecialUrl("AchievementsCustomize");
}
$template = new EasyTemplate(dirname(__FILE__) . '/../templates');
$template->set_vars($tmplData);
$out = $template->render('ProfileBox');
} else {
$out = '';
}
wfProfileOut(__METHOD__);
return $out;
}
示例5: PeerReview_AddActionContentHook2
function PeerReview_AddActionContentHook2($skin, &$links)
{
global $wgTitle;
if ($wgTitle->getNamespace() != NS_SPECIAL) {
$links['actions']['ownership'] = array('class' => false, 'text' => "Ownership", 'href' => Skin::makeSpecialUrl('PageOwner') . "/" . $skin->mTitle->getEscapedText());
}
return true;
}
示例6: wfSudoPersonalUrls
function wfSudoPersonalUrls( &$personal_urls, &$wgTitle ) {
// Replace logout link with a unsudo link while in a sudo login.
if( isset( $_SESSION['wsSudoId'] ) && $_SESSION['wsSudoId'] > 0 ) {
$personal_urls['logout'] = array(
'text' => wfMsg( 'sudo-personal-unsudo' ),
'href' => Skin::makeSpecialUrl( 'Sudo', 'mode=unsudo' ),
'active' => false
);
}
return true;
}
示例7: renderNewpage
function renderNewpage($input, $argv, &$parser)
{
# $argv is an array containing any arguments passed to the
# extension like <example argument="foo" bar>..
# Put this on the sandbox page: (works in MediaWiki 1.5.5)
# <example argument="foo" argument2="bar">Testing text **example** in between the new tags</example>
$saneinput = empty($argv['emptysearchbox']) ? $parser->getTitle()->getText() : '';
$action = Skin::makeSpecialUrl('NewWebsite');
$header = wfMsgExt('newmark-header', array('parseinline'));
$submit = wfMsg('newmark-submit');
$output = "<p />\n\t\t<form action=\"{$action}\" method=\"get\">\n\t\t{$header}\n\t\t<input type=\"text\" name=\"param\" size=\"40\" maxlength=\"80\" value=\"{$saneinput}\" />\n\t\t<input type=\"submit\" value=\"{$submit}\" />\n\t\t</form><p />";
return $output;
}
示例8: MakeGlobalVariablesScript
/**
* Adds several Facebook Connect variables to the page:
*
* fbAppId - Wikia's App ID
* fbScript
* fbLogo
* fbLogoutURL - (deprecated) The URL to be redirected to on a disconnect
* fbReturnToTitle
* fbScriptLangCode
*
*/
public static function MakeGlobalVariablesScript(&$vars)
{
global $fbScript, $fbAppId, $fbLogo;
$wg = F::app()->wg;
$thisurl = $wg->Title->getPrefixedURL();
$vars['fbAppId'] = $fbAppId;
$vars['fbScript'] = $fbScript;
$vars['fbLogo'] = (bool) $fbLogo;
$vars['fbLogoutURL'] = Skin::makeSpecialUrl('Userlogout', $wg->Title->isSpecial('Preferences') ? '' : "returnto={$thisurl}");
$vals = $wg->Request->getValues();
if (!empty($vals['title'])) {
$vars['fbReturnToTitle'] = $vals['title'];
}
// macbre: needed for channelUrl
$vars['fbScriptLangCode'] = FacebookClientLocale::getLocale();
$vars['wgEnableFacebookClientExt'] = F::app()->wg->EnableFacebookClientExt;
return true;
}
示例9: WidgetCommunity
function WidgetCommunity($id, $params)
{
global $wgEnableCommunityWidget, $wgTitle;
if (empty($wgEnableCommunityWidget)) {
return '';
}
if ($params['skinname'] != 'oasis') {
return '';
}
if (!class_exists('ActivityFeedHelper')) {
return '';
}
wfProfileIn(__METHOD__);
global $wgUser, $wgLang, $wgLanguageCode, $wgStylePath, $wgEnableMyHomeExt, $wgContentNamespaces;
$total = SiteStats::articles();
/* RT#64490: Strange Article Count in Latest Activity on some new wikis */
if ($total < 0 || $total > 1.0E+18) {
$total = 0;
}
$total = $wgLang->formatNum($total);
$footerButton = array();
if (!empty($wgEnableMyHomeExt)) {
$footerButton['text'] = wfMsg('widget-community-more');
$footerButton['href'] = Skin::makeSpecialUrl($wgUser->isLoggedIn() ? 'MyHome' : 'ActivityFeed');
$footerButton['class'] = 'wikia-button forward';
} else {
$footerButton['text'] = wfMsg('recentchanges');
$footerButton['href'] = Skin::makeSpecialUrl('RecentChanges');
$footerButton['class'] = 'wikia-button forward';
}
$maxElements = 5;
$includeNamespaces = implode('|', $wgContentNamespaces);
$uselang = $wgLang->getCode();
//this should be the same as in /extensions/wikia/MyHome/ActivityFeedHelper.php
$parameters = array('type' => 'widget', 'tagid' => $id, 'maxElements' => $maxElements, 'flags' => array('shortlist'), 'uselang' => $uselang, 'includeNamespaces' => $includeNamespaces);
$userLangEqContent = $uselang == $wgLanguageCode;
$feedHTML = ActivityFeedHelper::getListForWidget($parameters, $userLangEqContent);
// template stuff
$tmpl = new EasyTemplate(dirname(__FILE__));
$tmpl->set_vars(array('tagid' => $id, 'timestamp' => wfTimestampNow(), 'header' => wfMsg('monaco-articles-on', $total), 'feedHTML' => $feedHTML, 'footerButton' => $footerButton));
$output = $tmpl->render('WidgetCommunity');
wfProfileOut(__METHOD__);
return $output;
}
示例10: generateReadHtml
public function generateReadHtml()
{
$config = $this->campaign->getParsedConfig();
$campaignTitle = array_key_exists('title', $config) ? $config['title'] : $this->campaign->getName();
$campaignDescription = array_key_exists('description', $config) ? $config['description'] : '';
$campaignViewMoreLink = $this->campaign->getTrackingCategory()->getFullURL();
$gallery = ImageGalleryBase::factory('packed-hover');
$gallery->setContext($this->context);
$gallery->setWidths(180);
$gallery->setHeights(180);
$gallery->setShowBytes(false);
$this->context->getOutput()->setSquidMaxage(UploadWizardConfig::getSetting('campaignSquidMaxAge'));
$this->context->getOutput()->setHTMLTitle($this->context->msg('pagetitle', $campaignTitle));
$images = $this->campaign->getUploadedMedia();
if ($this->context->getUser()->isAnon()) {
$urlParams = array('returnto' => $this->campaign->getTitle()->getPrefixedText());
if ($this->isCampaignExtensionEnabled()) {
$campaignTemplate = UploadWizardConfig::getSetting('campaignCTACampaignTemplate');
$urlParams['campaign'] = str_replace('$1', $this->campaign->getName(), $campaignTemplate);
}
$createAccountUrl = Skin::makeSpecialUrlSubpage('UserLogin', 'signup', $urlParams);
$uploadLink = Html::element('a', array('class' => 'mw-ui-big mw-ui-button mw-ui-primary', 'href' => $createAccountUrl), wfMessage('mwe-upwiz-campaign-create-account-button')->text());
} else {
$uploadUrl = Skin::makeSpecialUrl('UploadWizard', array('campaign' => $this->campaign->getName()));
$uploadLink = Html::element('a', array('class' => 'mw-ui-big mw-ui-button mw-ui-primary', 'href' => $uploadUrl), wfMessage('mwe-upwiz-campaign-upload-button')->text());
}
if (count($images) === 0) {
$body = Html::element('div', array('id' => 'mw-campaign-no-uploads-yet'), wfMessage('mwe-upwiz-campaign-no-uploads-yet')->plain());
} else {
foreach ($images as $image) {
$gallery->add($image);
}
$body = Html::rawElement('div', array('id' => 'mw-campaign-images'), $gallery->toHTML()) . Html::rawElement('a', array('id' => 'mw-campaign-view-all', 'href' => $campaignViewMoreLink), Html::rawElement('span', array('class' => 'mw-campaign-chevron mw-campaign-float-left'), ' ') . wfMessage('mwe-upwiz-campaign-view-all-media')->escaped() . Html::rawElement('span', array('class' => 'mw-campaign-chevron mw-campaign-float-right'), ' '));
}
if (UploadWizardConfig::getSetting('campaignExpensiveStatsEnabled') === true) {
$uploaderCount = $this->campaign->getTotalContributorsCount();
$campaignExpensiveStats = Html::rawElement('div', array('class' => 'mw-campaign-number-container'), Html::element('div', array('class' => 'mw-campaign-number'), $this->context->getLanguage()->formatNum($uploaderCount)) . Html::element('span', array('class' => 'mw-campaign-number-desc'), wfMessage('mwe-upwiz-campaign-contributors-count-desc')->numParams($uploaderCount)->text()));
} else {
$campaignExpensiveStats = '';
}
$uploadCount = $this->campaign->getUploadedMediaCount();
$result = Html::rawElement('div', array('id' => 'mw-campaign-container'), Html::rawElement('div', array('id' => 'mw-campaign-header'), Html::rawElement('div', array('id' => 'mw-campaign-primary-info'), Html::rawElement('p', array('id' => 'mw-campaign-title'), $campaignTitle) . Html::rawElement('p', array('id' => 'mw-campaign-description'), $campaignDescription) . $uploadLink) . Html::rawElement('div', array('id' => 'mw-campaign-numbers'), $campaignExpensiveStats . Html::rawElement('div', array('class' => 'mw-campaign-number-container'), Html::element('div', array('class' => 'mw-campaign-number'), $this->context->getLanguage()->formatNum($uploadCount)) . Html::element('span', array('class' => 'mw-campaign-number-desc'), wfMessage('mwe-upwiz-campaign-media-count-desc')->numParams($uploadCount)->text())))) . $body);
return $result;
}
示例11: setupPersonalUrls
/**
* Modify personal URLs list
*/
private function setupPersonalUrls() {
global $wgUser, $wgComboAjaxLogin;
// Import the starting set of urls from the skin template
$this->personal_urls = F::app()->getSkinTemplateObj()->data['personal_urls'];
if ($wgUser->isAnon()) {
// add login and register links for anons
//$skin = RequestContext::getMain()->getSkin();
// where to redirect after login
$returnto = wfGetReturntoParam();
if(empty($wgComboAjaxLogin)) {
$signUpHref = Skin::makeSpecialUrl('UserLogin', $returnto);
} else {
$signUpHref = Skin::makeSpecialUrl('Signup', $returnto);
}
$this->personal_urls['login'] = array(
'text' => wfMsg('login'),
'href' => $signUpHref . "&type=login",
'class' => 'ajaxLogin',
'afterText' => Xml::element('img', array(
'src' => $this->wg->BlankImgUrl,
'class' => 'chevron',
'width' => '0',
'height' => '0',
), ''),
);
$this->personal_urls['register'] = array(
'text' => wfMsg('oasis-signup'),
'href' => $signUpHref . "&type=signup",
'class' => 'ajaxRegister'
);
}
else {
// use Mypage message for userpage entry
$this->personal_urls['userpage']['text'] = wfMsg('mypage');
}
}
示例12: getHTML
public function getHTML()
{
wfProfileIn(__METHOD__);
global $wgTitle, $wgUser;
//fix #10881, get correct username from user namespace subpages
$this->mUserOwner = F::build('User', array(UserPagesHeaderController::getUserName($wgTitle, BodyController::getUserPagesNamespaces())), 'newFromName');
if (in_array(strtolower(RequestContext::getMain()->getSkin()->getSkinName()), array('oasis')) && $this->mUserOwner && AchAwardingService::canEarnBadges($this->mUserOwner) && $this->mUserOwner->isLoggedIn() && !($wgUser->getId() == $this->mUserOwner->getId() && $wgUser->getOption('hidepersonalachievements'))) {
$this->mUserViewer = $wgUser;
if ($this->mUserViewer->isLoggedIn() && $this->mUserViewer->getId() != $this->mUserOwner->getId()) {
$this->loadViewerBadges();
$this->loadViewerCounters();
}
$this->loadOwnerBadges();
$this->loadOwnerCounters();
$this->prepareChallenges();
$tmplData = array();
$tmplData['ownerBadges'] = $this->mOwnerBadgesSimple;
$tmplData['challengesBadges'] = $this->mChallengesBadges;
$tmplData['title_no'] = wfMsg('achievements-profile-title-no', $this->mUserOwner->getName());
$tmplData['title'] = wfMsgExt('achievements-profile-title', array('parsemag'), $this->mUserOwner->getName(), count($this->mOwnerBadgesSimple));
$tmplData['title_challenges'] = wfMsg('achievements-profile-title-challenges', $this->mUserOwner->getName());
$tmplData['leaderboard_url'] = Skin::makeSpecialUrl("Leaderboard");
if (count($this->mOwnerBadgesExtended) > 0) {
$rankingService = new AchRankingService();
$tmplData['user_rank'] = $rankingService->getUserRankingPosition($this->mUserOwner);
}
if ($this->mUserViewer->isAllowed('editinterface')) {
$tmplData['customize_url'] = Skin::makeSpecialUrl("AchievementsCustomize");
}
$template = new EasyTemplate(dirname(__FILE__) . '/../templates');
$template->set_vars($tmplData);
$out = $template->render('ProfileBox');
} else {
$out = '';
}
wfProfileOut(__METHOD__);
return $out;
}
示例13: executeIndex
public function executeIndex()
{
global $wgContLang;
wfProfileIn(__METHOD__);
$userProfileService = new AchUserProfileService();
if (!$userProfileService->isVisible()) {
$this->skipRendering();
wfProfileOut(__METHOD__);
return;
}
// add CSS and JS for this module
$this->response->addAsset('achievements_css');
$this->response->addAsset('achievements_js');
$rankingService = new AchRankingService();
// get achievement lists
$this->ownerName = $userProfileService->getOwnerUser()->getName();
$this->ownerBadgesCount = $userProfileService->getBadgesCount();
$this->ownerBadges = $userProfileService->getBadgesAnnotated(0);
$this->ownerCounters = $userProfileService->getCounters();
$this->ownerRank = $rankingService->getUserRankingPosition($userProfileService->getOwnerUser());
$this->ownerScore = $wgContLang->formatNum($rankingService->getUserScore($userProfileService->getOwnerUser()->getId()));
// if user is viewing their own page
if ($userProfileService->getViewerUser() && !$userProfileService->getViewerUser()->isAnon() && $userProfileService->getViewerUser()->getId() == $userProfileService->getOwnerUser()->getId()) {
$this->viewer_is_owner = true;
$challengesBadges = $userProfileService->getChallengesAnnotated();
// Let's prune the challengesBadges list to the correct length before passing it to the template
if ($this->max_challenges != "all") {
$challengesBadges = array_slice($challengesBadges, 0, $this->max_challenges);
}
$this->challengesBadges = $challengesBadges;
}
// UI elements
$this->leaderboard_url = Skin::makeSpecialUrl("Leaderboard");
if ($userProfileService->getViewerUser() && $userProfileService->getViewerUser()->isAllowed('editinterface')) {
$this->customize_url = Skin::makeSpecialUrl("AchievementsCustomize");
}
wfProfileOut(__METHOD__);
}
示例14: getUrl
/**
* Get URL to user page / Special:Contributions
*/
static function getUrl($userName)
{
wfProfileIn(__METHOD__);
static $linksCache;
$url = '';
if (isset($linksCache[$userName])) {
$url = $linksCache[$userName];
} else {
if (User::isIP($userName)) {
// anon: point to Special:Contributions
$url = Skin::makeSpecialUrl('Contributions') . '/' . $userName;
} else {
// user: point to user page
$userPage = Title::newFromText($userName, NS_USER);
if (!is_null($userPage)) {
$url = $userPage->getLocalUrl();
}
}
$linksCache[$userName] = $url;
}
wfProfileOut(__METHOD__);
return $url;
}
示例15: GetExpertTools
/**
* Return array of links (href, text, id) for expert tools box
* Author: Inez Korczynski (inez at wikia.com)
* @return array
*/
public final function GetExpertTools()
{
wfProfileIn(__METHOD__);
$links = array();
# Create page
$url = Skin::makeSpecialUrl('Createpage');
$text = self::Translate('createpage');
$id = 'createpage';
$links[] = array('url' => $url, 'text' => $text, 'id' => $id);
# Recent changes
$url = SpecialPage::getTitleFor('Recentchanges')->getLocalURL();
$text = self::Translate('recentchanges');
$id = 'recentchanges';
$links[] = array('url' => $url, 'text' => $text, 'id' => $id);
if (!is_null($this->skin) && !empty($this->skin->data['nav_urls'])) {
foreach ($this->skin->data['nav_urls'] as $key => $val) {
if (!empty($val) && $key != 'mainpage' && $key != 'print') {
$links[] = array('url' => $val['href'], 'text' => self::Translate($key), 'id' => $key);
}
}
}
if (!is_null($this->skin) && !empty($this->skin->data['feeds'])) {
foreach ($this->skin->data['feeds'] as $key => $val) {
if (!empty($val) && $key != 'mainpage' && $key != 'print') {
$links[] = array('url' => $val['href'], 'text' => $val['text'], 'id' => $key);
}
}
}
wfProfileOut(__METHOD__);
return $links;
}