Add items to navbar

Version 2021/07

The new functions allow you to add custom links, texts and even custom dropdown menus (and menuitems) to your top navigation bar.

custom drodown menu

Code

<!-- file: hooks/header-extras.php -->
<script>
var navbar = AppGiniHelper.common.getNavbar();
var dropdown = navbar.addDropdown("Help", "question-sign", NavPosition.Right);
dropdown.addDivider("This application");
dropdown.addLink("General help", "#", "_help");
dropdown.addLink("drag & drop", "#", "_help");
dropdown.addDivider();
dropdown.addLink("Required permissions", "#", "_help");
dropdown.addLink("Help on workflow", "#", "_help");
dropdown.addDivider("Related apps");
dropdown.addLink("Help on PDF-File creation", "#", "_help");
dropdown.addDivider("Need help?");
dropdown.addLink("Support", "#", "_help");
// ...
<script>

Code

<!-- file: hooks/header-extras.php -->
<script>
// ...
var navbar = AppGiniHelper.common.getNavbar();
navbar.addText("Click there &rarr;");
navbar.addLink("Link", "index.php", "flash");
// ...
<script>

Code

<!-- file: hooks/header-extras.php -->
<script>
// ...
var navbar = AppGiniHelper.common.getNavbar();
navbar.addSearch("attachments_view.php", "search in pdf files");
// ...
</script>

This creates a custom search input field, named SearchString, with custom placeholder and search-button.

As first parameter (URL) you can use any existing TABLENAME_view.php file, create any custom page or use any other webpage.


Version 2021/07

<!-- file: hooks/header-extras.php -->
<script>
// ...
AppGiniHelper.common.getNavbar().addLink("text", "href", "icon", NavPosition.left);
// ...
<script>

Add Text

Version 2021/07

<!-- file: hooks/header-extras.php -->
<script>
// ...
AppGiniHelper.common.getNavbar().addText("text", NavPosition.left);
// ...
</script>

Add custom Dropdown menu

Version 2021/07

<!-- file: hooks/header-extras.php -->
<script>
// ...
var dropdown = AppGiniHelper.common.getNavbar().addDropdown("text", "icon", NavPosition.left);
// ...
</script>

Add items to custom Dropdown menu

<!-- file: hooks/header-extras.php -->
<script>
// ...
dropdown.addLink("text", "href", "icon");
// optional 4th parameter: target (string), for example "_self", "_blank", "tab_name"
// ...
</script>
Add Button
<!-- file: hooks/header-extras.php -->
<script>
// ...
dropdown.addButton("text", function() { /* your code here*/ }, "icon");
// ...
</script>
Add Divider line
<!-- file: hooks/header-extras.php -->
<script>
// ...
dropdown.addDivider();
// ...
</script>
Add Divider with text
<!-- file: hooks/header-extras.php -->
<script>
// ...
dropdown.addDivider("More");
// ...
</script>

Add custom search input field

Version 2021/07

<!-- file: hooks/header-extras.php -->
<script>
// ...
AppGiniHelper.common.getNavbar().addSearch("url", "placeholder", "value");
// ...
</script>

Do you like it?