summaryrefslogtreecommitdiff
path: root/www/wiki/skins/chameleon/src/Components/NavbarHorizontal
diff options
context:
space:
mode:
authorYaco <franco@reevo.org>2020-06-04 11:01:00 -0300
committerYaco <franco@reevo.org>2020-06-04 11:01:00 -0300
commitfc7369835258467bf97eb64f184b93691f9a9fd5 (patch)
treedaabd60089d2dd76d9f5fb416b005fbe159c799d /www/wiki/skins/chameleon/src/Components/NavbarHorizontal
first commit
Diffstat (limited to 'www/wiki/skins/chameleon/src/Components/NavbarHorizontal')
-rw-r--r--www/wiki/skins/chameleon/src/Components/NavbarHorizontal/Logo.php54
-rw-r--r--www/wiki/skins/chameleon/src/Components/NavbarHorizontal/Menu.php51
-rw-r--r--www/wiki/skins/chameleon/src/Components/NavbarHorizontal/NavMenu.php51
-rw-r--r--www/wiki/skins/chameleon/src/Components/NavbarHorizontal/PageTools.php159
-rw-r--r--www/wiki/skins/chameleon/src/Components/NavbarHorizontal/PageToolsAdaptable.php209
-rw-r--r--www/wiki/skins/chameleon/src/Components/NavbarHorizontal/PersonalTools.php117
-rw-r--r--www/wiki/skins/chameleon/src/Components/NavbarHorizontal/SearchBar.php55
7 files changed, 696 insertions, 0 deletions
diff --git a/www/wiki/skins/chameleon/src/Components/NavbarHorizontal/Logo.php b/www/wiki/skins/chameleon/src/Components/NavbarHorizontal/Logo.php
new file mode 100644
index 00000000..d4e42823
--- /dev/null
+++ b/www/wiki/skins/chameleon/src/Components/NavbarHorizontal/Logo.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * File holding the NavbarHorizontal\Logo class
+ *
+ * This file is part of the MediaWiki skin Chameleon.
+ *
+ * @copyright 2013 - 2017, Stephan Gambke
+ * @license GNU General Public License, version 3 (or any later version)
+ *
+ * The Chameleon skin is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by the Free
+ * Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
+ *
+ * The Chameleon skin is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @file
+ * @ingroup Skins
+ */
+
+namespace Skins\Chameleon\Components\NavbarHorizontal;
+
+use Skins\Chameleon\Components\Component;
+use Skins\Chameleon\Components\Logo as GenLogo;
+
+/**
+ * The NavbarHorizontal\Logo class.
+ *
+ * Provides a Logo component to be included in a NavbarHorizontal component.
+ *
+ * @author Stephan Gambke
+ * @since 1.6
+ * @ingroup Skins
+ */
+class Logo extends Component {
+
+ /**
+ * @return String
+ */
+ public function getHtml() {
+
+ $logo = new GenLogo( $this->getSkinTemplate(), $this->getDomElement(), $this->getIndent() );
+ $logo->addClasses( 'navbar-brand' );
+
+ return $logo->getHtml();
+ }
+
+} \ No newline at end of file
diff --git a/www/wiki/skins/chameleon/src/Components/NavbarHorizontal/Menu.php b/www/wiki/skins/chameleon/src/Components/NavbarHorizontal/Menu.php
new file mode 100644
index 00000000..e47dca25
--- /dev/null
+++ b/www/wiki/skins/chameleon/src/Components/NavbarHorizontal/Menu.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * File holding the NavbarHorizontal\Menu class
+ *
+ * This file is part of the MediaWiki skin Chameleon.
+ *
+ * @copyright 2013 - 2017, Stephan Gambke
+ * @license GNU General Public License, version 3 (or any later version)
+ *
+ * The Chameleon skin is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by the Free
+ * Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
+ *
+ * The Chameleon skin is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @file
+ * @ingroup Skins
+ */
+
+namespace Skins\Chameleon\Components\NavbarHorizontal;
+
+use Skins\Chameleon\Components\Component;
+use Skins\Chameleon\Components\Menu as GenMenu;
+
+/**
+ * The NavbarHorizontal\Logo class.
+ *
+ * Provides a Menu component to be included in a NavbarHorizontal component.
+ *
+ * @author Stephan Gambke
+ * @since 1.6
+ * @ingroup Skins
+ */
+class Menu extends Component {
+
+ /**
+ * @return String
+ */
+ public function getHtml() {
+ $menu = new GenMenu( $this->getSkinTemplate(), $this->getDomElement(), $this->getIndent() );;
+ return '<ul class="nav navbar-nav">' . $menu->getHtml() . "</ul>\n";
+ }
+
+} \ No newline at end of file
diff --git a/www/wiki/skins/chameleon/src/Components/NavbarHorizontal/NavMenu.php b/www/wiki/skins/chameleon/src/Components/NavbarHorizontal/NavMenu.php
new file mode 100644
index 00000000..1cc15c28
--- /dev/null
+++ b/www/wiki/skins/chameleon/src/Components/NavbarHorizontal/NavMenu.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * File holding the NavbarHorizontal\NavMenu class
+ *
+ * This file is part of the MediaWiki skin Chameleon.
+ *
+ * @copyright 2013 - 2017, Stephan Gambke
+ * @license GNU General Public License, version 3 (or any later version)
+ *
+ * The Chameleon skin is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by the Free
+ * Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
+ *
+ * The Chameleon skin is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @file
+ * @ingroup Skins
+ */
+
+namespace Skins\Chameleon\Components\NavbarHorizontal;
+
+use Skins\Chameleon\Components\Component;
+use Skins\Chameleon\Components\NavMenu as GenNavMenu;
+
+/**
+ * The NavbarHorizontal\NavMenu class.
+ *
+ * Provides a NavMenu component to be included in a NavbarHorizontal component.
+ *
+ * @author Stephan Gambke
+ * @since 1.6
+ * @ingroup Skins
+ */
+class NavMenu extends Component {
+
+ /**
+ * @return String
+ */
+ public function getHtml() {
+ $navMenu = new GenNavMenu( $this->getSkinTemplate(), $this->getDomElement(), $this->getIndent() );;
+ return '<ul class="nav navbar-nav">' . $navMenu->getHtml() . "</ul>\n";
+ }
+
+} \ No newline at end of file
diff --git a/www/wiki/skins/chameleon/src/Components/NavbarHorizontal/PageTools.php b/www/wiki/skins/chameleon/src/Components/NavbarHorizontal/PageTools.php
new file mode 100644
index 00000000..58776077
--- /dev/null
+++ b/www/wiki/skins/chameleon/src/Components/NavbarHorizontal/PageTools.php
@@ -0,0 +1,159 @@
+<?php
+/**
+ * File holding the NavbarHorizontal\PageTools class
+ *
+ * This file is part of the MediaWiki skin Chameleon.
+ *
+ * @copyright 2013 - 2017, Stephan Gambke
+ * @license GNU General Public License, version 3 (or any later version)
+ *
+ * The Chameleon skin is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by the Free
+ * Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
+ *
+ * The Chameleon skin is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @file
+ * @ingroup Skins
+ */
+
+namespace Skins\Chameleon\Components\NavbarHorizontal;
+
+use Skins\Chameleon\Components\Component;
+use Skins\Chameleon\Components\PageTools as GenPageTools;
+
+/**
+ * The NavbarHorizontal\PageTools class.
+ *
+ * Provides a PageTools component to be included in a NavbarHorizontal component.
+ *
+ * @author Stephan Gambke
+ * @since 1.6
+ * @ingroup Skins
+ */
+class PageTools extends Component {
+
+ /**
+ * @return String
+ */
+ public function getHtml() {
+
+ $ret = '';
+
+ $pageTools = new GenPageTools( $this->getSkinTemplate(), $this->getDomElement(), $this->getIndent() + 1 );
+
+ $pageTools->setFlat( true );
+ $pageTools->removeClasses( 'text-center list-inline' );
+ $pageTools->addClasses( 'dropdown-menu' );
+
+ $editLinkHtml = $this->getEditLinkHtml( $pageTools );
+
+ $pageToolsHtml = $pageTools->getHtml();
+
+ if ( $editLinkHtml || $pageToolsHtml ) {
+ $ret =
+ $this->indent() . '<!-- page tools -->' .
+ $this->indent() . '<ul class="navbar-tools navbar-nav" >';
+
+ if ( $editLinkHtml !== '' ) {
+ $ret .= $this->indent( 1 ) . $editLinkHtml;
+ }
+
+ if ( $pageToolsHtml !== '' ) {
+ $ret .=
+ $this->indent( $editLinkHtml !== '' ? 0 : 1 ) . '<li class="navbar-tools-tools dropdown">' .
+ $this->indent( 1 ) . '<a data-toggle="dropdown" class="dropdown-toggle" href="#" title="' . $this->getSkinTemplate()->getMsg( 'specialpages-group-pagetools' )->text() . '" ><span>...</span></a>' .
+ $pageToolsHtml .
+ $this->indent( -1 ) . '</li>';
+ }
+ $ret .=
+ $this->indent( $editLinkHtml !== '' ? 0 : -1 ) . '</ul>' . "\n";
+ }
+
+ return $ret;
+ }
+
+ /**
+ * @param GenPageTools $pageTools
+ * @return string
+ */
+ protected function getEditLinkHtml( $pageTools ) {
+
+ $pageToolsStructure = $pageTools->getPageToolsStructure();
+
+ if ( ! array_key_exists( 'views', $pageToolsStructure ) ) {
+ return '';
+ }
+
+ foreach ( $this->getReplaceableEditActionIds() as $id ) {
+
+ if ( array_key_exists( $id, $pageToolsStructure[ 'views' ] ) ) {
+ return $this->getLinkAndRemoveFromPageToolStructure( $pageTools, $id );
+ }
+ }
+
+ return '';
+ }
+
+ /**
+ * @param GenPageTools $pageTools
+ * @param string $editActionId
+ *
+ * @return string
+ */
+ protected function getLinkAndRemoveFromPageToolStructure( $pageTools, $editActionId ) {
+
+ $pageToolsStructure = $pageTools->getPageToolsStructure();
+ $editActionStructure = $pageToolsStructure[ 'views' ][ $editActionId ];
+
+ $editActionStructure[ 'text' ] = '';
+
+ if ( array_key_exists( 'class', $editActionStructure ) ) {
+ $editActionStructure[ 'class' ] .= ' navbar-tools-tools';
+ } else {
+ $editActionStructure[ 'class' ] = 'navbar-tools-tools';
+ }
+
+ $options = array (
+ 'text-wrapper' => array(
+ 'tag' => 'span',
+ 'attributes' => array('class' => 'glyphicon glyphicon-pencil',)
+ ),
+ );
+
+ $editLinkHtml = $this->getSkinTemplate()->makeListItem(
+ $editActionId,
+ $editActionStructure,
+ $options
+ );
+
+ $pageTools->setRedundant( $editActionId );
+
+ return $editLinkHtml;
+ }
+
+ /**
+ * @return string[]
+ */
+ protected function getReplaceableEditActionIds() {
+
+ $editActionIds = array( 've-edit', 'edit' );
+
+ if ( array_key_exists( 'sfgRenameEditTabs', $GLOBALS ) && $GLOBALS[ 'sfgRenameEditTabs' ] === true ||
+ array_key_exists( 'wgPageFormsRenameEditTabs', $GLOBALS ) && $GLOBALS[ 'wgPageFormsRenameEditTabs' ] === true ) {
+
+ $editActionIds = array_merge( array( 'formedit', 'form_edit' ), $editActionIds );
+ }
+
+ return $editActionIds;
+ }
+
+
+} \ No newline at end of file
diff --git a/www/wiki/skins/chameleon/src/Components/NavbarHorizontal/PageToolsAdaptable.php b/www/wiki/skins/chameleon/src/Components/NavbarHorizontal/PageToolsAdaptable.php
new file mode 100644
index 00000000..e82e2ada
--- /dev/null
+++ b/www/wiki/skins/chameleon/src/Components/NavbarHorizontal/PageToolsAdaptable.php
@@ -0,0 +1,209 @@
+<?php
+/**
+ * File holding the NavbarHorizontal\PageToolsAdaptable class
+ *
+ * This file is part of the MediaWiki skin Chameleon.
+ *
+ * @copyright 2013 - 2017, Stephan Gambke
+ * @license GNU General Public License, version 3 (or any later version)
+ *
+ * The Chameleon skin is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by the Free
+ * Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
+ *
+ * The Chameleon skin is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @file
+ * @ingroup Skins
+ */
+
+
+namespace Skins\Chameleon\Components\NavbarHorizontal;
+
+use Skins\Chameleon\Components\PageTools as GenPageTools;
+
+/**
+ * The NavbarHorizontal\PageToolsAdaptable class.
+ *
+ * Provides an adaptable PageTools component to be included in a NavbarHorizontal component.
+ *
+ * @author Tobias Oetterer
+ * @since 1.6
+ * @ingroup Skins
+ */
+class PageToolsAdaptable extends PageTools
+{
+
+ const GLYPH_ICON_UNKNOWN_ACTION = 'asterisk';
+
+ /**
+ * @var string[]
+ */
+ private $mShowActions = null;
+
+ /**
+ * @var string[]
+ */
+ private $mValidActionsToShow = null;
+
+ /**
+ * @var array
+ */
+ private static $sGlyphIconForAction = array(
+ 'delete' => 'trash',
+ 'edit' => 'edit',
+ 'formedit' => 'list-alt',
+ 'history' => 'education',
+ 'move' => 'share-alt',
+ 'protect' => 'folder-close',
+ 'purge' => 'repeat',
+ 'undelete' => 'road',
+ 'unprotect' => 'folder-open',
+ 'unwatch' => 'star',
+ 've-edit' => 'pencil',
+ 'view' => 'eye-open',
+ 'watch' => 'star-empty',
+ );
+
+ /**
+ * @param string $action
+ * @param string $fallback
+ * @return null|string
+ */
+ public static function getGlyphIconForAction( $action, $fallback = null ) {
+ if ( isset( self::$sGlyphIconForAction[$action] ) ) {
+ return self::$sGlyphIconForAction[$action];
+ }
+ return $fallback !== null ? $fallback : self::GLYPH_ICON_UNKNOWN_ACTION;
+ }
+
+ /**
+ * @param string $icon
+ * @param string $action
+ */
+ public static function setGlyphIconForAction( $icon, $action ) {
+ if ( is_string( $icon ) && $icon && is_string( $action ) && $action ) {
+ self::$sGlyphIconForAction[$action] = $icon;
+ }
+ }
+
+ /**
+ * @param GenPageTools $pageTools
+ * @return string
+ * @throws \MWException
+ */
+ protected function getEditLinkHtml( $pageTools ) {
+
+ $pageToolsStructure = $pageTools->getPageToolsStructure();
+ if ( !array_key_exists( 'views', $pageToolsStructure ) ) {
+ return '';
+ }
+
+ $items = array();
+
+ $showActions = $this->getShowActions( $pageTools );
+
+ foreach ( $showActions as $actionId ) {
+
+ if ( array_key_exists( $actionId, $pageToolsStructure['views'] ) ) {
+ $items[] = $this->getLinkAndRemoveFromPageToolStructure( $pageTools, $actionId );
+ }
+ }
+
+ return implode(
+ $this->indent() . '</ul>' . $this->indent() . '<ul class="navbar-tools navbar-nav" >' . $this->indent() . "\t",
+ $items
+ );
+ }
+
+ /**
+ * @param string $action
+ * @return string
+ */
+ protected function getGlyphIconClassFor( $action ) {
+ return 'glyphicon glyphicon-' . self::getGlyphIconForAction( $action );
+ }
+
+ /**
+ * @param GenPageTools $pageTools
+ * @param string $editActionId
+ *
+ * @return string
+ */
+ protected function getLinkAndRemoveFromPageToolStructure( $pageTools, $editActionId ) {
+
+ $pageToolsStructure = $pageTools->getPageToolsStructure();
+ $editActionStructure = $pageToolsStructure['views'][$editActionId];
+
+ $editActionStructure['text'] = '';
+
+ if ( array_key_exists( 'class', $editActionStructure ) ) {
+ $editActionStructure['class'] .= ' navbar-tools-tools';
+ } else {
+ $editActionStructure['class'] = 'navbar-tools-tools';
+ }
+
+ $options = array(
+ 'text-wrapper' => array(
+ 'tag' => 'span',
+ 'attributes' => array( 'class' => $this->getGlyphIconClassFor( $editActionId ), ),
+ ),
+ );
+
+ $editLinkHtml = $this->getSkinTemplate()->makeListItem(
+ $editActionId,
+ $editActionStructure,
+ $options
+ );
+
+ $pageTools->setRedundant( $editActionId );
+
+ return $editLinkHtml;
+ }
+
+ /**
+ * @param @param GenPageTools $pageTools
+ * @return string[]|null
+ */
+ protected function getShowActions( $pageTools ) {
+ if ( $this->mShowActions !== null ) {
+ return $this->mShowActions;
+ }
+ $showActions = array();
+
+ $showAttributesString = $this->getDomElement() !== null ? $this->getDomElement()->getAttribute( 'show' ) : '';
+
+ if ( $showAttributesString != '' ) {
+ foreach ( explode( ',', $showAttributesString ) as $requestedShowAction ) {
+ if ( in_array( $requestedShowAction, $this->getValidActionsToShow( $pageTools ) ) ) {
+ $showActions[] = $requestedShowAction;
+ }
+ }
+ }
+ return $this->mShowActions = $showActions;
+ }
+
+ /**
+ * @param GenPageTools $pageTools
+ * @return string[]
+ */
+ protected function getValidActionsToShow( $pageTools ) {
+ if ( $this->mValidActionsToShow !== null ) {
+ return $this->mValidActionsToShow;
+ }
+ $pageToolsStructure = $pageTools->getPageToolsStructure();
+ $validActionsToShow = array();
+
+ foreach ( $pageToolsStructure as $group => $groupStructure ) {
+ $validActionsToShow = array_merge( $validActionsToShow, array_keys( $groupStructure ) );
+ }
+ return $this->mValidActionsToShow = $validActionsToShow;
+ }
+} \ No newline at end of file
diff --git a/www/wiki/skins/chameleon/src/Components/NavbarHorizontal/PersonalTools.php b/www/wiki/skins/chameleon/src/Components/NavbarHorizontal/PersonalTools.php
new file mode 100644
index 00000000..540e10d0
--- /dev/null
+++ b/www/wiki/skins/chameleon/src/Components/NavbarHorizontal/PersonalTools.php
@@ -0,0 +1,117 @@
+<?php
+/**
+ * File holding the NavbarHorizontal\PersonalTools class
+ *
+ * This file is part of the MediaWiki skin Chameleon.
+ *
+ * @copyright 2013 - 2017, Stephan Gambke
+ * @license GNU General Public License, version 3 (or any later version)
+ *
+ * The Chameleon skin is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by the Free
+ * Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
+ *
+ * The Chameleon skin is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @file
+ * @ingroup Skins
+ */
+
+namespace Skins\Chameleon\Components\NavbarHorizontal;
+
+use Hooks;
+use Skins\Chameleon\Components\Component;
+
+/**
+ * The NavbarHorizontal\PersonalTools class.
+ *
+ * Provides a PersonalTools component to be included in a NavbarHorizontal component.
+ *
+ * @author Stephan Gambke
+ * @since 1.6
+ * @ingroup Skins
+ */
+class PersonalTools extends Component {
+
+ /**
+ * @return String
+ */
+ public function getHtml() {
+
+ $user = $this->getSkinTemplate()->getSkin()->getUser();
+
+ if ( $user->isLoggedIn() ) {
+ $toolsClass = 'navbar-userloggedin';
+ $toolsLinkText = $this->getSkinTemplate()->getMsg( 'chameleon-loggedin' )->params( $user->getName() )->text();
+ } else {
+ $toolsClass = 'navbar-usernotloggedin';
+ $toolsLinkText = $this->getSkinTemplate()->getMsg( 'chameleon-notloggedin' )->text();
+ }
+
+ $linkText = '<span class="glyphicon glyphicon-user"></span>';
+ \Hooks::run('ChameleonNavbarHorizontalPersonalToolsLinkText', array( &$linkText, $this->getSkin() ) );
+
+ // start personal tools element
+ $ret =
+ $this->indent() . '<!-- personal tools -->' .
+ $this->indent() . '<ul class="'.$this->getClassString().' navbar-tools navbar-nav" >' .
+ $this->indent( 1 ) . '<li class="dropdown navbar-tools-tools">' .
+ $this->indent( 1 ) . '<a class="dropdown-toggle ' . $toolsClass . '" href="#" data-toggle="dropdown" title="' . $toolsLinkText . '" >' . $linkText . '</a>' .
+ $this->indent() . '<ul class="p-personal-tools dropdown-menu dropdown-menu-right" >';
+
+ $this->indent( 1 );
+
+ // add personal tools (links to user page, user talk, prefs, ...)
+ foreach ( $this->getSkinTemplate()->getPersonalTools() as $key => $item ) {
+ $ret .= $this->indent() . $this->getSkinTemplate()->makeListItem( $key, $item );
+ }
+
+ $ret .=
+ $this->indent( -1 ) . '</ul>' .
+ $this->indent( -1 ) . '</li>';
+
+ // if the user is logged in, add the newtalk notifier
+ if ( $user->isLoggedIn() ) {
+
+ $newMessagesAlert = '';
+ $newtalks = $user->getNewMessageLinks();
+ $out = $this->getSkinTemplate()->getSkin()->getOutput();
+
+ // Allow extensions to disable the new messages alert;
+ // since we do not display the link text, we ignore the actual value returned in $newMessagesAlert
+ if ( Hooks::run( 'GetNewMessagesAlert', array( &$newMessagesAlert, $newtalks, $user, $out ) ) ) {
+
+ if ( count( $user->getNewMessageLinks() ) > 0 ) {
+ $newtalkClass = 'navbar-newtalk-available';
+ $newtalkLinkText = $this->getSkinTemplate()->getMsg( 'chameleon-newmessages' )->text();
+ } else {
+ $newtalkClass = 'navbar-newtalk-not-available';
+ $newtalkLinkText = $this->getSkinTemplate()->getMsg( 'chameleon-nonewmessages' )->text();
+ }
+
+ $linkText = '<span class="glyphicon glyphicon-envelope"></span>';
+ \Hooks::run('ChameleonNavbarHorizontalNewTalkLinkText', array( &$linkText, $this->getSkin() ) );
+
+ $ret .= $this->indent() . '<li class="navbar-newtalk-notifier">' .
+ $this->indent( 1 ) . '<a class="dropdown-toggle ' . $newtalkClass . '" title="' .
+ $newtalkLinkText . '" href="' . $user->getTalkPage()->getLinkURL( 'redirect=no' ) . '">' . $linkText . '</a>' .
+ $this->indent( -1 ) . '</li>';
+
+ }
+
+ }
+
+ $ret .= $this->indent( -1 ) . '</ul>' . "\n";
+
+ return $ret;
+ }
+
+
+}
diff --git a/www/wiki/skins/chameleon/src/Components/NavbarHorizontal/SearchBar.php b/www/wiki/skins/chameleon/src/Components/NavbarHorizontal/SearchBar.php
new file mode 100644
index 00000000..d665b2d9
--- /dev/null
+++ b/www/wiki/skins/chameleon/src/Components/NavbarHorizontal/SearchBar.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * File holding the NavbarHorizontal\PersonalTools class
+ *
+ * This file is part of the MediaWiki skin Chameleon.
+ *
+ * @copyright 2013 - 2017, Stephan Gambke
+ * @license GNU General Public License, version 3 (or any later version)
+ *
+ * The Chameleon skin is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by the Free
+ * Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
+ *
+ * The Chameleon skin is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @file
+ * @ingroup Skins
+ */
+
+namespace Skins\Chameleon\Components\NavbarHorizontal;
+
+use Skins\Chameleon\Components\Component;
+use Skins\Chameleon\Components\SearchBar as GenericSearchBar;
+
+/**
+ * The NavbarHorizontal\PersonalTools class.
+ *
+ * Provides a SearchBar component to be included in a NavbarHorizontal component.
+ *
+ * @author Stephan Gambke
+ * @since 1.6
+ * @ingroup Skins
+ */
+class SearchBar extends Component {
+
+ /**
+ * @return String
+ */
+ public function getHtml() {
+
+ $search = new GenericSearchBar( $this->getSkinTemplate(), $this->getDomElement(), $this->getIndent() );
+ $search->addClasses( 'navbar-form' );
+
+ return $search->getHtml();
+ }
+
+
+} \ No newline at end of file