stable

Clone or download

Read-only

request #8773: Allow plugins to display a link in the navbar

Completely refactor teh way navbar is built under FlamingParrot so that a plugin can introduce itself. Usage is: Listen to the hook: $this->addHook(Event::NAVBAR_ITEMS); Insert stuff in the collection. For example in the tracker plugin: public function navbar_items(array $params) { $params['items']->addItemAfterAnotherOne('project', new FlamingParrot_NavBarItemLinkPresenter( 'trackers', strpos($params['request_uri'], '/plugins/tracker/?group_id=101') === 0, '/plugins/tracker/?group_id=101', 'My Corporate Trackers' )); } You can insert a link at the end of the collection (addItem) or after an existing item like in the example above. Change-Id: I6c7aa67171d6f0929b07aa6912e0d632ef1f8a4a

Modified Files

Name
M src/common/event/Event.class.php +54 −44 Go to diff View file
M src/www/themes/FlamingParrot/FlamingParrot_Theme.class.php +17 −4 Go to diff View file
A src/www/themes/FlamingParrot/NavBarItemDropdownPresenter.php +43 −0 Go to diff View file
A src/www/themes/FlamingParrot/NavBarItemDropdownSectionPresenter.php +35 −0 Go to diff View file
A src/www/themes/FlamingParrot/NavBarItemLinkPresenter.php +33 −0 Go to diff View file
A src/www/themes/FlamingParrot/NavBarItemPresenter.php +34 −0 Go to diff View file
A src/www/themes/FlamingParrot/NavBarItemPresentersCollection.php +44 −0 Go to diff View file
A src/www/themes/FlamingParrot/NavBarItemPresentersCollectionBuilder.php +191 −0 Go to diff View file
A src/www/themes/FlamingParrot/NavBarItemProjectsPresenter.php +58 −0 Go to diff View file
M src/www/themes/FlamingParrot/NavBarPresenter.class.php +6 −124 Go to diff View file
D src/www/themes/FlamingParrot/templates/navbar-extra-tabs.mustache +0 −15 Go to diff View file
D src/www/themes/FlamingParrot/templates/navbar-help.mustache +0 −24 Go to diff View file
A src/www/themes/FlamingParrot/templates/navbar-item-dropdown.mustache +16 −0 Go to diff View file
A src/www/themes/FlamingParrot/templates/navbar-item-link.mustache +5 −0 Go to diff View file
D src/www/themes/FlamingParrot/templates/navbar-project.mustache +0 −48 Go to diff View file
A src/www/themes/FlamingParrot/templates/navbar-projects.mustache +37 −0 Go to diff View file
M src/www/themes/FlamingParrot/templates/navbar.mustache +11 −23 Go to diff View file