Drupal color.module
Jump to navigation
Jump to search
This module allows for the altering of the color theme of the site. The module was altered as follows:
Drupal 6.1
STEP 1
In /includes/file.inc, replace (line 756):
$file = tempnam(realpath($temp), 'file');
With:
$file = tempnam($temp, 'file'); //tempnam(realpath($temp), 'file'); //WOLFTECH CHANGES MADE HERE
STEP 2
In /includes/common.inc, comment out all calls to the chdir() function;
STEP 3
In /includes/common.inc, replace (line 1880):
return preg_replace('/url\(([\'"]?)(?![a-z]+:)([^\'")]+)[\'"]?\)?;/i', 'url(\1'. dirname($filename) .'/', $file);
With:
return preg_replace('/url\(([\'"]?)(?![a-z]+:)([^\'")]+)[\'"]?\)?;/i', 'url(\1'. drupal_get_path('theme', $theme) . dirname($filename) .'/', drupal_get_path('theme', $theme) . $file); //WOLFTECH CHANGES MADE
STEP 4
Fix the theme screenshot display. In /modules/color/color.module, replace (line 54):
if ($form_id == 'system_theme_select_form' || $form_id == 'system_themes') {
With:
//if ($form_id == 'system_theme_select_form' || $form_id == 'system_themes') { if(preg_match("#system_theme.+form$#", $form_id)) { //WOLFTECH CHANGES MADE
STEP 5
Comment out all lines in the .htaccess file located in the [drupal_install_root]/sites/default/files/ directory
Drupal 5.6
All changes made are in /modules/color/color.module.
STEP 1
Replace (line 296-300):
// Look for @import commands and insert the referenced stylesheets. $cwd = getcwd(); chdir(drupal_get_path('theme', $theme)); $style = preg_replace_callback('/@import\s*["\']([^"\']+)["\'];/', '_color_import_stylesheet', $style); chdir($cwd);
With:
// Look for @import commands and insert the referenced stylesheets. $cwd = getcwd(); //chdir(drupal_get_path('theme', $theme)); //WOLFTECH CHANGES MADE $style = preg_replace_callback('/@import\s*["\']([^"\']+)["\'];/', '_color_import_stylesheet', $style); //chdir($cwd); //WOLFTECH CHANGES MADE
STEP 2
Replace (line 361-363):
function _color_import_stylesheet($matches) { return preg_replace('/url\(([\'"]?)(?![a-z]+:)/i', 'url(\1'. dirname($matches[1]) .'/', file_get_contents($matches[1])); }
With:
function _color_import_stylesheet($matches) { return preg_replace('/url\(([\'"]?)(?![a-z]+:)/i', 'url(\1'. drupal_get_path('theme', $theme) . dirname($matches[1]) .'/', drupal_get_path('theme', $theme) . file_get_contents($matches[1])); //WOLFTECH CHANGES MADE }
STEP 3
Comment out all lines in the .htaccess file located in the [drupal_install_root]/files/ directory