Minimal Theme: Adjust to use Enhanced Theme background images. Click to dismiss response message, as well.
This commit is contained in:
parent
87f2ac5561
commit
9e603db1ab
|
|
@ -108,7 +108,7 @@ if ($domains_processed == 1) {
|
|||
$array[$x]['default_setting_category'] = 'theme';
|
||||
$array[$x]['default_setting_subcategory'] = 'message_opacity';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '0.7';
|
||||
$array[$x]['default_setting_value'] = '0.9';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Set the opacity of the message bar (decimal).';
|
||||
$x++;
|
||||
|
|
|
|||
|
|
@ -1,236 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
if ($domains_processed == 1) {
|
||||
|
||||
//define array of settings
|
||||
$x = 0;
|
||||
$array[$x]['default_setting_category'] = 'theme';
|
||||
$array[$x]['default_setting_subcategory'] = 'login_opacity';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '0.35';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Set the opacity of the login box (decimal).';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'theme';
|
||||
$array[$x]['default_setting_subcategory'] = 'login_background_color';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '#ffffff';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Set a background color (HTML compatible) for the login box.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'theme';
|
||||
$array[$x]['default_setting_subcategory'] = 'footer_background_color';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '#000000';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Set a background color (HTML compatible) for the footer bar.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'theme';
|
||||
$array[$x]['default_setting_subcategory'] = 'footer_color';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '#ffffff';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Set a foreground color (HTML compatible) for the footer bar.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'theme';
|
||||
$array[$x]['default_setting_subcategory'] = 'footer_opacity';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '0.2';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Set the opacity of the footer bar (decimal).';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'theme';
|
||||
$array[$x]['default_setting_subcategory'] = 'message_default_background_color';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '#ccffcc';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Set the background color (HTML compatible) for the positive (default) message bar.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'theme';
|
||||
$array[$x]['default_setting_subcategory'] = 'message_default_color';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '#004200';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Set the foreground color (HTML compatible) for the positive (default) message bar text.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'theme';
|
||||
$array[$x]['default_setting_subcategory'] = 'message_negative_background_color';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '#ffcdcd';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Set the background color (HTML compatible) for the negative message bar.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'theme';
|
||||
$array[$x]['default_setting_subcategory'] = 'message_negative_color';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '#670000';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Set the foreground color (HTML compatible) for the negative message bar text.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'theme';
|
||||
$array[$x]['default_setting_subcategory'] = 'message_alert_background_color';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '#ffe585';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Set the background color (HTML compatible) for the alert message bar.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'theme';
|
||||
$array[$x]['default_setting_subcategory'] = 'message_alert_color';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '#d66721';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Set the foreground color (HTML compatible) for the alert message bar text.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'theme';
|
||||
$array[$x]['default_setting_subcategory'] = 'message_opacity';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '0.9';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Set the opacity of the message bar (decimal).';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'theme';
|
||||
$array[$x]['default_setting_subcategory'] = 'message_delay';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '1.75';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Set the hide delay of the message bar (seconds).';
|
||||
|
||||
//iterate and add each, if necessary
|
||||
foreach ($array as $index => $default_settings) {
|
||||
|
||||
//add theme default settings
|
||||
$sql = "select count(*) as num_rows from v_default_settings ";
|
||||
$sql .= "where default_setting_category = 'theme' ";
|
||||
$sql .= "and default_setting_subcategory = '".$default_settings['default_setting_subcategory']."' ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
unset($prep_statement);
|
||||
if ($row['num_rows'] == 0) {
|
||||
$orm = new orm;
|
||||
$orm->name('default_settings');
|
||||
$orm->save($array[$index]);
|
||||
$message = $orm->message;
|
||||
//print_r($message);
|
||||
}
|
||||
unset($row);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//define secondary background color array
|
||||
unset($array);
|
||||
$x = 0;
|
||||
$array[$x]['default_setting_category'] = 'theme';
|
||||
$array[$x]['default_setting_subcategory'] = 'background_color';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = '#ffffff';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_order'] = '0';
|
||||
$array[$x]['default_setting_description'] = 'Set a background (HTML compatible) color.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'theme';
|
||||
$array[$x]['default_setting_subcategory'] = 'background_color';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = '#e7ebf1';
|
||||
$array[$x]['default_setting_order'] = '1';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Set a secondary background (HTML compatible) color, for a gradient effect.';
|
||||
|
||||
//add secondary background color separately, if missing
|
||||
$sql = "select count(*) as num_rows from v_default_settings ";
|
||||
$sql .= "where default_setting_category = 'theme' ";
|
||||
$sql .= "and default_setting_subcategory = 'background_color' ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
unset($prep_statement);
|
||||
if ($row['num_rows'] == 0) {
|
||||
$orm = new orm;
|
||||
$orm->name('default_settings');
|
||||
foreach ($array as $index => $null) {
|
||||
$orm->save($array[$index]);
|
||||
}
|
||||
$message = $orm->message;
|
||||
//print_r($message);
|
||||
}
|
||||
unset($row);
|
||||
}
|
||||
|
||||
//get the background images
|
||||
$relative_path = PROJECT_PATH.'/themes/minimized/images/backgrounds';
|
||||
$backgrounds = opendir($_SERVER["DOCUMENT_ROOT"].'/'.$relative_path);
|
||||
unset($array);
|
||||
$x = 0;
|
||||
while (false !== ($file = readdir($backgrounds))) {
|
||||
if ($file != "." AND $file != ".."){
|
||||
$new_path = $dir.'/'.$file;
|
||||
$level = explode('/',$new_path);
|
||||
$ext = pathinfo($file, PATHINFO_EXTENSION);
|
||||
if ($ext == "png" || $ext == "jpg" || $ext == "jpeg" || $ext == "gif") {
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'theme';
|
||||
$array[$x]['default_setting_subcategory'] = 'background_image';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = $relative_path.'/'.$file;
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Set a relative path or URL within a selected compatible template.';
|
||||
}
|
||||
if ($x > 300) { break; };
|
||||
}
|
||||
}
|
||||
|
||||
//get default settings
|
||||
$sql = "select * from v_default_settings ";
|
||||
$sql .= "where default_setting_category = 'theme' ";
|
||||
$sql .= "and default_setting_subcategory = 'background_image' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
unset($prep_statement);
|
||||
|
||||
//add theme default settings
|
||||
foreach ($array as $row) {
|
||||
$found = false;
|
||||
foreach ($default_settings as $field) {
|
||||
if ($field["default_setting_value"] == $row["default_setting_value"]) {
|
||||
$found = true;
|
||||
}
|
||||
}
|
||||
if (!$found) {
|
||||
$orm = new orm;
|
||||
$orm->name('default_settings');
|
||||
$orm->save($row);
|
||||
$message = $orm->message;
|
||||
//print_r($message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
Background Images
|
||||
|
||||
Image: sand_sea.jpg
|
||||
License: Public Domain
|
||||
Source: http://www.publicdomainpictures.net/view-image.php?image=15812&picture=sand-texture-and-the-sea
|
||||
|
||||
Image: wave.jpg
|
||||
License: Public Domain
|
||||
Source: http://www.publicdomainpictures.net/view-image.php?image=2766&picture=breaking-wave
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 219 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 292 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 292 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 156 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 174 KiB |
|
|
@ -962,6 +962,7 @@ legend {
|
|||
<script language="JavaScript" type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#message_text").click(function() { $(this).css({top: '-=80'}); $("#message_container").css({top: '-=80'}); });
|
||||
$("#domain_selector_icon").click(function() { show_domains(); });
|
||||
$("#domains_hide").click(function() { hide_domains(); });
|
||||
|
||||
|
|
@ -1205,14 +1206,14 @@ legend {
|
|||
}
|
||||
else {
|
||||
// use theme images/backgrounds folder as root
|
||||
$source_path = PROJECT_PATH.'/themes/minimized/images/backgrounds/'.$background_image;
|
||||
$source_path = PROJECT_PATH.'/themes/enhanced/images/backgrounds/'.$background_image;
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
// not set, so use default backgrounds folder and images
|
||||
$image_source = 'folder';
|
||||
$source_path = PROJECT_PATH.'/themes/minimized/images/backgrounds';
|
||||
$source_path = PROJECT_PATH.'/themes/enhanced/images/backgrounds';
|
||||
}
|
||||
|
||||
if ($image_source == 'folder') {
|
||||
|
|
|
|||
Loading…
Reference in New Issue