From 148e21d707b7a70048340e28cd6b4f4acce93f6d Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 21 Dec 2017 21:46:21 -0500 Subject: [PATCH 01/39] fugro --- .../lib/ZoneMinder/ConfigData.pm.in | 32 +++++++++ web/includes/functions.php | 3 +- .../classic/css/classic/views/options.css | 4 ++ web/skins/classic/includes/functions.php | 71 +++++++++++-------- web/skins/classic/views/login.php | 2 +- 5 files changed, 81 insertions(+), 31 deletions(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in index 238eae2e7..3c0721ef6 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in +++ b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in @@ -1451,6 +1451,17 @@ our @options = ( type => $types{boolean}, category => 'logging', }, + { + name => 'ZM_WEB_TITLE', + default => 'ZoneMinder', + description => 'The title displayed wherever the site references itself.', + help => q` + If you want the site to identify as something other than ZoneMinder, change this here. + It can be used to more accurately identify this installation from others. + `, + type => $types{string}, + category => 'web', + }, { name => 'ZM_WEB_TITLE_PREFIX', default => 'ZM', @@ -1464,6 +1475,27 @@ our @options = ( type => $types{string}, category => 'web', }, + { + name => 'ZM_HOME_URL', + default => 'http://zoneminder.com', + description => 'The url used in the home/logo area of the navigation bar.', + help => q` + By default this takes you to the zoneminder.com website, + but perhaps you would prefer it to take you somewhere else. + `, + type => $types{string}, + category => 'web', + }, + { + name => 'ZM_HOME_CONTENT', + default => 'ZoneMinder', + description => 'The content of the home button.', + help => q` + You may wish to set this to empty if you are using css to put a background image on it. + `, + type => $types{string}, + category => 'web', + }, { name => 'ZM_WEB_CONSOLE_BANNER', default => '', diff --git a/web/includes/functions.php b/web/includes/functions.php index 10ee34015..20a0ac027 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -2144,7 +2144,8 @@ function cache_bust( $file ) { # To defeat caching. Should probably use md5 hash $parts = pathinfo($file); global $css; - $cacheFile = 'cache/'.$parts['filename'].'-'.$css.'-'.filemtime($file).'.'.$parts['extension']; + $dirname = preg_replace( '/\//', '_', $parts['dirname'] ); + $cacheFile = 'cache/'.$dirname.'_'.$parts['filename'].'-'.$css.'-'.filemtime($file).'.'.$parts['extension']; if ( file_exists( ZM_PATH_WEB.'/'.$cacheFile ) or symlink( ZM_PATH_WEB.'/'.$file, ZM_PATH_WEB.'/'.$cacheFile ) ) { return $cacheFile; } else { diff --git a/web/skins/classic/css/classic/views/options.css b/web/skins/classic/css/classic/views/options.css index f7123086c..9d5b5ea94 100644 --- a/web/skins/classic/css/classic/views/options.css +++ b/web/skins/classic/css/classic/views/options.css @@ -1,3 +1,7 @@ +#options { + padding-top: 10px; + +} input.small { width: 6em; } diff --git a/web/skins/classic/includes/functions.php b/web/skins/classic/includes/functions.php index 4a2304965..4c43e1a13 100644 --- a/web/skins/classic/includes/functions.php +++ b/web/skins/classic/includes/functions.php @@ -19,14 +19,14 @@ // -// Don't load in additional JS to these views -$bad_views = array('monitor', 'log'); - function xhtmlHeaders( $file, $title ) { global $css; global $skin; - $skinCssFile = getSkinFile( 'css/'.$css.'/skin.css' ); - $skinCssFilejquery = getSkinFile( 'css/'.$css.'/jquery-ui-theme.css' ); + + # This idea is that we always include the classic css files, + # and then any different skin only needs to contain things that are different. + $baseCssPhpFile = getSkinFile( 'css/classic/skin.css.php' ); + $skinCssPhpFile = getSkinFile( 'css/'.$css.'/skin.css.php' ); $skinJsFile = getSkinFile( 'js/skin.js' ); @@ -34,7 +34,7 @@ function xhtmlHeaders( $file, $title ) { $cssJsFile = getSkinFile( 'js/'.$css.'.js' ); $basename = basename( $file, '.php' ); - $viewCssFile = getSkinFile( '/css/'.$css.'/views/'.$basename.'.css' ); + if ($basename == 'watch') { $viewCssFileExtra = getSkinFile( '/css/'.$css.'/views/control.css' ); } @@ -43,6 +43,16 @@ function xhtmlHeaders( $file, $title ) { $viewJsPhpFile = getSkinFile( 'views/js/'.$basename.'.js.php' ); extract( $GLOBALS, EXTR_OVERWRITE ); + function output_link_if_exists( $files ) { + global $skin; + $html = array(); + foreach ( $files as $file ) { + if ( getSkinFile( $file ) ) { + $html[] = ''; + } + } + return implode("\n", $html); + } ?> @@ -66,15 +76,20 @@ if ( file_exists( "skins/$skin/css/$css/graphics/favicon.ico" ) ) { - - - - - @@ -92,6 +107,7 @@ if ( file_exists( "skins/$skin/css/$css/graphics/favicon.ico" ) ) { + @@ -101,9 +117,6 @@ if ( file_exists( "skins/$skin/css/$css/graphics/favicon.ico" ) ) { - - -