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