- Separate the icons out of the colour themes

- Detect the theme directories and use dropdown boxes to select the theme and theme_icons, so no one can type in random stuff and screw their sfiab.
- Add 2 missing icons.
This commit is contained in:
dave 2009-11-06 22:10:06 +00:00
parent 2adc23658f
commit f67b485d6d
93 changed files with 137 additions and 110 deletions

View File

@ -49,7 +49,7 @@
echo " <tr>\n";
echo " <td><a href=\"user_personal.php\">".theme_icon("edit_profile")."<br />".i18n("Edit My Profile")."</a></td>";
echo " <td><a href=\"user_password.php\">".theme_icon("change_password")."<br />".i18n("Change My Password")."</a></td>";
echo " <td><a href=\"user_activate.php\">".theme_icon("")."<br />".i18n("Manage My Roles")."</a></td>";
echo " <td><a href=\"user_activate.php\">".theme_icon("manage_roles")."<br />".i18n("Manage My Roles")."</a></td>";
echo " </tr>\n";
echo "</table>\n";

View File

@ -179,7 +179,8 @@ while($r=mysql_fetch_object($q))
}
//and now pull the theme
require_once("theme/".$config['theme']."/theme.php");
require_once("theme/{$config['theme']}/theme.php");
require_once("theme/{$config['theme_icons']}/icons.php");
require_once("committee.inc.php");
@ -646,7 +647,7 @@ function send_popup_header($title="")
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head><title><?=i18n($title)?></title>
<link rel="stylesheet" href="<?=$config['SFIABDIRECTORY']?>/theme/<?=$config['theme']?>/jquery.css" type="text/css" media="all" />
<link rel="stylesheet" href="<?=$config['SFIABDIRECTORY']?>/theme/<?=$config['theme']?>/jquery-ui-1.7.2.custom.css" type="text/css" media="all" />
<link rel="stylesheet" href="<?=$config['SFIABDIRECTORY']?>/theme/<?=$config['theme']?>/sfiab.css" type="text/css" media="all" />
<link media=all href="<?=$config['SFIABDIRECTORY']?>/tableeditor.css" type=text/css rel=stylesheet>
</head>
@ -1105,12 +1106,13 @@ $CWSFDivisions=array(
7=>"Physical & Mathematical Sciences"
);
function theme_icon($icon) {
global $theme;
global $config;
if($theme['icons'][$icon])
return "<img src=\"".$config['SFIABDIRECTORY']."/theme/".$config['theme']."/icons/".$theme['icons'][$icon]."\" border=\"0\" alt=\"".htmlspecialchars($icon)."\">";
else
function theme_icon($icon, $width=0) {
global $theme_icons, $config;
$w = ($width == 0) ? '' : "width=\"$width\"" ;
if($theme_icons['icons'][$icon])
return "<img src=\"{$config['SFIABDIRECTORY']}/theme/{$config['theme_icons']}/{$theme_icons['icons'][$icon]}\" border=\"0\" $w alt=\"".htmlspecialchars($icon)."\">";
return "";
}

View File

@ -307,6 +307,36 @@ function config_editor($category, $year, $array_name, $self)
print("</select>");
break;
case 'theme':
print("<select name=\"$name\">");
/* Find all theme directories */
$themeroot = "{$_SERVER['DOCUMENT_ROOT']}{$config['SFIABDIRECTORY']}/theme";
$d = opendir($themeroot);
while(($f = readdir($d))) {
/* Load the theme. Loads theme into a local theme, not overwriting
* the global $theme */
if($var[$k]['type_values'] == 'icons') {
$theme_php = "$themeroot/$f/icons.php";
$cur = $config['theme_icons'];
$rvar = 'theme_icons';
} else {
$theme_php = "$themeroot/$f/theme.php";
$cur = $config['theme'];
$rvar = 'theme';
}
if(!file_exists($theme_php)) continue;
include($theme_php);
$t = $$rvar;
$sel = ($cur == $f) ? 'selected=selected' : '';
print("<option $sel value=\"$f\">{$t['name']}</option>");
}
print("</select>");
break;
default:
print("<input size=\"$size\" type=\"text\" name=\"$name\" value=\"$val\">\n");
break;

View File

@ -1 +1 @@
150
151

13
db/db.update.151.sql Normal file
View File

@ -0,0 +1,13 @@
ALTER TABLE `config` CHANGE `type` `type` ENUM( '', 'yesno', 'number', 'text', 'enum', 'multisel', 'language', 'theme' ) NOT NULL;
UPDATE `config` SET `type` = 'theme', `type_values` = 'theme', `description` = 'Theme for colours' WHERE `config`.`var` = 'theme';
INSERT INTO `config` ( `var` , `val` , `category` , `type` , `type_values` , `ord` , `description` , `year`)
VALUES ( 'theme_icons', 'icons_default', 'Global', 'theme', 'icons', '860', 'Icon set', '-1');
INSERT INTO `config` (`var`, `val`, `category`, `type`, `type_values`, `ord`, `description`, `year`) VALUES
('fairs_allow_login', 'no', 'Science Fairs', 'yesno', '', 200, 'Allow feeder fairs to login an enter stats and winners. If set to ''no'', they will only be able to download and upload awards using the SFIAB award download/upload mechanism.', -1),
('fairs_name', 'Science', 'Feeder Fairs', 'text', '', 300, 'What level the feeder fairs are. For example, ''School'' , ''Regional'', or just ''Science'' for a generic ''Science Fair''', -1);
('fairs_enable', 'no', 'Science Fairs', 'yesno', '', 100, 'Enable the Science Fair. Science Fairs can download awards tagged as ''downloadable'', and can upload winners of those awards directly into this system (optionally creating accounts for all students). There are also options to collect stats from these fairs.', -1);

View File

@ -20,55 +20,8 @@
Boston, MA 02111-1307, USA.
*/
$theme['name']="default";
$theme['description']="The default theme, with KDE4 icons";
$theme['name']="Classic";
$theme['description']="A classic colour scheme";
$theme['author']="James Grant <james@lightbox.org>";
//COMMITTEE MAIN ICONS (that are not used in admin/config already)
$theme['icons']['change_password']="encrypted.png";
$theme['icons']['edit_profile']="edit_user.png";
//ADMIN ICONS
$theme['icons']['administration']="gear.png";
$theme['icons']['participant_registration']="accessories-text-editor.png";
$theme['icons']['print/export_reports']="application-pdf.png";
$theme['icons']['print_awards_ceremony_scripts']="application-pdf.png";
$theme['icons']['committee_management']="system-users.png";
$theme['icons']['awards_management']="plasmagik.png";
$theme['icons']['schools_management']="applications-education.png";
$theme['icons']['judging_management']="klipper.png";
$theme['icons']['translations_management']="kwordquiz.png";
$theme['icons']['report_management']="document-multiple.png";
$theme['icons']['volunteer_management']="user-group-new.png";
$theme['icons']['tour_management']="preferences-system-performance.png";
$theme['icons']['internal_document_management']="application-vnd.oasis.opendocument.text.png";
$theme['icons']['registration_fee_items_management']="transfers_list.png";
$theme['icons']['judging_score_entry']="transfers_list.png";
$theme['icons']['enter_winning_projects']="legalmoves.png";
$theme['icons']['one-click_cwsf_registration']="flag-blue.png";
$theme['icons']['one-click_ysf_affiliation_stats']="flag-green.png";
$theme['icons']['fair_stats']="view_sort_descending.png";
$theme['icons']['communication']="mail-mark-unread.png";
$theme['icons']['website_content_management']="toggle_log.png";
$theme['icons']['fundraising']="Coins-32x32.png";
//CONFIG ICONS
$theme['icons']['configuration']="package_utilities.png";
$theme['icons']['configuration_variables']="configure.png";
$theme['icons']['important_dates']="date.png";
$theme['icons']['project_age_categories']="kdmconfig.png";
$theme['icons']['project_divisions']="edu_science.png";
$theme['icons']['cwsf_project_divisions']="edu_science_canada.png";
$theme['icons']['project_sub_divisions']="chemical.png";
$theme['icons']['page_texts']="kwrite.png";
$theme['icons']['exhibitor_signature_page']="signature.png";
$theme['icons']['judge_registration_questions']="vcs_status.png";
$theme['icons']['project_safety_questions']="help-contents.png";
$theme['icons']['images']="elempic.png";
$theme['icons']['external_award_sources']="ark.png";
$theme['icons']['language_pack_installer']="kanagram.png";
$theme['icons']['new_version_checker']="numbers.png";
$theme['icons']['rollover_fair_year']="svn_switch.png";
$theme['icons']['backup_restore']="rebuild.png";
?>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 815 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -20,55 +20,8 @@
Boston, MA 02111-1307, USA.
*/
$theme['name']="default";
$theme['description']="The default theme, with KDE4 icons";
$theme['name']="Default";
$theme['description']="The default theme";
$theme['author']="James Grant <james@lightbox.org>";
//COMMITTEE MAIN ICONS (that are not used in admin/config already)
$theme['icons']['change_password']="encrypted.png";
$theme['icons']['edit_profile']="edit_user.png";
//ADMIN ICONS
$theme['icons']['administration']="gear.png";
$theme['icons']['participant_registration']="accessories-text-editor.png";
$theme['icons']['print/export_reports']="application-pdf.png";
$theme['icons']['print_awards_ceremony_scripts']="application-pdf.png";
$theme['icons']['committee_management']="system-users.png";
$theme['icons']['awards_management']="plasmagik.png";
$theme['icons']['schools_management']="applications-education.png";
$theme['icons']['judging_management']="klipper.png";
$theme['icons']['translations_management']="kwordquiz.png";
$theme['icons']['report_management']="document-multiple.png";
$theme['icons']['volunteer_management']="user-group-new.png";
$theme['icons']['tour_management']="preferences-system-performance.png";
$theme['icons']['internal_document_management']="application-vnd.oasis.opendocument.text.png";
$theme['icons']['registration_fee_items_management']="transfers_list.png";
$theme['icons']['judging_score_entry']="transfers_list.png";
$theme['icons']['enter_winning_projects']="legalmoves.png";
$theme['icons']['one-click_cwsf_registration']="flag-blue.png";
$theme['icons']['one-click_ysf_affiliation_stats']="flag-green.png";
$theme['icons']['fair_stats']="view_sort_descending.png";
$theme['icons']['communication']="mail-mark-unread.png";
$theme['icons']['website_content_management']="toggle_log.png";
$theme['icons']['fundraising']="Coins-32x32.png";
//CONFIG ICONS
$theme['icons']['configuration']="package_utilities.png";
$theme['icons']['configuration_variables']="configure.png";
$theme['icons']['important_dates']="date.png";
$theme['icons']['project_age_categories']="kdmconfig.png";
$theme['icons']['project_divisions']="edu_science.png";
$theme['icons']['cwsf_project_divisions']="edu_science_canada.png";
$theme['icons']['project_sub_divisions']="chemical.png";
$theme['icons']['page_texts']="kwrite.png";
$theme['icons']['exhibitor_signature_page']="signature.png";
$theme['icons']['judge_registration_questions']="vcs_status.png";
$theme['icons']['project_safety_questions']="help-contents.png";
$theme['icons']['images']="elempic.png";
$theme['icons']['external_award_sources']="ark.png";
$theme['icons']['language_pack_installer']="kanagram.png";
$theme['icons']['new_version_checker']="numbers.png";
$theme['icons']['rollover_fair_year']="svn_switch.png";
$theme['icons']['backup_restore']="rebuild.png";
?>

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 815 B

After

Width:  |  Height:  |  Size: 815 B

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,76 @@
<?
/*
This file is part of the 'Science Fair In A Box' project
SFIAB Website: http://www.sfiab.ca
Copyright (C) 2008 James Grant <james@lightbox.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation, version 2.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
$theme_icons['name']="Default Icons";
$theme_icons['description']="KDE4 icons";
$theme_icons['author']="James Grant <james@lightbox.org>";
//COMMITTEE MAIN ICONS (that are not used in admin/config already)
$theme_icons['icons']['change_password']="encrypted.png";
$theme_icons['icons']['edit_profile']="edit_user.png";
$theme_icons['icons']['manage_roles']="agt_forum.png";
//ADMIN ICONS
$theme_icons['icons']['administration']="gear.png";
$theme_icons['icons']['participant_registration']="accessories-text-editor.png";
$theme_icons['icons']['print/export_reports']="application-pdf.png";
$theme_icons['icons']['print_awards_ceremony_scripts']="application-pdf.png";
$theme_icons['icons']['committee_management']="system-users.png";
$theme_icons['icons']['awards_management']="plasmagik.png";
$theme_icons['icons']['schools_management']="applications-education.png";
$theme_icons['icons']['judging_management']="klipper.png";
$theme_icons['icons']['sciencefair_management']="folder.png";
$theme_icons['icons']['translations_management']="kwordquiz.png";
$theme_icons['icons']['report_management']="document-multiple.png";
$theme_icons['icons']['volunteer_management']="user-group-new.png";
$theme_icons['icons']['tour_management']="preferences-system-performance.png";
$theme_icons['icons']['internal_document_management']="application-vnd.oasis.opendocument.text.png";
$theme_icons['icons']['registration_fee_items_management']="transfers_list.png";
$theme_icons['icons']['judging_score_entry']="transfers_list.png";
$theme_icons['icons']['enter_winning_projects']="legalmoves.png";
$theme_icons['icons']['one-click_cwsf_registration']="flag-blue.png";
$theme_icons['icons']['one-click_ysf_affiliation_stats']="flag-green.png";
$theme_icons['icons']['fair_stats']="view_sort_descending.png";
$theme_icons['icons']['communication']="mail-mark-unread.png";
$theme_icons['icons']['website_content_management']="toggle_log.png";
$theme_icons['icons']['fundraising']="Coins-32x32.png";
//CONFIG ICONS
$theme_icons['icons']['configuration']="package_utilities.png";
$theme_icons['icons']['configuration_variables']="configure.png";
$theme_icons['icons']['important_dates']="date.png";
$theme_icons['icons']['project_age_categories']="kdmconfig.png";
$theme_icons['icons']['project_divisions']="edu_science.png";
$theme_icons['icons']['cwsf_project_divisions']="edu_science_canada.png";
$theme_icons['icons']['project_sub_divisions']="chemical.png";
$theme_icons['icons']['page_texts']="kwrite.png";
$theme_icons['icons']['exhibitor_signature_page']="signature.png";
$theme_icons['icons']['judge_registration_questions']="vcs_status.png";
$theme_icons['icons']['project_safety_questions']="help-contents.png";
$theme_icons['icons']['images']="elempic.png";
$theme_icons['icons']['external_award_sources']="ark.png";
$theme_icons['icons']['language_pack_installer']="kanagram.png";
$theme_icons['icons']['new_version_checker']="numbers.png";
$theme_icons['icons']['rollover_fair_year']="svn_switch.png";
$theme_icons['icons']['backup_restore']="rebuild.png";
?>

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 794 B

After

Width:  |  Height:  |  Size: 794 B

View File

Before

Width:  |  Height:  |  Size: 558 B

After

Width:  |  Height:  |  Size: 558 B

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB