3 * Yotsubanome CSS Library
5 * CSS data base loader for main program
7 * http://www.magmagateau.com/fuukaba/ is the source of the code
18 if(file_exists(DATA_DIR.CSV_SS)){ // Load FuuR4 CSS data
19 $style_data = DATA_DIR.CSV_SS;
21 $lines = explode("\n", file_get_contents($style_data));
22 foreach($lines as $null => $line){
24 list($style_name, $style_short, $style_path, $style_rel) = explode (',', $line);
25 $style_path = CSS_DIR.$style_path;
26 if(file_exists($style_path)){
27 if($style_rel) $style_rel = 'stylesheet';
28 else $style_rel = 'alternate stylesheet';
29 $style_load .= '<link rel="'.$style_rel.'" type="text/css" href="'.$style_path.'" title="'.$style_name.'" />'."\n";
30 $style_js = format_js_var($style_name);
31 $style_title = str_replace('[what]', $style_name, _T('style_tooltip'));
32 $style_bar .= ' <a href="javascript:set_stylesheet('.$style_js.')" title="'.$style_title.'">'.$style_short.'</a> |';
37 // Tidy up trailing seperators and empty brackets
38 $style_bar = str_replace('|]', ']', $style_bar);
39 $style_bar = str_replace('[] ', '', $style_bar);
40 $style_bar = str_replace('[]', '', $style_bar);
43 // Load stylesheet setting from config.php
44 // if either of the datafiles are missing or empty
45 if(str_replace('[]', '', $style_bar) == '') $style_load .= '<link rel="stylesheet" type="text/css" href="'.CSS_DIR.CSSFILE.'" />';
47 // style sheet js loader
48 $jsdonk = 'var style_cookie = "';
49 $jsdonk .= ($style_bar) ? 'yo_style' : '';
52 // CSS data is loaded And we proceed with head()