- Timestamp:
- Jul 24, 2008, 11:56:35 PM (16 years ago)
- Location:
- trunk/plugins/SwiftThemeCreator
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/SwiftThemeCreator/theme.tpl
r2454 r2461 5 5 INPUT.rateButtonSelected /* <= why IE doesn't inherit this ? */ {ldelim} 6 6 color:{$main.color2}; } 7 #theImage IMG {ldelim} border -color:{$main.color2}; }7 #theImage IMG {ldelim} border: 3px ridge {$main.color2}; } 8 8 9 9 H2, #menubar DT, .throw, 10 10 A, INPUT.rateButton {ldelim} color: {$main.color3}; } 11 11 12 UL.tabsheet LI.normal_tab:hover {ldelim} border -color:{$main.color4}; }12 UL.tabsheet LI.normal_tab:hover {ldelim} border: 1px solid {$main.color4}; } 13 13 A:hover {ldelim} color: {$main.color4}; } 14 14 … … 16 16 .content UL.thumbnailCategories DIV.thumbnailCategory:hover, 17 17 .content UL.thumbnailCategories DIV.thumbnailCategory:hover A {ldelim} 18 color: {$main.color4}; border -color:{$main.color5}; background-color: {$main.color6}; }18 color: {$main.color4}; border: 1px solid {$main.color5}; background-color: {$main.color6}; } 19 19 20 20 #menubar DL, .content, #comments DIV.comment BLOCKQUOTE, 21 #imageHeaderBar, H2, #menubar DT, #imageToolBar {ldelim} border -color:{$main.color5}; }21 #imageHeaderBar, H2, #menubar DT, #imageToolBar {ldelim} border: 1px solid {$main.color5}; } 22 22 23 23 #menubar DL, .content, #imageToolBar, .header_notes, UL.tabsheet LI.selected_tab {ldelim} … … 26 26 FIELDSET, INPUT, SELECT, TEXTAREA, .content DIV.comment A.illustration IMG, 27 27 .content DIV.thumbnailCategory, .content UL.thumbnails SPAN.wrap2 {ldelim} 28 border -color:{$main.color6}; }28 border: 1px solid {$main.color6}; } 29 29 30 #comments DIV.comment BLOCKQUOTE {ldelim} border- color:{$main.color7}; }30 #comments DIV.comment BLOCKQUOTE {ldelim} border-left: 1px solid {$main.color7}; } 31 31 32 32 H2, #menubar DT, .throw {ldelim} background-image: url(stc.png); } -
trunk/plugins/SwiftThemeCreator/theme_creator.php
r2454 r2461 25 25 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 26 26 if (!defined('IN_ADMIN') or !IN_ADMIN) die('Hacking attempt!'); 27 27 define(STC_PATH, PHPWG_PLUGINS_PATH.'SwiftThemeCreator/'); 28 28 /* 29 29 * stc_hex2rgb convert any string to array of RGB values … … 69 69 function stc_newfile( $filename, $data ) 70 70 { 71 $fp = fopen($filename, 'w'); 72 if ($fp) 73 { 71 $fp = @fopen($filename, 'w'); 72 if ($fp) { 74 73 $ret = fwrite($fp, $data); 75 fclose($fp);74 @fclose($fp); 76 75 return $ret; 77 76 } … … 137 136 138 137 // 2.2 - Background and Internal links control 139 list($r1,$g1,$b1) = stc_hex2rgb($main['color'][0]); 140 list($r2,$g2,$b2) = stc_hex2rgb($main['color'][2]); 141 // Background and Internal links "brightness" difference control: 142 $dif = abs( ( (($r1*299)+($g1*587)+($b1*114)) / 1000 ) 143 - ( (($r2*299)+($g2*587)+($b2*114)) / 1000 )); 144 if ( $dif < 65 ) 138 if (isset($do_it)) 139 { 140 list($r1,$g1,$b1) = stc_hex2rgb($main['color'][0]); 141 list($r2,$g2,$b2) = stc_hex2rgb($main['color'][2]); 142 // Background and Internal links "brightness" difference control: 143 $dif = abs( ( (($r1*299)+($g1*587)+($b1*114)) / 1000 ) 144 - ( (($r2*299)+($g2*587)+($b2*114)) / 1000 )); 145 if ( $dif < 65 ) 146 array_push($errors, 147 l10n('Insufficient brightness difference between ' 148 . 'Internal links and background. dif=') . $dif); 149 // Background and Internal links "colour" difference control: 150 $dif = (max($r1, $r2) - min($r1, $r2)) 151 + (max($g1, $g2) - min($g1, $g2)) 152 + (max($b1, $b2) - min($b1, $b2)); 153 if ( $dif < 200 ) 145 154 array_push($errors, 146 l10n('Insufficient brightness difference between ' 147 . 'Internal links and background. dif=') . $dif); 148 // Background and Internal links "colour" difference control: 149 $dif = (max($r1, $r2) - min($r1, $r2)) 150 + (max($g1, $g2) - min($g1, $g2)) 151 + (max($b1, $b2) - min($b1, $b2)); 152 if ( $dif < 200 ) 153 array_push($errors, 154 l10n('Insufficient colour difference between ' 155 . 'Internal links and background. dif=') . $dif); 156 155 l10n('Insufficient colour difference between ' 156 . 'Internal links and background. dif=') . $dif); 157 } 157 158 // 3 - Directory control 158 159 $main['templatedir'] = PHPWG_ROOT_PATH . 'template/' … … 199 200 if (count($errors) == 0) { 200 201 umask(0000); 201 mkdir($themedir, 0777);202 @mkdir($themedir, 0705); 202 203 if (!is_dir( $themedir )) 203 204 array_push($errors, … … 211 212 $plugin_tpl = new Template(); 212 213 $plugin_tpl->set_filenames(array('themeconf'=> 213 dirname(__FILE__) . '/themeconf.inc.tpl'));214 STC_PATH . 'themeconf.inc.tpl')); 214 215 $plugin_tpl->assign('main',$main); 215 216 $main['themeconf_inc_php'] = $plugin_tpl->parse('themeconf', true); … … 220 221 **/ 221 222 $plugin_tpl->set_filenames(array('mailcss'=> 222 dirname(__FILE__) . '/mail-css.tpl2'));223 STC_PATH . 'mail-css.tpl2')); 223 224 $plugin_tpl->assign('main',$main); 224 225 $main['mail-css.tpl'] = $plugin_tpl->parse('mailcss', true); … … 229 230 **/ 230 231 $plugin_tpl->set_filenames(array('theme'=> 231 dirname(__FILE__) . '/theme.tpl'));232 STC_PATH . 'theme.tpl')); 232 233 $plugin_tpl->assign('main',$main); 233 234 $main['theme.css'] = $plugin_tpl->parse('theme', true); … … 239 240 if (function_exists('imagecreatefrompng')) 240 241 { 241 $img = imagecreatefrompng( dirname(__FILE__). '/titrePage-bg.png');242 $img = imagecreatefrompng(STC_PATH . '/titrePage-bg.png'); 242 243 $dest = imagecreate(1, 64); 243 244 for ($i=0; $i<256; $i++) { … … 256 257 imagedestroy ($dest); 257 258 } 258 else @copy( dirname(__FILE__)259 else @copy( STC_PATH 259 260 . '/titrePage-bg.png', $themedir . '/stc.png'); 260 261 if ($r == false) { … … 274 275 } 275 276 } 276 277 // TODO ******** HEADER ********* 277 278 // Interesting Graphic Charter 278 279 // http://accessites.org/site/2006/08/visual-vs-structural/ … … 284 285 // | reset values 285 286 // +-----------------------------------------------------------------------+ 286 287 if (isset($_POST['reset']) and (!is_adviser())) { 288 $main = array(); 289 $swift_theme_creator->theme_config = $main; 290 $swift_theme_creator->save_theme_config(); 291 redirect( get_admin_plugin_menu_link(dirname(__FILE__).'/theme_creator.php')); 292 } 287 293 // To be implemented delete $main save and redirect 288 294 -
trunk/plugins/SwiftThemeCreator/theme_creator.tpl
r2447 r2461 146 146 </fieldset> 147 147 148 <p><input name="submit" class="submit" type="submit" value="{'Submit'|@translate}" /></p> 148 <p> 149 <input name="reset" class="submit" type="submit" value="{'Reset'|@translate}" /> 150 <input name="submit" class="submit" type="submit" value="{'Submit'|@translate}" /> 151 </p> 149 152 </form>
Note: See TracChangeset
for help on using the changeset viewer.