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


PHP Linker::specialLink方法代码示例

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


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

示例1: topLinks

 function topLinks()
 {
     global $wgOut, $wgUser;
     $sep = " |\n";
     $s = $this->getSkin()->mainPageLink() . $sep . Linker::specialLink('Recentchanges');
     if ($wgOut->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 ($wgUser->isAnon()) {
         $s .= $sep . Linker::specialLink('Userlogin');
     } else {
         /* show user page and user talk links */
         $s .= $sep . Linker::link($wgUser->getUserPage(), wfMsgHtml('mypage'));
         $s .= $sep . Linker::link($wgUser->getTalkPage(), wfMsgHtml('mytalk'));
         if ($wgUser->getNewtalk()) {
             $s .= ' *';
         }
         /* show watchlist link */
         $s .= $sep . Linker::specialLink('Watchlist');
         /* show my contributions link */
         $s .= $sep . Linker::link(SpecialPage::getSafeTitleFor('Contributions', $wgUser->getName()), wfMsgHtml('mycontris'));
         /* show my preferences link */
         $s .= $sep . Linker::specialLink('Preferences');
         /* show upload file link */
         if (UploadBase::isEnabled() && UploadBase::isAllowed($wgUser) === true) {
             $s .= $sep . $this->getUploadLink();
         }
         /* show log out link */
         $s .= $sep . $this->getSkin()->specialLink('Userlogout');
     }
     $s .= $sep . $this->specialPagesList();
     return $s;
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:36,代码来源:Nostalgia.php

示例2: specialLink

 public function specialLink($name, $key = '')
 {
     return Linker::specialLink($name, $key);
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:4,代码来源:DummyLinker.php

示例3: nameAndLogin

 function nameAndLogin()
 {
     global $wgUser, $wgLang, $wgRequest;
     $returnTo = $this->getSkin()->getTitle();
     $ret = '';
     if ($wgUser->isAnon()) {
         if ($this->getSkin()->showIPinHeader()) {
             $name = $wgRequest->getIP();
             $talkLink = Linker::link($wgUser->getTalkPage(), $wgLang->getNsText(NS_TALK));
             $talkLink = wfMessage('parentheses')->rawParams($talkLink)->escaped();
             $ret .= "{$name} {$talkLink}";
         } else {
             $ret .= wfMessage('notloggedin')->text();
         }
         $query = array();
         if (!$returnTo->isSpecial('Userlogout')) {
             $query['returnto'] = $returnTo->getPrefixedDBkey();
         }
         $loginlink = $wgUser->isAllowed('createaccount') ? 'nav-login-createaccount' : 'login';
         $ret .= "\n<br />" . Linker::link(SpecialPage::getTitleFor('Userlogin'), wfMessage($loginlink)->text(), array(), $query);
     } else {
         $talkLink = Linker::link($wgUser->getTalkPage(), $wgLang->getNsText(NS_TALK));
         $talkLink = wfMessage('parentheses')->rawParams($talkLink)->escaped();
         $ret .= Linker::link($wgUser->getUserPage(), htmlspecialchars($wgUser->getName()));
         $ret .= " {$talkLink}<br />";
         $ret .= $wgLang->pipeList(array(Linker::link(SpecialPage::getTitleFor('Userlogout'), wfMessage('logout')->text(), array(), array('returnto' => $returnTo->getPrefixedDBkey())), Linker::specialLink('Preferences')));
     }
     $ret = $wgLang->pipeList(array($ret, Linker::link(Title::newFromText(wfMessage('helppage')->inContentLanguage()->text()), wfMessage('help')->text())));
     return $ret;
 }
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:30,代码来源:SkinLegacy.php

示例4: 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

示例5: quickBar

 function quickBar()
 {
     global $wgOut, $wgUser, $wgRequest, $wgContLang;
     wfProfileIn(__METHOD__);
     $action = $wgRequest->getText('action');
     $wpPreview = $wgRequest->getBool('wpPreview');
     $tns = $this->getSkin()->getTitle()->getNamespace();
     $s = "\n<div id='quickbar'>";
     $s .= "\n" . $this->getSkin()->logoText() . "\n<hr class='sep' />";
     $sep = "\n<br />";
     # 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 $browseLinks) {
         if (is_array($browseLinks)) {
             if ($barnumber > 1) {
                 $s .= "\n<hr class='sep' />";
             }
             foreach ($browseLinks as $link) {
                 if ($link['text'] != '-') {
                     $s .= "<a href=\"{$link['href']}\">" . htmlspecialchars($link['text']) . '</a>' . $sep;
                 }
             }
         }
         if ($barnumber == 1) {
             // only show watchlist link if logged in
             if ($wgUser->isLoggedIn()) {
                 $s .= Linker::specialLink('Watchlist');
                 $s .= $sep . Linker::linkKnown(SpecialPage::getTitleFor('Contributions'), wfMsg('mycontris'), array(), array('target' => $wgUser->getName()));
             }
         }
         $barnumber = $barnumber + 1;
     }
     $s .= "\n<hr class='sep' />";
     $articleExists = $this->getSkin()->getTitle()->getArticleId();
     if ($wgOut->isArticle() || $action == 'edit' || $action == 'history' || $wpPreview) {
         if ($wgOut->isArticle()) {
             $s .= '<strong>' . $this->editThisPage() . '</strong>';
         } else {
             # backlink to the article in edit or history mode
             if ($articleExists) {
                 # no backlink if no article
                 switch ($tns) {
                     case NS_TALK:
                     case NS_USER_TALK:
                     case NS_PROJECT_TALK:
                     case NS_FILE_TALK:
                     case NS_MEDIAWIKI_TALK:
                     case NS_TEMPLATE_TALK:
                     case NS_HELP_TALK:
                     case NS_CATEGORY_TALK:
                         $text = wfMsg('viewtalkpage');
                         break;
                     case NS_MAIN:
                         $text = wfMsg('articlepage');
                         break;
                     case NS_USER:
                         $text = wfMsg('userpage');
                         break;
                     case NS_PROJECT:
                         $text = wfMsg('projectpage');
                         break;
                     case NS_FILE:
                         $text = wfMsg('imagepage');
                         break;
                     case NS_MEDIAWIKI:
                         $text = wfMsg('mediawikipage');
                         break;
                     case NS_TEMPLATE:
                         $text = wfMsg('templatepage');
                         break;
                     case NS_HELP:
                         $text = wfMsg('viewhelppage');
                         break;
                     case NS_CATEGORY:
                         $text = wfMsg('categorypage');
                         break;
                     default:
                         $text = wfMsg('articlepage');
                 }
                 $link = $this->getSkin()->getTitle()->getText();
                 $nstext = $wgContLang->getNsText($tns);
                 if ($nstext) {
                     # add namespace if necessary
                     $link = $nstext . ':' . $link;
                 }
                 $s .= Linker::link(Title::newFromText($link), $text);
             } elseif ($this->getSkin()->getTitle()->getNamespace() != NS_SPECIAL) {
                 # we just throw in a "New page" text to tell the user that he's in edit mode,
                 # and to avoid messing with the separator that is prepended to the next item
                 $s .= '<strong>' . wfMsg('newpage') . '</strong>';
             }
         }
         # "Post a comment" link
         if (($this->getSkin()->getTitle()->isTalkPage() || $wgOut->showNewSectionLink()) && $action != 'edit' && !$wpPreview) {
             $s .= '<br />' . $this->getSkin()->link($this->getSkin()->getTitle(), wfMsg('postcomment'), array(), array('action' => 'edit', 'section' => 'new'), array('known', 'noclasses'));
         }
//.........这里部分代码省略.........
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:101,代码来源:Standard.php

示例6: execute


//.........这里部分代码省略.........
			<ul id="top-bar-right" class="right">
				<li class="has-form">
					<form action="<?php 
        $this->text('wgScript');
        ?>
" id="searchform" class="mw-search">
						<div class="row">
						<div class="small-12 columns">
							<?php 
        echo $this->makeSearchInput(array('placeholder' => wfMessage('searchsuggest-search')->text(), 'id' => 'searchInput'));
        ?>
							<button type="submit" class="button search"><?php 
        echo wfMessage('search')->text();
        ?>
</button>
						</div>
						</div>
					</form>
				</li>
				<li class="divider show-for-small"></li>
				<li class="has-form">

				<li class="has-dropdown active"><a href="#"><i class="fa fa-cogs"></i></a>
					<ul id="toolbox-dropdown" class="dropdown">
						<?php 
        foreach ($this->getToolbox() as $key => $item) {
            echo $this->makeListItem($key, $item);
        }
        ?>
						<?php 
        if ($wgForegroundFeatures['showRecentChangesUnderTools']) {
            ?>
<li id="n-recentchanges"><?php 
            echo Linker::specialLink('Recentchanges');
            ?>
</li><?php 
        }
        ?>
						<?php 
        if ($wgForegroundFeatures['showHelpUnderTools']) {
            ?>
<li id="n-help" <?php 
            echo Linker::tooltip('help');
            ?>
><a href="/wiki/Help:Contents"><?php 
            echo wfMessage('help')->text();
            ?>
</a></li><?php 
        }
        ?>
					</ul>
				</li>

				<?php 
        if ($wgUser->isLoggedIn()) {
            ?>
				<li id="personal-tools-dropdown" class="has-dropdown active"><a href="#"><i class="fa fa-user"></i></a>
					<ul class="dropdown">
						<?php 
            foreach ($this->getPersonalTools() as $key => $item) {
                echo $this->makeListItem($key, $item);
            }
            ?>
					</ul>
				</li>
开发者ID:reviforks,项目名称:foreground,代码行数:66,代码来源:Foreground.skin.php

示例7: nameAndLogin

 function nameAndLogin()
 {
     global $wgUser, $wgLang, $wgContLang;
     $logoutPage = $wgContLang->specialPage('Userlogout');
     $ret = '';
     if ($wgUser->isAnon()) {
         if ($this->getSkin()->showIPinHeader()) {
             $name = wfGetIP();
             $talkLink = Linker::link($wgUser->getTalkPage(), $wgLang->getNsText(NS_TALK));
             $ret .= "{$name} ({$talkLink})";
         } else {
             $ret .= wfMsg('notloggedin');
         }
         $returnTo = $this->getSkin()->getTitle()->getPrefixedDBkey();
         $query = array();
         if ($logoutPage != $returnTo) {
             $query['returnto'] = $returnTo;
         }
         $loginlink = $wgUser->isAllowed('createaccount') ? 'nav-login-createaccount' : 'login';
         $ret .= "\n<br />" . Linker::link(SpecialPage::getTitleFor('Userlogin'), wfMsg($loginlink), array(), $query);
     } else {
         $returnTo = $this->getSkin()->getTitle()->getPrefixedDBkey();
         $talkLink = Linker::link($wgUser->getTalkPage(), $wgLang->getNsText(NS_TALK));
         $ret .= Linker::link($wgUser->getUserPage(), htmlspecialchars($wgUser->getName()));
         $ret .= " ({$talkLink})<br />";
         $ret .= $wgLang->pipeList(array(Linker::link(SpecialPage::getTitleFor('Userlogout'), wfMsg('logout'), array(), array('returnto' => $returnTo)), Linker::specialLink('Preferences')));
     }
     $ret = $wgLang->pipeList(array($ret, Linker::link(Title::newFromText(wfMsgForContent('helppage')), wfMsg('help'))));
     return $ret;
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:30,代码来源:SkinLegacy.php

示例8: __construct

 public function __construct($title, $options = array())
 {
     parent::__construct($title);
     # Set some form properties
     $this->setSubmitText(wfMessage('uploadbtn')->text());
     $this->setSubmitName('submit');
     #TODO: maybe interesting to get type of submission?
     # Used message keys: 'accesskey-upload', 'tooltip-upload'
     $this->setSubmitTooltip('upload');
     $this->setId('mw-upload-form');
     $image_list_link = Linker::specialLink('Listfiles', 'upload_exp_linktext');
     $this->addHeaderText(wfMessage('upload_exp', $image_list_link)->text());
     $this->addPostText('<br />' . wfMessage('upload_footer', Linker::makeExternalLink(wfMessage('upload_footer_url')->text(), wfMessage('upload_footer_linktext')->text()))->text());
     $this->mSubmitCallback = array($this, 'submit');
 }
开发者ID:n0g,项目名称:AddResource,代码行数:15,代码来源:ResourceForms.php

示例9: quickBar

 /**
  * Compute the sidebar
  * @access private
  */
 private function quickBar()
 {
     global $wgOut, $wgTitle, $wgUser, $wgLang, $wgContLang, $wgEnableUploads;
     $tns = $wgTitle->getNamespace();
     $s = '<div id="toolbar">';
     $s .= '<div class="toolbartitle">Page editing toolbox</div>';
     $s .= '<table border="0" cellpadding="0" cellspacing="4" width="100%"><tr valign="top">';
     $sep = "<br/>";
     // browse section
     $section = "";
     $browseLinks = reset($this->data['sidebar']);
     foreach ($browseLinks as $link) {
         if ($link['text'] != '-') {
             $section .= "<a href=\"{$link['href']}\">" . htmlspecialchars($link['text']) . '</a>' . $sep;
         }
     }
     $s .= $this->AddToolbarSection("qbbrowse", $section);
     // page related sections
     if ($wgOut->isArticle()) {
         $section = "";
         $section .= "<strong>" . $this->editThisPage() . "</strong>";
         $section .= $sep . Linker::makeKnownLinkObj(Title::newFromText(wfMsgForContent("edithelppage")), wfMsg("edithelp"));
         if ($wgUser->isLoggedIn()) {
             $section .= $sep . $this->moveThisPage();
         }
         if ($wgUser->isAllowed('delete')) {
             $dtp = $this->deleteThisPage();
             if ("" != $dtp) {
                 $section .= $sep . $dtp;
             }
         }
         if ($wgUser->isAllowed('protect')) {
             $ptp = $this->protectThisPage();
             if ("" != $ptp) {
                 $section .= $sep . $ptp;
             }
         }
         $section .= $sep;
         $s .= $this->AddToolbarSection("qbedit", $section);
         $section = "";
         $section .= $this->talkLink() . $sep . $this->commentLink() . $sep . $this->printableLink();
         if ($wgUser->isLoggedIn()) {
             $section .= $sep . $this->watchThisPage();
         }
         $section .= $sep;
         $s .= $this->AddToolbarSection("qbpageoptions", $section);
         $section = "";
         $section .= $this->historyLink() . $sep . $this->whatLinksHere() . $sep . $this->watchPageLinksLink();
         if ($tns == NS_USER || $tns == NS_USER_TALK) {
             $id = User::idFromName($wgTitle->getText());
             if ($id != 0) {
                 $section .= $sep . $this->userContribsLink();
                 if ($this->getSkin()->showEmailUser($id)) {
                     $section .= $sep . $this->emailUserLink();
                 }
             }
         }
         $section .= $sep;
         $s .= $this->AddToolbarSection("qbpageinfo", $section);
     }
     // login/user section
     $section = "";
     if ($wgUser->isLoggedIn()) {
         $name = $wgUser->getName();
         $tl = Linker::makeKnownLinkObj($wgUser->getTalkPage(), wfMsg('mytalk'));
         if ($wgUser->getNewtalk()) {
             $tl .= " *";
         }
         $section .= Linker::makeKnownLinkObj($wgUser->getUserPage(), wfMsg("mypage")) . $sep . $tl . $sep . Linker::specialLink("watchlist") . $sep . Linker::makeKnownLinkObj(SpecialPage::getSafeTitleFor("Contributions", $wgUser->getName()), wfMsg("mycontris")) . $sep . Linker::specialLink("preferences") . $sep . Linker::specialLink("userlogout");
     } else {
         $section .= Linker::specialLink("userlogin");
     }
     $s .= $this->AddToolbarSection("qbmyoptions", $section);
     // special spages section
     $section = "";
     $section .= Linker::specialLink("newpages") . $sep . Linker::specialLink("imagelist") . $sep . Linker::specialLink("statistics");
     if ($wgUser->isLoggedIn() && $wgEnableUploads) {
         $section .= $sep . Linker::specialLink("upload");
     }
     global $wgSiteSupportPage;
     if ($wgSiteSupportPage) {
         $section .= $sep . "<a href=\"" . htmlspecialchars($wgSiteSupportPage) . "\" class =\"internal\">" . wfMsg("sitesupport") . "</a>";
     }
     $section .= $sep . Linker::makeKnownLinkObj(SpecialPage::getTitleFor('Specialpages'), wfMsg('moredotdotdot'));
     $s .= $this->AddToolbarSection("qbspecialpages", $section);
     $s .= '</tr></table>';
     $s .= '</div>';
     return $s;
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:93,代码来源:SpringNew.php


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