implement zm about menu

This commit is contained in:
Andrew Bauer 2020-08-03 15:22:46 -05:00
parent ab9a135759
commit 9d88f8ee73
2 changed files with 26 additions and 2 deletions

View File

@ -1578,6 +1578,20 @@ our @options = (
type => $types{string}, type => $types{string},
category => 'web', category => 'web',
}, },
{
name => 'ZM_HOME_ABOUT',
default => 'yes',
description => 'Whether enable the ZoneMinder About menu.',
help => q`
When enabled, the ZoneMinder logo in the top left corner of the
navigation bar becomes a menu with links to: the ZoneMinder
website, ZoneMinder Documentation, and the ZoneMinder forum.
End users wishing to rebrand their system may want to disable this
as the menu items are currently hard coded.
`,
type => $types{boolean},
category => 'web',
},
{ {
name => 'ZM_WEB_CONSOLE_BANNER', name => 'ZM_WEB_CONSOLE_BANNER',
default => '', default => '',

View File

@ -605,11 +605,21 @@ function getZMVersionHTML() {
return $result; return $result;
} }
// Returns the html representing the ZoneMinder logo // Returns the html representing the ZoneMinder logo and about menu
function getNavBrandHTML() { function getNavBrandHTML() {
$result = ''; $result = '';
$zm_home_about = true;
if ( $zm_home_about ) {
$result .= '<a id="getNavBrandHTML" class="dropdown" data-toggle="dropdown" href="#">ZoneMinder</a>'.PHP_EOL;
$result .= '<ul style="background-color:#485460" class="dropdown-menu">'.PHP_EOL;
$result .= '<li><a class="dropdown-item" href="https://zoneminder.com/">ZoneMinder</a></li>'.PHP_EOL;
$result .= '<li><a class="dropdown-item" href="https://zoneminder.readthedocs.io/en/stable/">Documentation</a></li>'.PHP_EOL;
$result .= '<li><a class="dropdown-item" href="https://forums.zoneminder.com/">Support</a></li>'.PHP_EOL;
$result .= '</ul>'.PHP_EOL;
} else {
$result .= '<a id="getNavBrandHTML" href="' .validHtmlStr(ZM_HOME_URL). '" target="' .validHtmlStr(ZM_WEB_TITLE). '">' .ZM_HOME_CONTENT. '</a>'.PHP_EOL; $result .= '<a id="getNavBrandHTML" href="' .validHtmlStr(ZM_HOME_URL). '" target="' .validHtmlStr(ZM_WEB_TITLE). '">' .ZM_HOME_CONTENT. '</a>'.PHP_EOL;
}
return $result; return $result;
} }