Changeset 678985
- Timestamp:
- 03/10/2013 06:38:19 AM (13 years ago)
- Location:
- color-scheme-every-theme
- Files:
-
- 5 edited
- 7 copied
-
tags/1.2 (copied) (copied from color-scheme-every-theme/trunk)
-
tags/1.2/classes (copied) (copied from color-scheme-every-theme/trunk/classes)
-
tags/1.2/classes/ColorExtractor.class.php (copied) (copied from color-scheme-every-theme/trunk/classes/ColorExtractor.class.php) (3 diffs)
-
tags/1.2/color-scheme-every-theme.php (copied) (copied from color-scheme-every-theme/trunk/color-scheme-every-theme.php) (1 diff)
-
tags/1.2/languages (copied) (copied from color-scheme-every-theme/trunk/languages)
-
tags/1.2/readme.txt (copied) (copied from color-scheme-every-theme/trunk/readme.txt) (2 diffs)
-
tags/1.2/views (copied) (copied from color-scheme-every-theme/trunk/views)
-
tags/1.2/views/options.view.php (modified) (1 diff)
-
trunk/classes/ColorExtractor.class.php (modified) (3 diffs)
-
trunk/color-scheme-every-theme.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/views/options.view.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
color-scheme-every-theme/tags/1.2/classes/ColorExtractor.class.php
r676649 r678985 13 13 14 14 private function rglob($pattern='*', $flags = 0, $path='') { 15 $paths=glob($path.'*', GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT); 16 $files=glob($path.$pattern, $flags); 15 $paths = glob($path.'*', GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT); 16 $files = glob($path.$pattern, $flags); 17 18 if (!is_array($paths) || !is_array($files)) return array(); 19 17 20 foreach ($paths as $path) { $files=array_merge($files,$this->rglob($pattern, $flags, $path)); } 21 18 22 return $files; 19 23 } … … 90 94 $replace_colors = array(); 91 95 $color_rules = array(); 92 $default_colors = array(); 93 foreach ($this->rglob('*.css',0,get_stylesheet_directory()) as $css_file) { 96 $default_colors = array(); 97 $css_files = $this->rglob('*.css',0,get_stylesheet_directory()); 98 foreach ($css_files as $css_file) { 94 99 $clean_css = preg_replace(array_keys($regex),$regex,file_get_contents($css_file)); 95 100 $clean_css = str_replace(array("\r\n","\r","\n"),"",$clean_css); … … 116 121 } 117 122 118 $default_colors_template = "/**\n * Default colors\n *\n"; 119 foreach ($default_colors as $color_id => $default_color) { 120 $default_colors_template .= " * ".$color_id.": ".$default_color.";\n"; 123 if (!empty($css_files)) { 124 $default_colors_template = "/**\n * Default colors\n *\n"; 125 foreach ($default_colors as $color_id => $default_color) { 126 $default_colors_template .= " * ".$color_id.": ".$default_color.";\n"; 127 } 128 $default_colors_template .= " */\n\n\n"; 129 130 $css_template = ""; 131 foreach ($color_rules as $color_rule => $selectors) { 132 $css_template .= implode(",\n",$selectors)."{\n\t".$color_rule.";\n}\n"; 133 } 134 $css_template = str_replace(array_keys($replace_colors),$replace_colors,$css_template); 135 file_put_contents($this->current_css_tmpl,$default_colors_template.$css_template); 136 } else { 137 if (file_exists($this->current_css_tmpl)) { 138 unlink($this->current_css_tmpl); 139 } 121 140 } 122 $default_colors_template .= " */\n\n\n";123 124 $css_template = "";125 foreach ($color_rules as $color_rule => $selectors) {126 $css_template .= implode(",\n",$selectors)."{\n\t".$color_rule.";\n}\n";127 }128 $css_template = str_replace(array_keys($replace_colors),$replace_colors,$css_template);129 file_put_contents($this->current_css_tmpl,$default_colors_template.$css_template);130 141 } 131 142 } -
color-scheme-every-theme/tags/1.2/color-scheme-every-theme.php
r676649 r678985 4 4 Plugin URI: http://www.danielauener.com/color-scheme-every-theme 5 5 Description: This plugin lets you change the entire color scheme of the current theme via the theme customizer. 6 Version: 1. 16 Version: 1.2 7 7 Author: @danielauener 8 8 Author URI: http://www.danielauener.se -
color-scheme-every-theme/tags/1.2/readme.txt
r676649 r678985 5 5 Requires at least: 3.4 6 6 Tested up to: 3.5 7 Stable tag: 1. 17 Stable tag: 1.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 53 53 = 1.1 = 54 54 * Fixed a bug that resulted in a blank page after generating the color scheme - thanks to Stiaan for reporting the bug and Ulrich P for helping me to reproduce it! 55 56 = 1.11 = 57 * Handle situations where no theme is activated or the current theme has no css file in it. -
color-scheme-every-theme/tags/1.2/views/options.view.php
r673507 r678985 10 10 if (!$template_exists) : ?> 11 11 <p><?php _e("There is no color scheme generatad for your current theme.", 'cset'); ?></p><?php 12 if (isset($_GET['settings-updated']) && $_GET['settings-updated'] == 'true') : ?> 13 <p style="color:#990000;"><?php _e("There was an error while generating the color scheme. <br />Check if you have an active and working theme and if there is any css-file in your active theme!"); ?></p><?php 14 endif; 12 15 elseif ($colors): ?> 13 16 <textarea rows="10" style="width:100%;">if ( function_exists( 'cset_add_color_scheme' ) ) { -
color-scheme-every-theme/trunk/classes/ColorExtractor.class.php
r676649 r678985 13 13 14 14 private function rglob($pattern='*', $flags = 0, $path='') { 15 $paths=glob($path.'*', GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT); 16 $files=glob($path.$pattern, $flags); 15 $paths = glob($path.'*', GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT); 16 $files = glob($path.$pattern, $flags); 17 18 if (!is_array($paths) || !is_array($files)) return array(); 19 17 20 foreach ($paths as $path) { $files=array_merge($files,$this->rglob($pattern, $flags, $path)); } 21 18 22 return $files; 19 23 } … … 90 94 $replace_colors = array(); 91 95 $color_rules = array(); 92 $default_colors = array(); 93 foreach ($this->rglob('*.css',0,get_stylesheet_directory()) as $css_file) { 96 $default_colors = array(); 97 $css_files = $this->rglob('*.css',0,get_stylesheet_directory()); 98 foreach ($css_files as $css_file) { 94 99 $clean_css = preg_replace(array_keys($regex),$regex,file_get_contents($css_file)); 95 100 $clean_css = str_replace(array("\r\n","\r","\n"),"",$clean_css); … … 116 121 } 117 122 118 $default_colors_template = "/**\n * Default colors\n *\n"; 119 foreach ($default_colors as $color_id => $default_color) { 120 $default_colors_template .= " * ".$color_id.": ".$default_color.";\n"; 123 if (!empty($css_files)) { 124 $default_colors_template = "/**\n * Default colors\n *\n"; 125 foreach ($default_colors as $color_id => $default_color) { 126 $default_colors_template .= " * ".$color_id.": ".$default_color.";\n"; 127 } 128 $default_colors_template .= " */\n\n\n"; 129 130 $css_template = ""; 131 foreach ($color_rules as $color_rule => $selectors) { 132 $css_template .= implode(",\n",$selectors)."{\n\t".$color_rule.";\n}\n"; 133 } 134 $css_template = str_replace(array_keys($replace_colors),$replace_colors,$css_template); 135 file_put_contents($this->current_css_tmpl,$default_colors_template.$css_template); 136 } else { 137 if (file_exists($this->current_css_tmpl)) { 138 unlink($this->current_css_tmpl); 139 } 121 140 } 122 $default_colors_template .= " */\n\n\n";123 124 $css_template = "";125 foreach ($color_rules as $color_rule => $selectors) {126 $css_template .= implode(",\n",$selectors)."{\n\t".$color_rule.";\n}\n";127 }128 $css_template = str_replace(array_keys($replace_colors),$replace_colors,$css_template);129 file_put_contents($this->current_css_tmpl,$default_colors_template.$css_template);130 141 } 131 142 } -
color-scheme-every-theme/trunk/color-scheme-every-theme.php
r676649 r678985 4 4 Plugin URI: http://www.danielauener.com/color-scheme-every-theme 5 5 Description: This plugin lets you change the entire color scheme of the current theme via the theme customizer. 6 Version: 1. 16 Version: 1.2 7 7 Author: @danielauener 8 8 Author URI: http://www.danielauener.se -
color-scheme-every-theme/trunk/readme.txt
r676649 r678985 5 5 Requires at least: 3.4 6 6 Tested up to: 3.5 7 Stable tag: 1. 17 Stable tag: 1.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 53 53 = 1.1 = 54 54 * Fixed a bug that resulted in a blank page after generating the color scheme - thanks to Stiaan for reporting the bug and Ulrich P for helping me to reproduce it! 55 56 = 1.11 = 57 * Handle situations where no theme is activated or the current theme has no css file in it. -
color-scheme-every-theme/trunk/views/options.view.php
r673507 r678985 10 10 if (!$template_exists) : ?> 11 11 <p><?php _e("There is no color scheme generatad for your current theme.", 'cset'); ?></p><?php 12 if (isset($_GET['settings-updated']) && $_GET['settings-updated'] == 'true') : ?> 13 <p style="color:#990000;"><?php _e("There was an error while generating the color scheme. <br />Check if you have an active and working theme and if there is any css-file in your active theme!"); ?></p><?php 14 endif; 12 15 elseif ($colors): ?> 13 16 <textarea rows="10" style="width:100%;">if ( function_exists( 'cset_add_color_scheme' ) ) {
Note: See TracChangeset
for help on using the changeset viewer.