Browse Source

add more colors

causefx 8 years ago
parent
commit
c6390976d1
3 changed files with 103 additions and 0 deletions
  1. 6 0
      api/config/default.php
  2. 54 0
      api/functions/organizr-functions.php
  3. 43 0
      js/functions.js

+ 6 - 0
api/config/default.php

@@ -14,6 +14,12 @@ return array(
     'headerTextColor' => '',
     'sidebarColor' => '',
     'sidebarTextColor' => '',
+	'accentColor' => '',
+    'accentTextColor' => '',
+	'buttonColor' => '',
+	'buttonTextColor' => '',
+	'buttonHoverColor' => '',
+    'buttonTextHoverColor' => '',
     'lockScreen' => false,
     'theme'=>'Organizr',
     'style'=>'dark',

+ 54 - 0
api/functions/organizr-functions.php

@@ -502,6 +502,12 @@ function loadAppearance()
     $appearance['sidebarColor'] = $GLOBALS['sidebarColor'];
     $appearance['headerTextColor'] = $GLOBALS['headerTextColor'];
     $appearance['sidebarTextColor'] = $GLOBALS['sidebarTextColor'];
+    $appearance['accentColor'] = $GLOBALS['accentColor'];
+    $appearance['accentTextColor'] = $GLOBALS['accentTextColor'];
+    $appearance['buttonColor'] = $GLOBALS['buttonColor'];
+    $appearance['buttonTextColor'] = $GLOBALS['buttonTextColor'];
+    $appearance['buttonTextHoverColor'] = $GLOBALS['buttonTextHoverColor'];
+    $appearance['buttonHoverColor'] = $GLOBALS['buttonHoverColor'];
     $appearance['loginWallpaper'] = $GLOBALS['loginWallpaper'];
     $appearance['customCss'] = $GLOBALS['customCss'];
     return $appearance;
@@ -571,6 +577,54 @@ function getCustomizeAppearance()
                     'class' => 'colorpicker',
                     'disabled' => true
                 ),
+                array(
+                    'type' => 'input',
+                    'name' => 'accentColor',
+                    'label' => 'Accent Color',
+                    'value' => $GLOBALS['accentColor'],
+                    'class' => 'colorpicker',
+                    'disabled' => true
+                ),
+                array(
+                    'type' => 'input',
+                    'name' => 'accentTextColor',
+                    'label' => 'Accent Text Color',
+                    'value' => $GLOBALS['accentTextColor'],
+                    'class' => 'colorpicker',
+                    'disabled' => true
+                ),
+                array(
+                    'type' => 'input',
+                    'name' => 'buttonColor',
+                    'label' => 'Button Color',
+                    'value' => $GLOBALS['buttonColor'],
+                    'class' => 'colorpicker',
+                    'disabled' => true
+                ),
+                array(
+                    'type' => 'input',
+                    'name' => 'buttonTextColor',
+                    'label' => 'Button Text Color',
+                    'value' => $GLOBALS['buttonTextColor'],
+                    'class' => 'colorpicker',
+                    'disabled' => true
+                ),/*
+                array(
+                    'type' => 'input',
+                    'name' => 'buttonHoverColor',
+                    'label' => 'Button Hover Color',
+                    'value' => $GLOBALS['buttonHoverColor'],
+                    'class' => 'colorpicker',
+                    'disabled' => true
+                ),
+                array(
+                    'type' => 'input',
+                    'name' => 'buttonTextHoverColor',
+                    'label' => 'Button Hover Text Color',
+                    'value' => $GLOBALS['buttonTextHoverColor'],
+                    'class' => 'colorpicker',
+                    'disabled' => true
+                ),*/
                 array(
                     'type' => 'select',
                     'name' => 'theme',

+ 43 - 0
js/functions.js

@@ -1973,6 +1973,49 @@ function loadAppearance(appearance){
 		    }
 		`;
 	}
+	if(appearance.accentColor !== ''){
+		cssSettings += `
+			.bg-info,
+			.fc-toolbar,
+			.progress-bar-info,
+			.label-info {
+			    background-color: `+appearance.accentColor+` !important;
+			}
+			.panel-blue .panel-heading, .panel-info .panel-heading {
+			    border-color: `+appearance.accentColor+`;
+			}
+
+			.text-info,
+			.btn-link, a {
+			    color: `+appearance.accentColor+`;
+			}
+		`;
+	}
+	if(appearance.accentTextColor !== ''){
+		cssSettings += `
+			.progress-bar,
+			.panel-default .panel-heading,
+			.mailbox-widget .customtab li.active a, .mailbox-widget .customtab li.active, .mailbox-widget .customtab li.active a:focus,
+			.mailbox-widget .customtab li a {
+				color: `+appearance.accentTextColor+`;
+			}
+		`;
+	}
+	if(appearance.buttonColor !== ''){
+		cssSettings += `
+			.btn-info, .btn-info.disabled {
+				background: `+appearance.buttonColor+` !important;
+				border: 1px solid `+appearance.buttonColor+` !important;
+			}
+		`;
+	}
+	if(appearance.buttonTextColor !== ''){
+		cssSettings += `
+			.btn-info, .btn-info.disabled {
+				color: `+appearance.buttonTextColor+` !important;
+			}
+		`;
+	}
 	if(appearance.loginWallpaper !== ''){
 		cssSettings += `
 		    .login-register {