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


PHP SpecialPage::getSafeTitleFor方法代码示例

本文整理汇总了PHP中SpecialPage::getSafeTitleFor方法的典型用法代码示例。如果您正苦于以下问题:PHP SpecialPage::getSafeTitleFor方法的具体用法?PHP SpecialPage::getSafeTitleFor怎么用?PHP SpecialPage::getSafeTitleFor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SpecialPage的用法示例。


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

示例1: getRedirect

 /**
  * Implement by redirecting through Special:Redirect/file.
  *
  * @param string|null $subpage
  * @return Title
  */
 public function getRedirect($par)
 {
     $file = $par ?: $this->getRequest()->getText('file');
     if ($file) {
         $argument = "file/{$file}";
     } else {
         $argument = 'file';
     }
     return SpecialPage::getSafeTitleFor('Redirect', $argument);
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:16,代码来源:SpecialFilepath.php

示例2: formatValue

 function formatValue($name, $value)
 {
     switch ($name) {
         case 'cc_rev_id':
             return $this->mView->skin->link(SpecialPage::getSafeTitleFor('Code', $this->mRepo->getName() . '/' . $value . '#code-comments'), htmlspecialchars($value));
         case 'cr_status':
             return $this->mView->skin->link(SpecialPage::getTitleFor('Code', $this->mRepo->getName() . '/status/' . $value), htmlspecialchars($this->mView->statusDesc($value)));
         case 'cc_user_text':
             return $this->mView->skin->userLink(-1, $value);
         case 'cr_message':
             return $this->mView->messageFragment($value);
         case 'cc_text':
             return $this->mView->messageFragment($value);
         case 'cc_timestamp':
             global $wgLang;
             return $wgLang->timeanddate($value, true);
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:18,代码来源:CodeCommentsListView.php

示例3: topLinks

 function topLinks()
 {
     global $wgOut, $wgUser, $wgEnableUploads;
     $sep = " |\n";
     $s = $this->mainPageLink() . $sep . $this->specialLink('recentchanges');
     if ($wgOut->isArticle()) {
         $s .= $sep . '<strong>' . $this->editThisPage() . '</strong>' . $sep . $this->historyLink();
     }
     /* show links to different language variants */
     $s .= $this->variantLinks();
     $s .= $this->extensionTabLinks();
     if ($wgUser->isAnon()) {
         $s .= $sep . $this->specialLink('userlogin');
     } else {
         $name = $wgUser->getName();
         /* show user page and user talk links */
         $s .= $sep . $this->link($wgUser->getUserPage(), wfMsgHtml('mypage'));
         $s .= $sep . $this->link($wgUser->getTalkPage(), wfMsgHtml('mytalk'));
         if ($wgUser->getNewtalk()) {
             $s .= ' *';
         }
         /* show watchlist link */
         $s .= $sep . $this->specialLink('watchlist');
         /* show my contributions link */
         $s .= $sep . $this->link(SpecialPage::getSafeTitleFor('Contributions', $wgUser->getName()), wfMsgHtml('mycontris'));
         /* show my preferences link */
         $s .= $sep . $this->specialLink('preferences');
         /* show upload file link */
         if ($wgEnableUploads) {
             $s .= $sep . $this->specialLink('upload');
         }
         /* show log out link */
         $s .= $sep . $this->specialLink('userlogout');
     }
     $s .= $sep . $this->specialPagesList();
     return $s;
 }
开发者ID:rocLv,项目名称:conference,代码行数:37,代码来源:Nostalgia.php

示例4: topLinks

 /**
  * @return string
  */
 function topLinks()
 {
     $sep = " |\n";
     $s = $this->getSkin()->mainPageLink() . $sep . Linker::specialLink('Recentchanges');
     if ($this->data['isarticle']) {
         $s .= $sep . '<strong>' . $this->editThisPage() . '</strong>' . $sep . $this->talkLink() . $sep . $this->historyLink();
     }
     /* show links to different language variants */
     $s .= $this->variantLinks();
     $s .= $this->extensionTabLinks();
     if (!$this->data['loggedin']) {
         $s .= $sep . Linker::specialLink('Userlogin');
     } else {
         /* show user page and user talk links */
         $user = $this->getSkin()->getUser();
         $s .= $sep . Linker::link($user->getUserPage(), wfMsgHtml('mypage'));
         $s .= $sep . Linker::link($user->getTalkPage(), wfMsgHtml('mytalk'));
         if ($user->getNewtalk()) {
             $s .= ' *';
         }
         /* show watchlist link */
         $s .= $sep . Linker::specialLink('Watchlist');
         /* show my contributions link */
         $s .= $sep . Linker::link(SpecialPage::getSafeTitleFor('Contributions', $this->data['username']), wfMsgHtml('mycontris'));
         /* show my preferences link */
         $s .= $sep . Linker::specialLink('Preferences');
         /* show upload file link */
         if (UploadBase::isEnabled() && UploadBase::isAllowed($user) === true) {
             $s .= $sep . $this->getUploadLink();
         }
         /* show log out link */
         $s .= $sep . Linker::specialLink('Userlogout');
     }
     $s .= $sep . $this->specialPagesList();
     return $s;
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:39,代码来源:Nostalgia.php

示例5: quickBar

 /**
  * Compute the sidebar
  * @access private
  *
  * @return string
  */
 function quickBar()
 {
     $s = "\n<div id='quickbar'>";
     $sep = '<br />';
     $s .= $this->menuHead('qbfind');
     $s .= $this->searchForm();
     $s .= $this->menuHead('qbbrowse');
     # Use the first heading from the Monobook sidebar as the "browse" section
     $bar = $this->getSkin()->buildSidebar();
     unset($bar['SEARCH']);
     unset($bar['LANGUAGES']);
     unset($bar['TOOLBOX']);
     $barnumber = 1;
     foreach ($bar as $heading => $browseLinks) {
         if ($barnumber > 1) {
             $headingMsg = wfMessage($heading);
             if ($headingMsg->exists()) {
                 $h = $headingMsg->text();
             } else {
                 $h = $heading;
             }
             $s .= "\n<h6>" . htmlspecialchars($h) . "</h6>";
         }
         if (is_array($browseLinks)) {
             foreach ($browseLinks as $link) {
                 if ($link['text'] != '-') {
                     $s .= "<a href=\"{$link['href']}\">" . htmlspecialchars($link['text']) . '</a>' . $sep;
                 }
             }
         }
         $barnumber++;
     }
     $user = $this->getSkin()->getUser();
     if ($this->data['isarticle']) {
         $s .= $this->menuHead('qbedit');
         $s .= '<strong>' . $this->editThisPage() . '</strong>';
         $s .= $sep . Linker::linkKnown(Title::newFromText(wfMsgForContent('edithelppage')), wfMsg('edithelp'));
         if ($this->data['loggedin']) {
             $s .= $sep . $this->moveThisPage();
         }
         if ($user->isAllowed('delete')) {
             $dtp = $this->deleteThisPage();
             if ($dtp != '') {
                 $s .= $sep . $dtp;
             }
         }
         if ($user->isAllowed('protect')) {
             $ptp = $this->protectThisPage();
             if ($ptp != '') {
                 $s .= $sep . $ptp;
             }
         }
         $s .= $sep;
         $s .= $this->menuHead('qbpageoptions');
         $s .= $this->talkLink() . $sep . $this->commentLink() . $sep . $this->printableLink();
         if ($this->data['loggedin']) {
             $s .= $sep . $this->watchThisPage();
         }
         $s .= $sep;
         $s .= $this->menuHead('qbpageinfo') . $this->historyLink() . $sep . $this->whatLinksHere() . $sep . $this->watchPageLinksLink();
         $title = $this->getSkin()->getTitle();
         $tns = $title->getNamespace();
         if ($tns == NS_USER || $tns == NS_USER_TALK) {
             $id = User::idFromName($title->getText());
             if ($id != 0) {
                 $s .= $sep . $this->userContribsLink();
                 if ($this->getSkin()->showEmailUser($id)) {
                     $s .= $sep . $this->emailUserLink();
                 }
             }
         }
         $s .= $sep;
     }
     $s .= $this->menuHead('qbmyoptions');
     if ($this->data['loggedin']) {
         $tl = Linker::link($user->getTalkPage(), wfMsg('mytalk'), array(), array(), array('known', 'noclasses'));
         if ($user->getNewtalk()) {
             $tl .= ' *';
         }
         $s .= Linker::link($user->getUserPage(), wfMsg('mypage'), array(), array(), array('known', 'noclasses')) . $sep . $tl . $sep . Linker::specialLink('Watchlist') . $sep . Linker::link(SpecialPage::getSafeTitleFor('Contributions', $user->getName()), wfMsg('mycontris'), array(), array(), array('known', 'noclasses')) . $sep . Linker::specialLink('Preferences') . $sep . Linker::specialLink('Userlogout');
     } else {
         $s .= Linker::specialLink('Userlogin');
     }
     $s .= $this->menuHead('qbspecialpages') . Linker::specialLink('Newpages') . $sep . Linker::specialLink('Listfiles') . $sep . Linker::specialLink('Statistics');
     if (UploadBase::isEnabled() && UploadBase::isAllowed($user) === true) {
         $s .= $sep . $this->getUploadLink();
     }
     global $wgSiteSupportPage;
     if ($wgSiteSupportPage) {
         $s .= $sep . '<a href="' . htmlspecialchars($wgSiteSupportPage) . '" class="internal">' . wfMsg('sitesupport') . '</a>';
     }
     $s .= $sep . Linker::link(SpecialPage::getTitleFor('Specialpages'), wfMsg('moredotdotdot'), array(), array(), array('known', 'noclasses'));
     $s .= $sep . "\n</div>\n";
     return $s;
//.........这里部分代码省略.........
开发者ID:Tjorriemorrie,项目名称:app,代码行数:101,代码来源:CologneBlue.php

示例6: getNavigationBar

 /**
  * Creates the HTML for a navigation bar to show long lists of results.
  * Most of the parameters are taken from the object members.
  *
  * @todo I18N: message patchworking
  *
  * @param integer $count How many results are currently displayed?
  * @return string  HTML with the navigation bar
  */
 protected function getNavigationBar($count)
 {
     global $smwgQMaxInlineLimit;
     if ($this->offset > 0) {
         $navigation = Html::element('a', array('href' => SpecialPage::getSafeTitleFor('SearchByProperty')->getLocalURL(array('offset' => max(0, $this->offset - $this->limit), 'limit' => $this->limit, 'property' => $this->property->getWikiValue(), 'value' => $this->value->getWikiValue()))), wfMessage('smw_result_prev')->text());
     } else {
         $navigation = wfMessage('smw_result_prev')->text();
     }
     // TODO i18n: patchwork messages
     $navigation .= '&#160;&#160;&#160;&#160; <b>' . wfMessage('smw_result_results')->text() . ' ' . ($this->offset + 1) . '– ' . ($this->offset + min($count, $this->limit)) . '</b>&#160;&#160;&#160;&#160;';
     if ($count > $this->limit) {
         $navigation .= Html::element('a', array('href' => SpecialPage::getSafeTitleFor('SearchByProperty')->getLocalURL(array('offset' => $this->offset + $this->limit, 'limit' => $this->limit, 'property' => $this->property->getWikiValue(), 'value' => $this->value->getWikiValue()))), wfMessage('smw_result_next')->text());
     } else {
         $navigation .= wfMessage('smw_result_next')->text();
     }
     // Find out which limit values to offer for navigation
     $limits = array();
     foreach (array(20, 50, 100, 250, 500) as $l) {
         if ($l < $smwgQMaxInlineLimit) {
             $limits[] = $l;
         } else {
             $limits[] = $smwgQMaxInlineLimit;
             break;
         }
     }
     $first = true;
     foreach ($limits as $l) {
         if ($first) {
             $navigation .= '&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;(';
             $first = false;
         } else {
             $navigation .= ' ' . wfMessage('pipe-separator')->escaped() . ' ';
         }
         if ($this->limit != $l) {
             $navigation .= Html::element('a', array('href' => SpecialPage::getSafeTitleFor('SearchByProperty')->getLocalURL(array('offset' => $this->offset, 'limit' => $l, 'property' => $this->property->getWikiValue(), 'value' => $this->value->getWikiValue()))), $l);
         } else {
             $navigation .= '<b>' . $l . '</b>';
         }
     }
     $navigation .= ')';
     return $navigation;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:51,代码来源:SMW_SpecialSearchByProperty.php

示例7: formatRow

 /**
  * Callback function to output a block
  */
 function formatRow($block)
 {
     global $wgUser, $wgLang;
     wfProfileIn(__METHOD__);
     static $sk = null, $msg = null;
     if (is_null($sk)) {
         $sk = $wgUser->getSkin();
     }
     if (is_null($msg)) {
         $msg = array();
         $keys = array('infiniteblock', 'expiringblock', 'contribslink', 'unblocklink', 'anononlyblock', 'createaccountblock', 'noautoblockblock');
         foreach ($keys as $key) {
             $msg[$key] = wfMsgHtml($key);
         }
         $msg['blocklistline'] = wfMsg('blocklistline');
         $msg['contribslink'] = wfMsg('contribslink');
     }
     # Prepare links to the blocker's user and talk pages
     $blocker_id = $block->getBy();
     $blocker_name = $block->getByName();
     $blocker = $sk->userLink($blocker_id, $blocker_name);
     $blocker .= $sk->userToolLinks($blocker_id, $blocker_name);
     # Prepare links to the block target's user and contribs. pages (as applicable, don't do it for autoblocks)
     if ($block->mAuto) {
         $target = $block->getRedactedName();
         # Hide the IP addresses of auto-blocks; privacy
     } else {
         $target = $sk->makeLinkObj(Title::makeTitle(NS_USER, $block->mAddress), $block->mAddress);
         $target .= ' (' . $sk->makeKnownLinkObj(SpecialPage::getSafeTitleFor('Contributions', $block->mAddress), $msg['contribslink']) . ')';
     }
     $formattedTime = $wgLang->timeanddate($block->mTimestamp, true);
     $properties = array();
     if ($block->mExpiry === "" || $block->mExpiry === Block::infinity()) {
         $properties[] = $msg['infiniteblock'];
     } else {
         $properties[] = wfMsgReplaceArgs($msg['expiringblock'], array($wgLang->timeanddate($block->mExpiry, true)));
     }
     if ($block->mAnonOnly) {
         $properties[] = $msg['anononlyblock'];
     }
     if ($block->mCreateAccount) {
         $properties[] = $msg['createaccountblock'];
     }
     if (!$block->mEnableAutoblock && $block->mUser) {
         $properties[] = $msg['noautoblockblock'];
     }
     $properties = implode(', ', $properties);
     $line = wfMsgReplaceArgs($msg['blocklistline'], array($formattedTime, $blocker, $target, $properties));
     $s = "<li>{$line}";
     if ($wgUser->isAllowed('block')) {
         $titleObj = SpecialPage::getTitleFor("Ipblocklist");
         $s .= ' (' . $sk->makeKnownLinkObj($titleObj, $msg['unblocklink'], 'action=unblock&id=' . urlencode($block->mId)) . ')';
     }
     $s .= $sk->commentBlock($block->mReason);
     $s .= "</li>\n";
     wfProfileOut(__METHOD__);
     return $s;
 }
开发者ID:negabaro,项目名称:alfresco,代码行数:61,代码来源:SpecialIpblocklist.php

示例8: quickBar

 /**
  * Compute the sidebar
  * @access private
  */
 function quickBar()
 {
     global $wgOut, $wgTitle, $wgUser, $wgLang, $wgContLang, $wgEnableUploads;
     $tns = $wgTitle->getNamespace();
     $s = "\n<div id='quickbar'>";
     $sep = "<br />";
     $s .= $this->menuHead("qbfind");
     $s .= $this->searchForm();
     $s .= $this->menuHead("qbbrowse");
     # Use the first heading from the Monobook sidebar as the "browse" section
     $bar = $this->buildSidebar();
     unset($bar['SEARCH']);
     unset($bar['LANGUAGES']);
     unset($bar['TOOLBOX']);
     $browseLinks = reset($bar);
     foreach ($browseLinks as $link) {
         if ($link['text'] != '-') {
             $s .= "<a href=\"{$link['href']}\">" . htmlspecialchars($link['text']) . '</a>' . $sep;
         }
     }
     if ($wgOut->isArticle()) {
         $s .= $this->menuHead("qbedit");
         $s .= "<strong>" . $this->editThisPage() . "</strong>";
         $s .= $sep . $this->makeKnownLink(wfMsgForContent("edithelppage"), wfMsg("edithelp"));
         if ($wgUser->isLoggedIn()) {
             $s .= $sep . $this->moveThisPage();
         }
         if ($wgUser->isAllowed('delete')) {
             $dtp = $this->deleteThisPage();
             if ("" != $dtp) {
                 $s .= $sep . $dtp;
             }
         }
         if ($wgUser->isAllowed('protect')) {
             $ptp = $this->protectThisPage();
             if ("" != $ptp) {
                 $s .= $sep . $ptp;
             }
         }
         $s .= $sep;
         $s .= $this->menuHead("qbpageoptions");
         $s .= $this->talkLink() . $sep . $this->commentLink() . $sep . $this->printableLink();
         if ($wgUser->isLoggedIn()) {
             $s .= $sep . $this->watchThisPage();
         }
         $s .= $sep;
         $s .= $this->menuHead("qbpageinfo") . $this->historyLink() . $sep . $this->whatLinksHere() . $sep . $this->watchPageLinksLink();
         if ($tns == NS_USER || $tns == NS_USER_TALK) {
             $id = User::idFromName($wgTitle->getText());
             if ($id != 0) {
                 $s .= $sep . $this->userContribsLink();
                 if ($this->showEmailUser($id)) {
                     $s .= $sep . $this->emailUserLink();
                 }
             }
         }
         $s .= $sep;
     }
     $s .= $this->menuHead("qbmyoptions");
     if ($wgUser->isLoggedIn()) {
         $name = $wgUser->getName();
         $tl = $this->makeKnownLinkObj($wgUser->getTalkPage(), wfMsg('mytalk'));
         if ($wgUser->getNewtalk()) {
             $tl .= " *";
         }
         $s .= $this->makeKnownLinkObj($wgUser->getUserPage(), wfMsg("mypage")) . $sep . $tl . $sep . $this->specialLink("watchlist") . $sep . $this->makeKnownLinkObj(SpecialPage::getSafeTitleFor("Contributions", $wgUser->getName()), wfMsg("mycontris")) . $sep . $this->specialLink("preferences") . $sep . $this->specialLink("userlogout");
     } else {
         $s .= $this->specialLink("userlogin");
     }
     $s .= $this->menuHead("qbspecialpages") . $this->specialLink("newpages") . $sep . $this->specialLink("imagelist") . $sep . $this->specialLink("statistics") . $sep . $this->bugReportsLink();
     if ($wgUser->isLoggedIn() && $wgEnableUploads) {
         $s .= $sep . $this->specialLink("upload");
     }
     global $wgSiteSupportPage;
     if ($wgSiteSupportPage) {
         $s .= $sep . "<a href=\"" . htmlspecialchars($wgSiteSupportPage) . "\" class =\"internal\">" . wfMsg("sitesupport") . "</a>";
     }
     $s .= $sep . $this->makeKnownLinkObj(SpecialPage::getTitleFor('Specialpages'), wfMsg('moredotdotdot'));
     $s .= $sep . "\n</div>\n";
     return $s;
 }
开发者ID:hunkim,项目名称:homepage,代码行数:85,代码来源:CologneBlue.php

示例9: composeCommonMailtext

 /**
  * Generate the generic "this page has been changed" e-mail text.
  */
 private function composeCommonMailtext()
 {
     global $wgPasswordSender, $wgNoReplyAddress;
     global $wgEnotifFromEditor, $wgEnotifRevealEditorAddress;
     global $wgEnotifImpersonal, $wgEnotifUseRealName;
     $this->composed_common = true;
     # You as the WikiAdmin and Sysops can make use of plenty of
     # named variables when composing your notification emails while
     # simply editing the Meta pages
     $keys = array();
     $postTransformKeys = array();
     $pageTitleUrl = $this->title->getCanonicalURL();
     $pageTitle = $this->title->getPrefixedText();
     if ($this->oldid) {
         // Always show a link to the diff which triggered the mail. See bug 32210.
         $keys['$NEWPAGE'] = "\n\n" . wfMessage('enotif_lastdiff', $this->title->getCanonicalURL(array('diff' => 'next', 'oldid' => $this->oldid)))->inContentLanguage()->text();
         if (!$wgEnotifImpersonal) {
             // For personal mail, also show a link to the diff of all changes
             // since last visited.
             $keys['$NEWPAGE'] .= "\n\n" . wfMessage('enotif_lastvisited', $this->title->getCanonicalURL(array('diff' => '0', 'oldid' => $this->oldid)))->inContentLanguage()->text();
         }
         $keys['$OLDID'] = $this->oldid;
         // Deprecated since MediaWiki 1.21, not used by default. Kept for backwards-compatibility.
         $keys['$CHANGEDORCREATED'] = wfMessage('changed')->inContentLanguage()->text();
     } else {
         # clear $OLDID placeholder in the message template
         $keys['$OLDID'] = '';
         $keys['$NEWPAGE'] = '';
         // Deprecated since MediaWiki 1.21, not used by default. Kept for backwards-compatibility.
         $keys['$CHANGEDORCREATED'] = wfMessage('created')->inContentLanguage()->text();
     }
     $keys['$PAGETITLE'] = $this->title->getPrefixedText();
     $keys['$PAGETITLE_URL'] = $this->title->getCanonicalURL();
     $keys['$PAGEMINOREDIT'] = $this->minorEdit ? wfMessage('minoredit')->inContentLanguage()->text() : '';
     $keys['$UNWATCHURL'] = $this->title->getCanonicalURL('action=unwatch');
     if ($this->editor->isAnon()) {
         # real anon (user:xxx.xxx.xxx.xxx)
         $keys['$PAGEEDITOR'] = wfMessage('enotif_anon_editor', $this->editor->getName())->inContentLanguage()->text();
         $keys['$PAGEEDITOR_EMAIL'] = wfMessage('noemailtitle')->inContentLanguage()->text();
     } else {
         $keys['$PAGEEDITOR'] = $wgEnotifUseRealName && $this->editor->getRealName() !== '' ? $this->editor->getRealName() : $this->editor->getName();
         $emailPage = SpecialPage::getSafeTitleFor('Emailuser', $this->editor->getName());
         $keys['$PAGEEDITOR_EMAIL'] = $emailPage->getCanonicalURL();
     }
     $keys['$PAGEEDITOR_WIKI'] = $this->editor->getUserPage()->getCanonicalURL();
     $keys['$HELPPAGE'] = wfExpandUrl(Skin::makeInternalOrExternalUrl(wfMessage('helppage')->inContentLanguage()->text()));
     # Replace this after transforming the message, bug 35019
     $postTransformKeys['$PAGESUMMARY'] = $this->summary == '' ? ' - ' : $this->summary;
     // Now build message's subject and body
     // Messages:
     // enotif_subject_deleted, enotif_subject_created, enotif_subject_moved,
     // enotif_subject_restored, enotif_subject_changed
     $this->subject = wfMessage('enotif_subject_' . $this->pageStatus)->inContentLanguage()->params($pageTitle, $keys['$PAGEEDITOR'])->text();
     // Messages:
     // enotif_body_intro_deleted, enotif_body_intro_created, enotif_body_intro_moved,
     // enotif_body_intro_restored, enotif_body_intro_changed
     $keys['$PAGEINTRO'] = wfMessage('enotif_body_intro_' . $this->pageStatus)->inContentLanguage()->params($pageTitle, $keys['$PAGEEDITOR'], $pageTitleUrl)->text();
     $body = wfMessage('enotif_body')->inContentLanguage()->plain();
     $body = strtr($body, $keys);
     $body = MessageCache::singleton()->transform($body, false, null, $this->title);
     $this->body = wordwrap(strtr($body, $postTransformKeys), 72);
     # Reveal the page editor's address as REPLY-TO address only if
     # the user has not opted-out and the option is enabled at the
     # global configuration level.
     $adminAddress = new MailAddress($wgPasswordSender, wfMessage('emailsender')->inContentLanguage()->text());
     if ($wgEnotifRevealEditorAddress && $this->editor->getEmail() != '' && $this->editor->getOption('enotifrevealaddr')) {
         $editorAddress = MailAddress::newFromUser($this->editor);
         if ($wgEnotifFromEditor) {
             $this->from = $editorAddress;
         } else {
             $this->from = $adminAddress;
             $this->replyto = $editorAddress;
         }
     } else {
         $this->from = $adminAddress;
         $this->replyto = new MailAddress($wgNoReplyAddress);
     }
 }
开发者ID:D66Ha,项目名称:mediawiki,代码行数:81,代码来源:EmailNotification.php

示例10: linkHere

 /**
  * Creates the HTML for a link to this page, with some parameters set.
  *
  * @param[in] $text string  The anchor text for the link
  * @param[in] $out bool  Should the linked to page include outgoing properties?
  * @param[in] $in bool  Should the linked to page include incoming properties?
  * @param[in] $offset int  What is the offset for the incoming properties?
  *
  * @return string  HTML with the link to this page
  */
 private function linkHere($text, $out, $in, $offset)
 {
     $frag = $text == wfMessage('smw_browse_show_incoming')->text() ? '#smw_browse_incoming' : '';
     return Html::element('a', array('href' => \SpecialPage::getSafeTitleFor('Browse')->getLocalURL(array('offset' => $offset, 'dir' => $out ? $in ? 'both' : 'out' : 'in', 'article' => $this->subject->getLongWikiText())) . $frag), $text);
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:15,代码来源:HtmlContentBuilder.php

示例11: printFooterThings

    private function printFooterThings()
    {
        // prepare login token:
        $loginToken = MWCryptRand::generateHex(32);
        if ($this->getSkin()->getTitle()->getText() != 'UserLogin') {
            // Skin userlogin page to avoid collision
            if (session_id() == '') {
                wfSetupSession();
            }
            $this->getSkin()->getRequest()->setSessionData('wsLoginToken', $loginToken);
        }
        ?>

<div class="why-sign-up-popup mobile-form-popup">
    <h3>
        <?php 
        echo wfMessage('settlein-skin-modal-whysignup-title')->plain();
        ?>
    </h3>

    <?php 
        echo wfMessage('settlein-skin-modal-whysignup-text')->plain();
        ?>

</div>

<!-- Login popup form & wrapper -->
<div id="login-popup-wrapper">
</div>

<div class="login-popup-form mobile-form-popup">
    <h3>
        <?php 
        echo wfMessage('settlein-skin-modal-login-title')->plain();
        ?>
    </h3>

    <p>
        <?php 
        echo wfMessage('settlein-skin-modal-login-subtitle')->plain();
        ?>
    </p>

    <form class="" method="post" action="<?php 
        echo SpecialPage::getSafeTitleFor('UserLogin')->getFullURL('action=submitlogin&type=login');
        ?>
">
        <div class="form-group">
            <input type="text" class="form-control" placeholder="<?php 
        echo wfMessage('settlein-skin-modal-login-email-placeholder')->plain();
        ?>
" name="wpName" />
        </div>
        <div class="form-group">
            <input type="password" class="form-control" placeholder="<?php 
        echo wfMessage('settlein-skin-modal-login-password-placeholder')->plain();
        ?>
" name="wpPassword" />
        </div>
        <input type="hidden" name="wpLoginToken" value="<?php 
        echo $loginToken;
        ?>
" />
        <input type="hidden" name="wpRemember" value="1" />
        <div class="form-group">
            <input type="submit" name="wpLoginAttempt" class="btn btn-primary" value="<?php 
        echo wfMessage('settlein-skin-modal-login-login-button')->plain();
        ?>
"/>
            <a href="<?php 
        echo SpecialPage::getSafeTitleFor('Userlogin')->getFullURL('type=signup');
        ?>
" class="btn btn-cyanide">
                <?php 
        echo wfMessage('settlein-skin-modal-login-signup-button')->plain();
        ?>
            </a>
            <a href="<?php 
        echo SpecialPage::getSafeTitleFor('PasswordReset')->getFullURL();
        ?>
" class="pull-right">
                <?php 
        echo wfMessage('settlein-skin-modal-login-reset-password')->plain();
        ?>
            </a>
        </div>
    </form>
</div>

<!-- Add new article popup form & wrapper -->
<div id="add-new-article-popup-wrapper">
</div>

<div class="add-new-article-popup-form">
    <h3>
	    <?php 
        echo wfMessage('settlein-skin-add-new-article-window-title')->plain();
        ?>
    </h3>
	<p>
//.........这里部分代码省略.........
开发者ID:vedmaka,项目名称:SettleInSkin,代码行数:101,代码来源:SettleInTemplate.php

示例12: composeCommonMailtext

 /**
  * Generate the generic "this page has been changed" e-mail text.
  */
 private function composeCommonMailtext()
 {
     global $wgPasswordSender, $wgPasswordSenderName, $wgNoReplyAddress;
     global $wgEnotifFromEditor, $wgEnotifRevealEditorAddress;
     global $wgEnotifImpersonal, $wgEnotifUseRealName;
     $this->composed_common = true;
     # You as the WikiAdmin and Sysops can make use of plenty of
     # named variables when composing your notification emails while
     # simply editing the Meta pages
     $keys = array();
     if ($this->oldid) {
         $difflink = $this->title->getCanonicalUrl('diff=0&oldid=' . $this->oldid);
         $keys['$NEWPAGE'] = wfMsgForContent('enotif_lastvisited', $difflink);
         $keys['$OLDID'] = $this->oldid;
         $keys['$CHANGEDORCREATED'] = wfMsgForContent('changed');
     } else {
         $keys['$NEWPAGE'] = wfMsgForContent('enotif_newpagetext');
         # clear $OLDID placeholder in the message template
         $keys['$OLDID'] = '';
         $keys['$CHANGEDORCREATED'] = wfMsgForContent('created');
     }
     $keys['$PAGETITLE'] = $this->title->getPrefixedText();
     $keys['$PAGETITLE_URL'] = $this->title->getCanonicalUrl();
     $keys['$PAGEMINOREDIT'] = $this->minorEdit ? wfMsgForContent('minoredit') : '';
     $keys['$PAGESUMMARY'] = $this->summary == '' ? ' - ' : $this->summary;
     $keys['$UNWATCHURL'] = $this->title->getCanonicalUrl('action=unwatch');
     if ($this->editor->isAnon()) {
         # real anon (user:xxx.xxx.xxx.xxx)
         $keys['$PAGEEDITOR'] = wfMsgForContent('enotif_anon_editor', $this->editor->getName());
         $keys['$PAGEEDITOR_EMAIL'] = wfMsgForContent('noemailtitle');
     } else {
         $keys['$PAGEEDITOR'] = $wgEnotifUseRealName ? $this->editor->getRealName() : $this->editor->getName();
         $emailPage = SpecialPage::getSafeTitleFor('Emailuser', $this->editor->getName());
         $keys['$PAGEEDITOR_EMAIL'] = $emailPage->getCanonicalUrl();
     }
     $keys['$PAGEEDITOR_WIKI'] = $this->editor->getUserPage()->getCanonicalUrl();
     # Now build message's subject and body
     $subject = wfMsgExt('enotif_subject', 'content');
     $subject = strtr($subject, $keys);
     $this->subject = MessageCache::singleton()->transform($subject, false, null, $this->title);
     $body = wfMsgExt('enotif_body', 'content');
     $body = strtr($body, $keys);
     $body = MessageCache::singleton()->transform($body, false, null, $this->title);
     $this->body = wordwrap($body, 72);
     # Reveal the page editor's address as REPLY-TO address only if
     # the user has not opted-out and the option is enabled at the
     # global configuration level.
     $adminAddress = new MailAddress($wgPasswordSender, $wgPasswordSenderName);
     if ($wgEnotifRevealEditorAddress && $this->editor->getEmail() != '' && $this->editor->getOption('enotifrevealaddr')) {
         $editorAddress = new MailAddress($this->editor);
         if ($wgEnotifFromEditor) {
             $this->from = $editorAddress;
         } else {
             $this->from = $adminAddress;
             $this->replyto = $editorAddress;
         }
     } else {
         $this->from = $adminAddress;
         $this->replyto = new MailAddress($wgNoReplyAddress);
     }
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:64,代码来源:UserMailer.php

示例13: renderUserProfile

 /**
  * renderUserProfile -- return mashead tab for fallowed pages
  *
  * @static
  * @access public
  *
  *
  * @return  array
  */
 public static function renderUserProfile(&$out)
 {
     global $wgTitle, $wgRequest, $wgOut, $wgExtensionsPath, $wgJsMimeType, $wgUser;
     wfProfileIn(__METHOD__);
     if (F::app()->checkSkin('wikiamobile')) {
         return true;
     }
     if ($wgUser->getId() != 0 && $wgRequest->getVal("hide_followed", 0) == 1) {
         $wgUser->setOption("hidefollowedpages", true);
         $wgUser->saveSettings();
     }
     $key = $wgTitle->getDBKey();
     if (strlen($key) > 0) {
         $user = User::newFromName($key);
         if ($user == null) {
             return true;
         }
         if ($user->getId() == 0) {
             //not a real user
             return true;
         }
     } else {
         $user = $wgUser;
     }
     // do not show Followed box on diffs
     if ($wgRequest->getVal('diff', null) != null) {
         return true;
     }
     if ($user->getOption("hidefollowedpages")) {
         return true;
     }
     $data = FollowModel::getUserPageWatchList($user->getId());
     $wgOut->addExtensionStyle("{$wgExtensionsPath}/wikia/Follow/css/userpage.css");
     $template = new EasyTemplate(dirname(__FILE__) . '/templates/');
     if (count($data) == 0) {
         $data = null;
     }
     /*
     		if ( count($data) > 5 ) {
     			$data2 = array_slice($data, 5 );
     			$data = array_slice($data, 0, 5);
     		} */
     // BugId:2643
     $moreUrl = null;
     if ($wgUser->getId() == $user->getId()) {
         $specialPage = SpecialPage::getSafeTitleFor('Following', $user->getName());
         if (!empty($specialPage)) {
             $moreUrl = $specialPage->getLocalUrl();
         }
     }
     $template->set_vars(array("isLogin" => $wgUser->getId() == $user->getId(), "hideUrl" => $wgTitle->getFullUrl("hide_followed=1"), "data" => $data, "moreUrl" => $moreUrl));
     wfProfileOut(__METHOD__);
     $out['followedPages'] = $template->render("followedUserPage");
     return true;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:64,代码来源:FollowHelper.class.php

示例14: composeCommonMailtext

 /**
  * @private
  */
 function composeCommonMailtext()
 {
     global $wgPasswordSender, $wgNoReplyAddress;
     global $wgEnotifFromEditor, $wgEnotifRevealEditorAddress;
     global $wgEnotifImpersonal, $wgEnotifUseRealName;
     $this->composed_common = true;
     $summary = $this->summary == '' ? ' - ' : $this->summary;
     $medit = $this->minorEdit ? wfMsg('minoredit') : '';
     # You as the WikiAdmin and Sysops can make use of plenty of
     # named variables when composing your notification emails while
     # simply editing the Meta pages
     $subject = wfMsgForContent('enotif_subject');
     $body = wfMsgForContent('enotif_body');
     $from = '';
     /* fail safe */
     $replyto = '';
     /* fail safe */
     $keys = array();
     if ($this->oldid) {
         $difflink = $this->title->getFullUrl('diff=0&oldid=' . $this->oldid);
         $keys['$NEWPAGE'] = wfMsgForContent('enotif_lastvisited', $difflink);
         $keys['$OLDID'] = $this->oldid;
         $keys['$CHANGEDORCREATED'] = wfMsgForContent('changed');
     } else {
         $keys['$NEWPAGE'] = wfMsgForContent('enotif_newpagetext');
         # clear $OLDID placeholder in the message template
         $keys['$OLDID'] = '';
         $keys['$CHANGEDORCREATED'] = wfMsgForContent('created');
     }
     if ($wgEnotifImpersonal && $this->oldid) {
         /*
          * For impersonal mail, show a diff link to the last
          * revision.
          */
         $keys['$NEWPAGE'] = wfMsgForContent('enotif_lastdiff', $this->title->getFullURL("oldid={$this->oldid}&diff=prev"));
     }
     $body = strtr($body, $keys);
     $pagetitle = $this->title->getPrefixedText();
     $keys['$PAGETITLE'] = $pagetitle;
     $keys['$PAGETITLE_URL'] = $this->title->getFullUrl();
     $keys['$PAGEMINOREDIT'] = $medit;
     $keys['$PAGESUMMARY'] = $summary;
     $subject = strtr($subject, $keys);
     # Reveal the page editor's address as REPLY-TO address only if
     # the user has not opted-out and the option is enabled at the
     # global configuration level.
     $editor = $this->editor;
     $name = $wgEnotifUseRealName ? $editor->getRealName() : $editor->getName();
     $adminAddress = new MailAddress($wgPasswordSender, 'WikiAdmin');
     $editorAddress = new MailAddress($editor);
     if ($wgEnotifRevealEditorAddress && $editor->getEmail() != '' && $editor->getOption('enotifrevealaddr')) {
         if ($wgEnotifFromEditor) {
             $from = $editorAddress;
         } else {
             $from = $adminAddress;
             $replyto = $editorAddress;
         }
     } else {
         $from = $adminAddress;
         $replyto = new MailAddress($wgNoReplyAddress);
     }
     if ($editor->isIP($name)) {
         #real anon (user:xxx.xxx.xxx.xxx)
         $utext = wfMsgForContent('enotif_anon_editor', $name);
         $subject = str_replace('$PAGEEDITOR', $utext, $subject);
         $keys['$PAGEEDITOR'] = $utext;
         $keys['$PAGEEDITOR_EMAIL'] = wfMsgForContent('noemailtitle');
     } else {
         $subject = str_replace('$PAGEEDITOR', $name, $subject);
         $keys['$PAGEEDITOR'] = $name;
         $emailPage = SpecialPage::getSafeTitleFor('Emailuser', $name);
         $keys['$PAGEEDITOR_EMAIL'] = $emailPage->getFullUrl();
     }
     $userPage = $editor->getUserPage();
     $keys['$PAGEEDITOR_WIKI'] = $userPage->getFullUrl();
     $body = strtr($body, $keys);
     $body = wordwrap($body, 72);
     # now save this as the constant user-independent part of the message
     $this->from = $from;
     $this->replyto = $replyto;
     $this->subject = $subject;
     $this->body = $body;
 }
开发者ID:ruizrube,项目名称:spdef,代码行数:86,代码来源:UserMailer.php

示例15: str_replace

        echo $wf->Msg('userlogin-login-heading');
    }
    ?>
		</header>
	<?php 
    if ($loggedIn) {
        ?>
		<ul class=wkLst>
			<li><a class=chg href="<?php 
        echo AvatarService::getUrl($userName);
        ?>
"><?php 
        echo $wf->Msg('wikiamobile-profile');
        ?>
</a></li>
			<li><a class=logout href="<?php 
        echo str_replace("\$1", SpecialPage::getSafeTitleFor('UserLogout')->getPrefixedText() . '?returnto=' . $wg->Title->getPrefixedURL(), $wg->ArticlePath);
        ?>
"><?php 
        echo $wf->Msg('logout');
        ?>
</a></li>
		</ul>
	<?php 
    }
    ?>
	</div>
	<?php 
}
?>
</section>
开发者ID:schwarer2006,项目名称:wikia,代码行数:31,代码来源:WikiaMobileNavigationService_index.php


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