本文整理汇总了PHP中wfMsgExt函数的典型用法代码示例。如果您正苦于以下问题:PHP wfMsgExt函数的具体用法?PHP wfMsgExt怎么用?PHP wfMsgExt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wfMsgExt函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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;
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:28,代码来源:AchUserProfileService.class.php
示例2: execute
/**
* Main method.
*
* @since 0.1
*
* @param string $subPage
*/
public function execute($subPage)
{
parent::execute($subPage);
$out = $this->getOutput();
if (trim($subPage) === '') {
$this->getOutput()->redirect(SpecialPage::getTitleFor('Institutions')->getLocalURL());
} else {
$out->setPageTitle(wfMsgExt('ep-institution-title', 'parsemag', $this->subPage));
$org = EPOrg::selectRow(null, array('name' => $this->subPage));
if ($org === false) {
$this->displayNavigation();
if ($this->getUser()->isAllowed('ep-org')) {
$out->addWikiMsg('ep-institution-create', $this->subPage);
EPOrg::displayAddNewControl($this->getContext(), array('name' => $this->subPage));
} else {
$out->addWikiMsg('ep-institution-none', $this->subPage);
}
} else {
$links = array();
if ($this->getUser()->isAllowed('ep-org')) {
$links[wfMsg('ep-institution-nav-edit')] = SpecialPage::getTitleFor('EditInstitution', $this->subPage);
}
$this->displayNavigation($links);
$this->displaySummary($org);
$out->addHTML(Html::element('h2', array(), wfMsg('ep-institution-courses')));
EPCourse::displayPager($this->getContext(), array('org_id' => $org->getId()));
if ($this->getUser()->isAllowed('ep-course')) {
$out->addHTML(Html::element('h2', array(), wfMsg('ep-institution-add-course')));
EPCourse::displayAddNewControl($this->getContext(), array('org' => $org->getId()));
}
}
}
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:40,代码来源:SpecialInstitution.php
示例3: doTagRow
function doTagRow($tag, $hitcount)
{
static $sk = null, $doneTags = array();
if (!$sk) {
$sk = $this->getSkin();
}
if (in_array($tag, $doneTags)) {
return '';
}
global $wgLang;
$newRow = '';
$newRow .= Xml::tags('td', null, Xml::element('tt', null, $tag));
$disp = ChangeTags::tagDescription($tag);
$disp .= ' (' . $sk->link(Title::makeTitle(NS_MEDIAWIKI, "Tag-{$tag}"), wfMsgHtml('tags-edit')) . ')';
$newRow .= Xml::tags('td', null, $disp);
$msg = wfMessage("tag-{$tag}-description");
$desc = !$msg->exists() ? '' : $msg->parse();
$desc .= ' (' . $sk->link(Title::makeTitle(NS_MEDIAWIKI, "Tag-{$tag}-description"), wfMsgHtml('tags-edit')) . ')';
$newRow .= Xml::tags('td', null, $desc);
$hitcount = wfMsgExt('tags-hitcount', array('parsemag'), $wgLang->formatNum($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:eFFemeer,项目名称:seizamcore,代码行数:25,代码来源:SpecialTags.php
示例4: getTypeProperties
protected function getTypeProperties($typeLabel)
{
global $wgRequest, $smwgTypePagingLimit;
if ($smwgTypePagingLimit <= 0) {
return '';
}
// not too useful, but we comply to this request
$from = $wgRequest->getVal('from');
$until = $wgRequest->getVal('until');
$typeValue = SMWDataValueFactory::newTypeIDValue('__typ', $typeLabel);
$store = smwfGetStore();
$options = SMWPageLister::getRequestOptions($smwgTypePagingLimit, $from, $until);
$diWikiPages = $store->getPropertySubjects(new SMWDIProperty('_TYPE'), $typeValue->getDataItem(), $options);
if (!$options->ascending) {
$diWikiPages = array_reverse($diWikiPages);
}
$result = '';
if (count($diWikiPages) > 0) {
$pageLister = new SMWPageLister($diWikiPages, null, $smwgTypePagingLimit, $from, $until);
$title = $this->getTitleFor('Types', $typeLabel);
$title->setFragment('#SMWResults');
// Make navigation point to the result list.
$navigation = $pageLister->getNavigationLinks($title);
$resultNumber = min($smwgTypePagingLimit, count($diWikiPages));
$typeName = $typeValue->getLongWikiText();
$result .= "<a name=\"SMWResults\"></a><div id=\"mw-pages\">\n" . '<h2>' . wfMsg('smw_type_header', $typeName) . "</h2>\n<p>" . wfMsgExt('smw_typearticlecount', array('parsemag'), $resultNumber) . "</p>\n" . $navigation . $pageLister->formatList() . $navigation . "\n</div>";
}
return $result;
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:29,代码来源:SMW_SpecialTypes.php
示例5: makeWlhLink
/**
* Make a "what links here" link for a given title
*
* @param Title $title Title to make the link for
* @param Skin $skin Skin to use
* @param object $result Result row
* @return string
*/
private function makeWlhLink($title, $skin, $result)
{
global $wgLang;
$wlh = SpecialPage::getTitleFor('Whatlinkshere');
$label = wfMsgExt('nlinks', array('parsemag', 'escape'), $wgLang->formatNum($result->value));
return $skin->link($wlh, $label, array(), array('target' => $title->getPrefixedText()));
}
开发者ID:amjadtbssm,项目名称:website,代码行数:15,代码来源:SpecialWantedtemplates.php
示例6: execute
/**
* Retrieve the specil words from the database.
*/
public function execute()
{
// Get the requests parameters.
$params = $this->extractRequestParams();
if (!(isset($params['userid']) xor isset($params['groupids']))) {
$this->dieUsage(wfMsgExt('swl-err-userid-xor-groupids'), 'userid-xor-groupids');
}
$isUserFilter = isset($params['userid']);
$filter = $isUserFilter ? $params['userid'] : $params['groupids'];
$this->setupChangeSetQuery($filter, $isUserFilter, $params['limit'], $params['continue']);
$sets = $this->select(__METHOD__);
$count = 0;
$resultSets = array();
foreach ($sets as $set) {
if (++$count > $params['limit']) {
// We've reached the one extra which shows that
// there are additional pages to be had. Stop here...
$this->setContinueEnumParameter('continue', $set->edit_time . '-' . $set->spe_set_id);
break;
}
$resultSets[] = SWLChangeSet::newFromDBResult($set);
}
if ($params['merge']) {
$this->mergeSets($resultSets);
}
foreach ($resultSets as &$set) {
$set = $set->toArray();
foreach ($set['changes'] as $propName => $changes) {
$this->getResult()->setIndexedTagName($set['changes'][$propName], 'change');
}
}
$this->getResult()->setIndexedTagName($resultSets, 'set');
$this->getResult()->addValue(null, 'sets', $resultSets);
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:37,代码来源:ApiQuerySemanticWatchlist.php
示例7: getLongDesc
function getLongDesc($image)
{
global $wgLang;
$original = parent::getLongDesc($image);
wfSuppressWarnings();
$metadata = unserialize($image->getMetadata());
wfRestoreWarnings();
if (!$metadata || $metadata['frameCount'] <= 0) {
return $original;
}
$info = array();
$info[] = $original;
if ($metadata['loopCount'] == 0) {
$info[] = wfMsgExt('file-info-png-looped', 'parseinline');
} elseif ($metadata['loopCount'] > 1) {
$info[] = wfMsgExt('file-info-png-repeat', 'parseinline', $metadata['loopCount']);
}
if ($metadata['frameCount'] > 0) {
$info[] = wfMsgExt('file-info-png-frames', 'parseinline', $metadata['frameCount']);
}
if ($metadata['duration']) {
$info[] = $wgLang->formatTimePeriod($metadata['duration']);
}
return $wgLang->commaList($info);
}
开发者ID:GodelDesign,项目名称:Godel,代码行数:25,代码来源:PNG.php
示例8: update_system_gifts
/**
* Adds awards for all registered users, updates statistics and purges
* caches.
* Special:PopulateAwards calls this function
*/
public function update_system_gifts()
{
global $wgOut, $wgMemc;
$dbw = wfGetDB(DB_MASTER);
$stats = new UserStatsTrack(1, '');
$this->categories = array_flip($this->categories);
$res = $dbw->select('system_gift', array('gift_id', 'gift_category', 'gift_threshold', 'gift_name'), array(), __METHOD__, array('ORDER BY' => 'gift_category, gift_threshold ASC'));
$x = 0;
foreach ($res as $row) {
if ($row->gift_category) {
$res2 = $dbw->select('user_stats', array('stats_user_id', 'stats_user_name'), array($stats->stats_fields[$this->categories[$row->gift_category]] . " >= {$row->gift_threshold}", 'stats_user_id <> 0'), __METHOD__);
foreach ($res2 as $row2) {
if ($this->doesUserHaveGift($row2->stats_user_id, $row->gift_id) == false) {
$dbw->insert('user_system_gift', array('sg_gift_id' => $row->gift_id, 'sg_user_id' => $row2->stats_user_id, 'sg_user_name' => $row2->stats_user_name, 'sg_status' => 0, 'sg_date' => date('Y-m-d H:i:s', time() - 60 * 60 * 24 * 3)), __METHOD__);
$sg_key = wfMemcKey('user', 'profile', 'system_gifts', "{$row2->stats_user_id}");
$wgMemc->delete($sg_key);
// Update counters (bug #27981)
UserSystemGifts::incGiftGivenCount($row->gift_id);
$wgOut->addHTML(wfMsg('ga-user-got-awards', $row2->stats_user_name, $row->gift_name) . '<br />');
$x++;
}
}
}
}
$wgOut->addHTML(wfMsgExt('ga-awards-given-out', 'parsemag', $x));
}
开发者ID:schwarer2006,项目名称:wikia,代码行数:31,代码来源:SystemGiftsClass.php
示例9: onGetNotificationMessage
public function onGetNotificationMessage($nc, &$msg, $isMain, $data, $authors, $userCount, $myName)
{
if (empty($data->article_title_ns) || MWNamespace::getSubject($data->article_title_ns) != NS_WIKIA_FORUM_BOARD) {
return true;
}
if (!$isMain) {
if ($data->parent_username == $myName) {
$replyTo = "your";
} else {
$replyTo = "someone";
}
//$params[] = $data->msg_author_displayname;
$params['$1'] = $nc->getDisplayname($data->msg_author_displayname);
$params['$2'] = "";
if ($userCount == 2) {
$params['$2'] = $nc->getDisplayname($authors[1]['displayname']);
}
$params['$3'] = $data->article_title_text;
$msgid = "forum-notification-user{$userCount}-reply-to-{$replyTo}";
} else {
$msgid = 'forum-notification-newmsg-on-followed-wall';
$params['$1'] = $nc->getDisplayname($data->msg_author_displayname);
$params['$2'] = $data->wall_displayname;
}
$msg = wfMsgExt($msgid, array('parsemag'), $params);
return true;
}
开发者ID:schwarer2006,项目名称:wikia,代码行数:27,代码来源:ForumNotificationPlugin.class.php
示例10: execute
/**
* Entry point
*/
public function execute($par)
{
global $wgOut, $wgRequest, $wgUser, $wgTitle, $haclgHaloScriptPath, $haclgSuperGroups;
haclCheckScriptPath();
$q = $wgRequest->getValues();
if ($wgUser->isLoggedIn()) {
$wgOut->setPageTitle(wfMsg('hacl_special_page'));
$groups = $wgUser->getGroups();
$this->isAdmin = true && array_intersect($groups, $haclgSuperGroups);
if (!isset($q['action']) || !isset(self::$actions[$q['action']]) || $q['action'] == 'rightgraph' && !$this->isAdmin) {
$q['action'] = 'acllist';
}
$f = 'html_' . $q['action'];
$wgOut->addLink(array('rel' => 'stylesheet', 'type' => 'text/css', 'media' => 'screen, projection', 'href' => $haclgHaloScriptPath . '/skins/haloacl.css'));
if ($f == 'html_acllist') {
$wgOut->addHTML('<p style="margin-top: -8px">' . wfMsgExt('hacl_acllist_hello', 'parseinline') . '</p>');
}
$this->_actions($q);
$this->{$f}($q);
} else {
$q = $_GET;
unset($q['title']);
$wgOut->redirect(Title::newFromText('Special:UserLogin')->getFullUrl(array('returnto' => 'Special:IntraACL', 'returntoquery' => http_build_query($q))));
}
}
开发者ID:hermannschwaerzlerUIBK,项目名称:IntraACL,代码行数:28,代码来源:ACLSpecial.php
示例11: execute
public function execute()
{
global $wgUser;
if (!$wgUser->isLoggedIn()) {
$this->dieUsage('You must be logged-in to have a watchlist', 'notloggedin');
}
$params = $this->extractRequestParams();
$title = Title::newFromText($params['title']);
if (!$title || $title->getNamespace() < 0) {
$this->dieUsageMsg(array('invalidtitle', $params['title']));
}
$article = new Article($title, 0);
$res = array('title' => $title->getPrefixedText());
if ($params['unwatch']) {
$res['unwatched'] = '';
$res['message'] = wfMsgExt('removedwatchtext', array('parse'), $title->getPrefixedText());
$success = WatchAction::doUnwatch($title, $wgUser);
} else {
$res['watched'] = '';
$res['message'] = wfMsgExt('addedwatchtext', array('parse'), $title->getPrefixedText());
$success = UnwatchAction::doWatch($title, $wgUser);
}
if (!$success) {
$this->dieUsageMsg('hookaborted');
}
$this->getResult()->addValue(null, $this->getModuleName(), $res);
}
开发者ID:tuxmania87,项目名称:GalaxyAdventures,代码行数:27,代码来源:ApiWatch.php
示例12: createPropertyText
static function createPropertyText($property_type, $default_form, $allowed_values_str)
{
global $smwgContLang;
$prop_labels = $smwgContLang->getPropertyLabels();
$type_tag = "[[{$prop_labels['_TYPE']}::{$property_type}]]";
$text = wfMsgForContent('sf_property_isproperty', $type_tag);
if ($default_form !== '') {
global $sfgContLang;
$sf_prop_labels = $sfgContLang->getPropertyLabels();
$default_form_tag = "[[{$sf_prop_labels[SF_SP_HAS_DEFAULT_FORM]}::{$default_form}]]";
$text .= ' ' . wfMsgForContent('sf_property_linkstoform', $default_form_tag);
}
if ($allowed_values_str !== '') {
// replace the comma substitution character that has no chance of
// being included in the values list - namely, the ASCII beep
global $sfgListSeparator;
$allowed_values_str = str_replace("\\{$sfgListSeparator}", "\\a", $allowed_values_str);
$allowed_values_array = explode($sfgListSeparator, $allowed_values_str);
$text .= "\n\n" . wfMsgExt('sf_property_allowedvals', array('parsemag', 'content'), count($allowed_values_array));
foreach ($allowed_values_array as $i => $value) {
// replace beep back with comma, trim
$value = str_replace("\\a", $sfgListSeparator, trim($value));
$prop_labels = $smwgContLang->getPropertyLabels();
$text .= "\n* [[" . $prop_labels['_PVAL'] . "::{$value}]]";
}
}
return $text;
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:28,代码来源:SF_CreateProperty.php
示例13: execute
public function execute()
{
global $wgUser;
if (!$wgUser->isAllowed('surveysubmit') || $wgUser->isBlocked()) {
$this->dieUsageMsg(array('badaccess-groups'));
}
$params = $this->extractRequestParams();
if (!(isset($params['id']) xor isset($params['name']))) {
$this->dieUsage(wfMsg('survey-err-id-xor-name'), 'id-xor-name');
}
if (isset($params['name'])) {
$survey = Survey::newFromName($params['name'], null, false);
if ($survey === false) {
$this->dieUsage(wfMsgExt('survey-err-survey-name-unknown', 'parsemag', $params['name']), 'survey-name-unknown');
}
} else {
$survey = Survey::newFromId($params['id'], null, false);
if ($survey === false) {
$this->dieUsage(wfMsgExt('survey-err-survey-id-unknown', 'parsemag', $params['id']), 'survey-id-unknown');
}
}
$submission = new SurveySubmission(array('survey_id' => $survey->getId(), 'page_id' => 0, 'user_name' => $GLOBALS['wgUser']->getName(), 'time' => wfTimestampNow()));
foreach (FormatJson::decode($params['answers']) as $answer) {
$submission->addAnswer(SurveyAnswer::newFromArray((array) $answer));
}
$submission->writeToDB();
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:27,代码来源:ApiSubmitSurvey.php
示例14: execute
public function execute()
{
$params = $this->extractRequestParams();
if (!(isset($params['username']) xor isset($params['userid']))) {
$this->dieUsage(wfMsgExt('ep-addinstructor-invalid-user-args'), 'username-xor-userid');
}
if (isset($params['username'])) {
$user = User::newFromName($params['username']);
$userId = $user->getId();
} else {
$userId = $params['userid'];
}
if ($userId < 1) {
$this->dieUsage(wfMsgExt('ep-addinstructor-invalid-user'), 'invalid-user');
}
if (!$this->userIsAllowed($userId)) {
$this->dieUsageMsg(array('badaccess-groups'));
}
$course = EPCourse::selectRow(array('id', 'name', 'instructors'), array('id' => $params['courseid']));
if ($course === false) {
$this->dieUsage(wfMsgExt('ep-addinstructor-invalid-course'), 'invalid-course');
}
$success = false;
switch ($params['subaction']) {
case 'add':
$success = $course->addInstructors(array($userId), $params['reason']);
break;
case 'remove':
$success = $course->removeInstructors(array($userId), $params['reason']);
break;
}
$this->getResult()->addValue(null, 'success', $success);
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:33,代码来源:ApiInstructor.php
示例15: showForm
function showForm()
{
global $wgOut, $wgUser, $wgLang, $wgRequest;
$self = SpecialPage::getTitleFor('Resetpass');
$form = '<div id="userloginForm">' . wfOpenElement('form', array('method' => 'post', 'action' => $self->getLocalUrl())) . '<h2>' . wfMsgHtml('resetpass_header') . '</h2>' . '<div id="userloginprompt">' . wfMsgExt('resetpass_text', array('parse')) . '</div>' . '<table>' . wfHidden('token', $wgUser->editToken()) . wfHidden('wpName', $this->mName) . wfHidden('wpPassword', $this->mTemporaryPassword) . wfHidden('returnto', $wgRequest->getVal('returnto')) . $this->pretty(array(array('wpName', 'username', 'text', $this->mName), array('wpNewPassword', 'newpassword', 'password', ''), array('wpRetype', 'yourpasswordagain', 'password', ''))) . '<tr>' . '<td></td>' . '<td>' . Xml::checkLabel(wfMsg('remembermypassword'), 'wpRemember', 'wpRemember', $wgRequest->getCheck('wpRemember')) . '</td>' . '</tr>' . '<tr>' . '<td></td>' . '<td>' . wfSubmitButton(wfMsgHtml('resetpass_submit')) . '</td>' . '</tr>' . '</table>' . wfCloseElement('form') . '</div>';
$wgOut->addHtml($form);
}
开发者ID:negabaro,项目名称:alfresco,代码行数:7,代码来源:SpecialResetpass.php
示例16: buildPage
/**
* Build the HTML for the page
* @return true
*/
private function buildPage()
{
global $wgScriptPath;
$htmlOut = '';
// Output beginning of the page
$htmlOut .= <<<HTML
<!DOCTYPE html>
<html lang="en" dir="ltr" class="client-nojs">
HTML;
$htmlOut .= $this->getHtmlHead();
$htmlOut .= <<<HTML
<body>
<div id="everything">
<div id="instructions">
HTML;
$htmlOut .= wfMsgExt('congresslookup-text', 'parse');
$htmlOut .= '</div><div id="contacts">';
if ($this->getZip() === false) {
$htmlOut .= $this->getZipForm(true);
} elseif (!is_null($this->getZip())) {
$htmlOut .= $this->getCongressTables();
} else {
$htmlOut .= $this->getZipForm();
}
// Output end of the page
$htmlOut .= "\n</div>\n</div>\n</body>\n</html>\n";
echo $htmlOut;
return true;
}
开发者ID:schwarer2006,项目名称:wikia,代码行数:34,代码来源:SpecialCongressLookup.php
示例17: getSummary
public function getSummary()
{
if ($this->summary === false) {
if ($this->messageId) {
$id = $this->messageId;
if (is_array($id)) {
$id = array_shift($id);
}
if (substr($id, 0, 3) == 'mw-') {
$id = substr($id, 3);
}
if (isset(self::$messagesMap[$id])) {
$id = self::$messagesMap[$id];
}
$messageId = $id . '-notice';
$message = wfMsg($messageId);
if (!wfEmptyMsg($messageId, $message)) {
$this->summary = wfMsgExt($messageId, array('parseinline'));
}
}
if ($this->summary === false) {
$this->summary = $this->getHtmlSnippet();
}
}
return (string) $this->summary;
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:26,代码来源:EditPageNotice.class.php
示例18: wfEditSimilarViewMesg
/**
* Show a message, depending on settings and the relevancy of the results.
*
* @param $out Object: OutputPage instance
* @return Boolean: true
*/
function wfEditSimilarViewMesg(&$out)
{
global $wgUser, $wgEditSimilarAlwaysShowThanks;
if (!empty($_SESSION['ES_saved']) && $wgUser->getOption('edit-similar', 1) == 1 && $out->isArticle()) {
if (EditSimilar::checkCounter()) {
$message_text = '';
$title = $out->getTitle();
$articleTitle = $title->getText();
// here we'll populate the similar articles and links
$instance = new EditSimilar($title->getArticleId(), 'category');
$similarities = $instance->getSimilarArticles();
if (!empty($similarities)) {
global $wgLang;
if ($instance->mSimilarArticles) {
$messageText = wfMsgExt('editsimilar-thanks', array('parsemag'), $wgLang->listToText($similarities), count($similarities));
} else {
// the articles we found were rather just articles needing attention
$messageText = wfMsgExt('editsimilar-thanks-notsimilar', array('parsemag'), $wgLang->listToText($similarities), count($similarities));
}
} else {
if ($wgUser->isLoggedIn() && !empty($wgEditSimilarAlwaysShowThanks)) {
$messageText = wfMsg('editsimilar-thankyou', $wgUser->getName());
}
}
if ($messageText != '') {
EditSimilar::showMessage($messageText, $articleTitle);
}
}
// display that only once
$_SESSION['ES_saved'] = '';
}
return true;
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:39,代码来源:EditSimilar.php
示例19: 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
示例20: getPreferences
/**
* GetPreferences hook handler.
* @param $user User
* @param $preferences Array: Preference descriptions
*/
public static function getPreferences($user, &$preferences)
{
$gadgets = Gadget::loadStructuredList();
if (!$gadgets) {
return true;
}
$options = array();
$default = array();
foreach ($gadgets as $section => $thisSection) {
$available = array();
foreach ($thisSection as $gadget) {
if ($gadget->isAllowed($user)) {
$gname = $gadget->getName();
# bug 30182: dir="auto" because it's often not translated
$desc = '<span dir="auto">' . $gadget->getDescription() . '</span>';
$available[$desc] = $gname;
if ($gadget->isEnabled($user)) {
$default[] = $gname;
}
}
}
if ($section !== '') {
$section = wfMsgExt("gadget-section-{$section}", 'parseinline');
if (count($available)) {
$options[$section] = $available;
}
} else {
$options = array_merge($options, $available);
}
}
$preferences['gadgets-intro'] = array('type' => 'info', 'label' => ' ', 'default' => Xml::tags('tr', array(), Xml::tags('td', array('colspan' => 2), wfMsgExt('gadgets-prefstext', 'parse'))), 'section' => 'gadgets', 'raw' => 1, 'rawrow' => 1);
$preferences['gadgets'] = array('type' => 'multiselect', 'options' => $options, 'section' => 'gadgets', 'label' => ' ', 'prefix' => 'gadget-', 'default' => $default);
return true;
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:39,代码来源:Gadgets_body.php
注:本文中的wfMsgExt函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论