';
}
} // end function getBodyTopHTML
function getNavBarHTML($reload = null) {
# Provide a facility to turn off the headers if you put navbar=0 into the url
if ( isset($_REQUEST['navbar']) and $_REQUEST['navbar']=='0' )
return '';
$versionClass = (ZM_DYN_DB_VERSION&&(ZM_DYN_DB_VERSION!=ZM_VERSION))?'errorText':'';
global $running;
global $user;
global $bandwidth_options;
global $view;
global $filterQuery;
global $sortQuery;
global $limitQuery;
if (!$sortQuery) {
parseSort();
}
if ( (!$filterQuery) and isset($_REQUEST['filter']) ) {
parseFilter($_REQUEST['filter']);
$filterQuery = $_REQUEST['filter']['query'];
}
if ( $reload === null ) {
ob_start();
if ( $running == null )
$running = daemonCheck();
if ( $running ) {
$state = dbFetchOne('SELECT Name FROM States WHERE isActive=1', 'Name');
if ( $state == 'default' )
$state = '';
}
$status = $running ? ($state ? $state : translate('Running')) : translate('Stopped');
?>
';
echo 'trending_up';
echo ' '.translate('Load').': '.getLoad();
echo '';
}
// Returns the html representing the current number of connections made to the database
function getDbConHTML() {
$connections = dbFetchOne('SHOW status WHERE variable_name=\'threads_connected\'', 'Value');
$max_connections = dbFetchOne('SHOW variables WHERE variable_name=\'max_connections\'', 'Value');
$percent_used = $max_connections ? 100 * $connections / $max_connections : 100;
$class = $percent_used > 90 ? 'warning' : '';
echo '
';
}
// Returns the html representing the current capacity of mapped memory filesystem (usually /dev/shm)
function getShmHTML() {
$shm_percent = getDiskPercent(ZM_PATH_MAP);
$shm_total_space = disk_total_space(ZM_PATH_MAP);
$shm_used = $shm_total_space - disk_free_space(ZM_PATH_MAP);
$class = '';
if ( $shm_percent > 98 ) {
$class = 'error';
} else if ( $shm_percent > 90 ) {
$class = 'warning';
}
echo '
'.ZM_PATH_MAP.': '.$shm_percent.'%
';
}
// Returns the html representing the optional web console banner text
function getConsoleBannerHTML() {
if ( defined('ZM_WEB_CONSOLE_BANNER') and ZM_WEB_CONSOLE_BANNER != '' ) {
echo '
'.validHtmlStr(ZM_WEB_CONSOLE_BANNER).'
';
}
}
// Returns the html representing the current high,medium,low bandwidth setting
function getBandwidthHTML($bandwidth_options,$user) {
echo '
';
}
// Returns the html representing the ZoneMinder logo
function getNavBrandHTML() {
echo '' .ZM_HOME_CONTENT. '';
}
// Returns the html representing the Console menu item
function getConsoleHTML() {
if ( canView('Monitors') ) {
echo '
';
}
}
// Returns the html representing the Log menu item
function getLogHTML() {
if ( canView('System') ) {
if ( ZM\logToDatabase() > ZM\Logger::NOLOG ) {
if ( ! ZM_RUN_AUDIT ) {
# zmaudit can clean the logs, but if we aren't running it, then we should clean them regularly
if ( preg_match('/^\d+$/', ZM_LOG_DATABASE_LIMIT) ) {
# Number of lines, instead of an interval
$rows = dbFetchOne('SELECT Count(*) AS `Rows` FROM `Logs`', 'Rows');
if ( $rows > ZM_LOG_DATABASE_LIMIT ) {
dbQuery('DELETE low_priority FROM `Logs` ORDER BY `TimeKey` ASC LIMIT ?', array($rows - ZM_LOG_DATABASE_LIMIT));
}
} else if ( preg_match('/^\d\s*(hour|minute|day|week|month|year)$/', ZM_LOG_DATABASE_LIMIT, $matches) ) {
dbQuery('DELETE FROM `Logs` WHERE `TimeKey` < unix_timestamp( NOW() - interval '.ZM_LOG_DATABASE_LIMIT.') LIMIT 100');
} else {
ZM\Error('Potentially invalid value for ZM_LOG_DATABASE_LIMIT: ' . ZM_LOG_DATABASE_LIMIT);
}
}
echo '
';
}
}
// Returns the html representing the Groups menu item
function getGroupsHTML() {
global $view;
$class = $view == 'groups' ? 'selected' : '';
echo '
';
}
// Returns the html representing the Filter menu item
function getFilterHTML() {
global $view;
global $filterQuery;
global $sortQuery;
global $limitQuery;
$class = $view == 'filter' ? 'selected' : '';
echo '
';
}
// Returns the html representing the Cycle menu item
function getCycleHTML() {
global $view;
if ( canView('Stream') ) {
$class = $view == 'cycle' ? 'selected' : '';
echo '
';
}
}
// Returns the html representing the Montage menu item
function getMontageHTML() {
global $view;
if ( canView('Stream') ) {
$class = $view == 'cycle' ? 'selected' : '';
echo '
';
}
}
// Returns the html representing the Audit Events Report menu item
function getRprtEvntAuditHTML() {
global $view;
if ( canView('Events') ) {
$class = $view == 'report_event_audit' ? 'selected' : '';
echo '
';
}
// Returns the html representing the logged in user name and avatar
function getAcctCircleHTML($user=null) {
if ( ZM_OPT_USE_AUTH and $user ) {
echo '
';
}
}
function xhtmlFooter() {
global $cspNonce;
global $view;
global $skin;
global $running;
if ( canEdit('System') ) {
include("skins/$skin/views/state.php");
}
?>