Merge pull request #602 from ZoneMinder/css_skins_for_classic

Css skins for classic
pull/614/head
Isaac Connor 2014-12-01 11:27:43 -05:00
commit edf8338904
39 changed files with 70 additions and 24 deletions

View File

@ -446,7 +446,7 @@ AC_SUBST(PERL_MM_PARMS)
AC_SUBST(EXTRA_PERL_LIB)
AC_CONFIG_FILES([Makefile zm.conf zmconfgen.pl db/Makefile db/zm_create.sql misc/Makefile misc/apache.conf misc/logrotate.conf misc/syslog.conf misc/com.zoneminder.systemctl.policy misc/com.zoneminder.systemctl.rules scripts/Makefile scripts/zm scripts/zmaudit.pl scripts/zmcontrol.pl scripts/zmdc.pl scripts/zmfilter.pl scripts/zmpkg.pl scripts/zmtrack.pl scripts/zmcamtool.pl scripts/zmsystemctl.pl scripts/zmtrigger.pl scripts/zmupdate.pl scripts/zmvideo.pl scripts/zmwatch.pl scripts/zmx10.pl scripts/zmdbbackup scripts/zmdbrestore scripts/zmeventdump scripts/zmlogrotate.conf scripts/ZoneMinder/lib/ZoneMinder/Base.pm scripts/ZoneMinder/lib/ZoneMinder/Config.pm scripts/ZoneMinder/lib/ZoneMinder/Memory.pm scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm src/Makefile src/zm_config.h web/Makefile web/ajax/Makefile web/css/Makefile web/graphics/Makefile web/includes/Makefile web/includes/config.php web/js/Makefile web/lang/Makefile web/skins/Makefile web/skins/classic/Makefile web/skins/classic/ajax/Makefile web/skins/classic/css/Makefile web/skins/classic/graphics/Makefile web/skins/classic/includes/Makefile web/skins/classic/js/Makefile web/skins/classic/lang/Makefile web/skins/classic/views/Makefile web/skins/classic/views/css/Makefile web/skins/classic/views/js/Makefile web/skins/mobile/Makefile web/skins/mobile/ajax/Makefile web/skins/mobile/css/Makefile web/skins/mobile/graphics/Makefile web/skins/mobile/includes/Makefile web/skins/mobile/lang/Makefile web/skins/mobile/views/Makefile web/skins/mobile/views/css/Makefile web/tools/Makefile web/tools/mootools/Makefile web/views/Makefile web/skins/xml/Makefile web/skins/xml/views/Makefile web/skins/xml/includes/Makefile web/skins/flat/Makefile web/skins/flat/ajax/Makefile web/skins/flat/css/Makefile web/skins/flat/graphics/Makefile web/skins/flat/includes/Makefile web/skins/flat/js/Makefile web/skins/flat/lang/Makefile web/skins/flat/views/Makefile web/skins/flat/views/css/Makefile web/skins/flat/views/js/Makefile])
AC_CONFIG_FILES([Makefile zm.conf zmconfgen.pl db/Makefile db/zm_create.sql misc/Makefile misc/apache.conf misc/logrotate.conf misc/syslog.conf misc/com.zoneminder.systemctl.policy misc/com.zoneminder.systemctl.rules scripts/Makefile scripts/zm scripts/zmaudit.pl scripts/zmcontrol.pl scripts/zmdc.pl scripts/zmfilter.pl scripts/zmpkg.pl scripts/zmtrack.pl scripts/zmcamtool.pl scripts/zmsystemctl.pl scripts/zmtrigger.pl scripts/zmupdate.pl scripts/zmvideo.pl scripts/zmwatch.pl scripts/zmx10.pl scripts/zmdbbackup scripts/zmdbrestore scripts/zmeventdump scripts/zmlogrotate.conf scripts/ZoneMinder/lib/ZoneMinder/Base.pm scripts/ZoneMinder/lib/ZoneMinder/Config.pm scripts/ZoneMinder/lib/ZoneMinder/Memory.pm scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm src/Makefile src/zm_config.h web/Makefile web/ajax/Makefile web/css/Makefile web/graphics/Makefile web/includes/Makefile web/includes/config.php web/js/Makefile web/lang/Makefile web/skins/Makefile web/skins/classic/Makefile web/skins/classic/ajax/Makefile web/skins/classic/css/Makefile web/skins/classic/css/classic/Makefile web/skins/classic/css/classic/views/Makefile web/skins/classic/graphics/Makefile web/skins/classic/includes/Makefile web/skins/classic/js/Makefile web/skins/classic/lang/Makefile web/skins/classic/views/Makefile web/skins/classic/views/js/Makefile web/skins/mobile/Makefile web/skins/mobile/ajax/Makefile web/skins/mobile/css/Makefile web/skins/mobile/graphics/Makefile web/skins/mobile/includes/Makefile web/skins/mobile/lang/Makefile web/skins/mobile/views/Makefile web/skins/mobile/views/css/Makefile web/tools/Makefile web/tools/mootools/Makefile web/views/Makefile web/skins/xml/Makefile web/skins/xml/views/Makefile web/skins/xml/includes/Makefile web/skins/flat/Makefile web/skins/flat/ajax/Makefile web/skins/flat/css/Makefile web/skins/flat/graphics/Makefile web/skins/flat/includes/Makefile web/skins/flat/js/Makefile web/skins/flat/lang/Makefile web/skins/flat/views/Makefile web/skins/flat/views/css/Makefile web/skins/flat/views/js/Makefile])
# Create the definitions for compilation and defaults for the database
AC_CONFIG_COMMANDS([src/zm_config_defines.h],[perl ./zmconfgen.pl])

View File

@ -63,6 +63,13 @@ elseif ( isset($_COOKIE['zmSkin']) )
else
$skin = "classic";
if ( isset($_GET['css']) )
$css = $_GET['css'];
elseif ( isset($_COOKIE['zmCSS']) )
$css = $_COOKIE['zmCSS'];
else
$css = "classic";
define( "ZM_BASE_PATH", dirname( $_SERVER['REQUEST_URI'] ) );
define( "ZM_SKIN_PATH", "skins/$skin" );
@ -82,6 +89,11 @@ if ( !isset($_SESSION['skin']) || isset($_REQUEST['skin']) )
setcookie( "zmSkin", $skin, time()+3600*24*30*12*10 );
}
if ( !isset($_SESSION['css']) || isset($_REQUEST['css']) ) {
$_SESSION['css'] = $css;
setcookie( "zmCSS", $css, time()+3600*24*30*12*10 );
}
require_once( 'includes/config.php' );
require_once( 'includes/logger.php' );

View File

@ -609,6 +609,7 @@ $SLANG = array(
'SignalCheckColour' => 'Signal Check Colour',
'Size' => 'Size',
'SkinDescription' => 'Change the default skin for this computer',
'CSSDescription' => 'Change the default css for this computer',
'Sleep' => 'Sleep',
'SortAsc' => 'Asc',
'SortBy' => 'Sort by',

View File

@ -2,7 +2,4 @@ AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/classic/css
dist_web_DATA = \
skin.css \
control.css \
export.css
SUBDIRS = classic

View File

@ -0,0 +1,10 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/classic/css/classic
SUBDIRS = views
dist_web_DATA = \
skin.css \
control.css \
export.css

View File

@ -1,6 +1,6 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/classic/views/css
webdir = @WEB_PREFIX@/skins/classic/css/classic/views
dist_web_DATA = \
console.css \

View File

@ -20,14 +20,16 @@
function xhtmlHeaders( $file, $title )
{
$skinCssFile = getSkinFile( 'css/skin.css' );
$skinCssPhpFile = getSkinFile( 'css/skin.css.php' );
global $css;
$skinCssFile = getSkinFile( 'css/'.$css.'/skin.css' );
$skinCssPhpFile = getSkinFile( 'css/'.$css.'/skin.css.php' );
$skinJsFile = getSkinFile( 'js/skin.js' );
$skinJsPhpFile = getSkinFile( 'js/skin.js.php' );
$basename = basename( $file, '.php' );
$viewCssFile = getSkinFile( 'views/css/'.$basename.'.css' );
$viewCssPhpFile = getSkinFile( 'views/css/'.$basename.'.css.php' );
$viewCssFile = getSkinFile( '/css/'.$css.'/views/'.$basename.'.css' );
$viewCssPhpFile = getSkinFile( '/css/'.$css.'/views/'.$basename.'.css.php' );
$viewJsFile = getSkinFile( 'views/js/'.$basename.'.js' );
$viewJsPhpFile = getSkinFile( 'views/js/'.$basename.'.js.php' );

View File

@ -1,7 +1,6 @@
AUTOMAKE_OPTIONS = gnu
SUBDIRS = \
css \
js
webdir = @WEB_PREFIX@/skins/classic/views

View File

@ -83,11 +83,20 @@ foreach ( $tabs as $name=>$value )
<?php
if($tab == 'skins') {
$current_skin = $_COOKIE['zmSkin'];
if (isset($_GET['skin-choice'])) {
$reload = false;
if ( isset($_GET['skin-choice']) && ( $_GET['skin-choice'] != $current_skin ) ) {
setcookie('zmSkin',$_GET['skin-choice'], time()+3600*24*30*12*10 );
//header("Location: index.php?view=options&tab=skins&reset_parent=1");
echo "<script type=\"text/javascript\">window.opener.location.reload();window.location.href=\"{$_SERVER['PHP_SELF']}?view={$view}&tab={$tab}\"</script>";
$reload = true;
}
$current_css = $_COOKIE['zmCSS'];
if ( isset($_GET['css-choice']) and ( $_GET['css-choice'] != $current_css ) ) {
setcookie('zmCSS',$_GET['css-choice'], time()+3600*24*30*12*10 );
//header("Location: index.php?view=options&tab=skins&reset_parent=1");
$reload = true;
}
if ( $reload )
echo "<script type=\"text/javascript\">window.opener.location.reload();window.location.href=\"{$_SERVER['PHP_SELF']}?view={$view}&tab={$tab}\"</script>";
?>
<form name="optionsForm" method="get" action="<?= $_SERVER['PHP_SELF'] ?>">
@ -96,17 +105,33 @@ if($tab == 'skins') {
<table class="contentTable major optionTable" cellspacing="0">
<thead><tr><th><?= $SLANG['Name'] ?></th><th><?= $SLANG['Description'] ?></th> <th><?= $SLANG['Value'] ?></th></tr></thead>
<tbody>
<td>ZM_SKIN</td>
<td><?php echo $SLANG['SkinDescription']; ?></td>
<td><select name="skin-choice">
<?php
foreach(glob('skins/*',GLOB_ONLYDIR) as $dir) {
$dir = basename($dir);
echo '<option value="'.$dir.'" '.($current_skin==$dir ? 'SELECTED' : '').'>'.$dir.'</option>';
}
?>
</select>
</td>
<tr>
<td>ZM_SKIN</td>
<td><?php echo $SLANG['SkinDescription']; ?></td>
<td><select name="skin-choice">
<?php
foreach(glob('skins/*',GLOB_ONLYDIR) as $dir) {
$dir = basename($dir);
echo '<option value="'.$dir.'" '.($current_skin==$dir ? 'SELECTED' : '').'>'.$dir.'</option>';
}
?>
</select>
</td>
</tr>
<tr>
<td>ZM_CSS</td>
<td><?php echo $SLANG['CSSDescription']; ?></td>
<td><select name="css-choice">
<?php
foreach(glob('skins/'.$current_css.'/*',GLOB_ONLYDIR) as $dir) {
$dir = basename($dir);
echo '<option value="'.$dir.'" '.($current_css==$dir ? 'SELECTED' : '').'>'.$dir.'</option>';
}
?>
</select>
</td>
</tr>
</tbody>
</table>
<div id="contentButtons">
<input type="submit" value="<?= $SLANG['Save'] ?>"<?= $canEdit?'':' disabled="disabled"' ?>/>