Skip to content
Snippets Groups Projects
Commit 959b77c3 authored by Steven Wittens's avatar Steven Wittens
Browse files

- Added $theme->foreground and $theme->background vars to provide some general...

- Added $theme->foreground and $theme->background vars to provide some general usable colors outside of a theme.
- Updated poll.module to use the new $theme color variables
parent 0e2fc70e
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -91,9 +91,10 @@ function poll_help() { ...@@ -91,9 +91,10 @@ function poll_help() {
<?php <?php
} }
function poll_graph($val, $clrfill, $clrempty) { function poll_graph($val) {
$clrfill = $clrfill ? $clrfill : "#ffffff"; global $theme;
$clrempty = $clrempty ? $clrempty : "#000000"; $clrfill = $theme->foreground ? $theme->foreground : "#000000";
$clrempty = $theme->background ? $theme->background : "#ffffff";
$p = round($val * 100); $p = round($val * 100);
return "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr>" . ($p ? "<td width=\"" . $p . "%\" style=\"background-color: $clrfill;\"><span style=\"font-size: 4pt;\">&nbsp;</span></td>" : "") . ($p < 100 ? "<td style=\"background-color: $clrempty;\" width=\"" . (100 - $p) . "%\"><span style=\"font-size: 4pt;\">&nbsp;</span></td>":"") . "</tr></table>"; return "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr>" . ($p ? "<td width=\"" . $p . "%\" style=\"background-color: $clrfill;\"><span style=\"font-size: 4pt;\">&nbsp;</span></td>" : "") . ($p < 100 ? "<td style=\"background-color: $clrempty;\" width=\"" . (100 - $p) . "%\"><span style=\"font-size: 4pt;\">&nbsp;</span></td>":"") . "</tr></table>";
} }
......
...@@ -91,9 +91,10 @@ function poll_help() { ...@@ -91,9 +91,10 @@ function poll_help() {
<?php <?php
} }
function poll_graph($val, $clrfill, $clrempty) { function poll_graph($val) {
$clrfill = $clrfill ? $clrfill : "#ffffff"; global $theme;
$clrempty = $clrempty ? $clrempty : "#000000"; $clrfill = $theme->foreground ? $theme->foreground : "#000000";
$clrempty = $theme->background ? $theme->background : "#ffffff";
$p = round($val * 100); $p = round($val * 100);
return "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr>" . ($p ? "<td width=\"" . $p . "%\" style=\"background-color: $clrfill;\"><span style=\"font-size: 4pt;\">&nbsp;</span></td>" : "") . ($p < 100 ? "<td style=\"background-color: $clrempty;\" width=\"" . (100 - $p) . "%\"><span style=\"font-size: 4pt;\">&nbsp;</span></td>":"") . "</tr></table>"; return "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr>" . ($p ? "<td width=\"" . $p . "%\" style=\"background-color: $clrfill;\"><span style=\"font-size: 4pt;\">&nbsp;</span></td>" : "") . ($p < 100 ? "<td style=\"background-color: $clrempty;\" width=\"" . (100 - $p) . "%\"><span style=\"font-size: 4pt;\">&nbsp;</span></td>":"") . "</tr></table>";
} }
......
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
*********************************************************************/ *********************************************************************/
class Theme { class Theme {
// General colorset that can be used for this theme
var $foreground = "#000000";
var $background = "#FFFFFF";
function header() { function header() {
?> ?>
......
...@@ -12,6 +12,10 @@ ...@@ -12,6 +12,10 @@
*********************************************************************/ *********************************************************************/
class Theme { class Theme {
// General colorset that can be used for this theme
var $foreground = "#000000";
var $background = "#FFFFFF";
function header() { function header() {
?> ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
......
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
*********************************************************************/ *********************************************************************/
class Theme { class Theme {
// General colorset that can be used for this theme
var $foreground = "#000000";
var $background = "#E7E7E7";
/* /*
I am going to use some colors throughout this theme: I am going to use some colors throughout this theme:
......
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
class Theme { class Theme {
var $link = "#666699"; var $link = "#666699";
// General colorset that can be used for this theme
var $foreground = "#000000";
var $background = "#EAEAEA";
function header() { function header() {
?> ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
......
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
*********************************************************************/ *********************************************************************/
class Theme { class Theme {
var $foreground = "#000000";
var $background = "#FFFFFF";
var $link = "#000000"; var $link = "#000000";
var $themename = "unconed"; var $themename = "unconed";
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
*********************************************************************/ *********************************************************************/
class Theme { class Theme {
var $foreground = "#000000";
var $background = "#F0F0F0";
function header() { function header() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment