public function getName() { wfProfileIn(__METHOD__); $lap = $this->mBadgeLap; if ($lap != null && $this->mBadgeTypeId != BADGE_LUCKYEDIT) { $virtualType = $this->mBadgeTypeId; if (AchConfig::getInstance()->getBadgeType($virtualType) == BADGE_TYPE_INTRACKEDITPLUSCATEGORY) { $virtualType = BADGE_EDIT; } $inTrackStaticBadges = AchConfig::getInstance()->getInTrackStatic(); $lapsCount = count($inTrackStaticBadges[$virtualType]['laps']); $lap = $lap >= $lapsCount ? --$lapsCount : $lap; } $key = AchConfig::getInstance()->getBadgeNameKey($this->mBadgeTypeId, $lap); if (AchConfig::getInstance()->getBadgeType($this->mBadgeTypeId) == BADGE_TYPE_INTRACKEDITPLUSCATEGORY && isMsgEmpty($key)) { $key = AchConfig::getInstance()->getBadgeNameKey(BADGE_EDIT, $lap); } wfProfileOut(__METHOD__); return wfMsgForContent($key); }
<section class="SalesSupportModule module"> <h2 class="dark_text_2"><?php if (!isMsgEmpty('myhome-community-corner-header')) { echo wfMsg('myhome-community-corner-header'); } ?> </h2> <div id="sales-support-content"><?php echo wfMsgExt('sales-support-corner', array('parse', 'content')); ?> </div> <?php if ($isAdmin) { ?> <div id="sales-support-edit"><a class="more" href="<?php echo Title::newFromText('sales-support-corner', NS_MEDIAWIKI)->getLocalURL('action=edit'); ?> " rel="nofollow"><?php echo wfMsg('corportaepage-sales-support-edit'); ?> </a></div> <?php } ?> </section>
private function awardNotInTrackBadge($badge_type_id, $badge_lap = null) { wfProfileIn(__METHOD__); global $wgRequest; // can be platinum or static $notInTrackStatic = AchConfig::getInstance()->getNotInTrackStatic(); if (isset($notInTrackStatic[$badge_type_id])) { $badge_level = $notInTrackStatic[$badge_type_id]['level']; } else { $badge_level = BADGE_LEVEL_PLATINUM; } $this->mNewBadges[] = array('badge_type_id' => $badge_type_id, 'badge_lap' => $badge_lap, 'badge_level' => $badge_level); if (!isset($this->mBadges[$badge_type_id])) { $this->mBadges[$badge_type_id] = 0; } $this->mBadges[$badge_type_id]++; if ($badge_type_id == BADGE_WELCOME) { if (!isMsgEmpty('welcome-user-page')) { $userPageTitle = $this->mUser->getUserPage(); if ($userPageTitle) { $userPageArticle = new Article($userPageTitle, 0); if (!$userPageArticle->exists()) { $userWikia = User::newFromName('Wikia'); //#60032: forcing IP for bot since this code is run in a real user session and not from a maintenance script $origIP = $wgRequest->getIP(); $wgRequest->setIP('127.0.0.1'); //fixme. following functionality is done by HAWelcome extension... $userPageArticle->doEdit(wfMsgForContentNoTrans('welcome-user-page', $userPageTitle->getText()), '', $userWikia->isAllowed('bot') ? EDIT_FORCE_BOT : 0, false, $userWikia); //restore original IP from user session $wgRequest->setIP($origIP); } } } } wfProfileOut(__METHOD__); }