Index: branches/unlabeled/unlabeled-1.36.2/core/units/admin/admin_tag_processor.php =================================================================== diff -u -r8180 -r8211 --- branches/unlabeled/unlabeled-1.36.2/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 8180) +++ branches/unlabeled/unlabeled-1.36.2/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 8211) @@ -153,11 +153,11 @@ $debug_mode = $this->Application->isDebugMode(); $super_admin_mode = $this->Application->RecallVar('super_admin'); - + ksort($section_data['children'], SORT_NUMERIC); foreach ($section_data['children'] as $section_name) { $section_data =& $sections_helper->getSectionData($section_name); - + if (isset($section_data['show_mode'])) { $show_mode = $section_data['show_mode']; // if super admin section -> show in super admin mode & debug mode @@ -170,7 +170,7 @@ continue; } } - + $params['section_name'] = $section_name; $ret .= $this->DrawTree($params); $deep_level--; @@ -737,6 +737,60 @@ return $this->Application->HREF($t, '', $vars); } + + + function AdminSkin($params) + { + static $style; + if (!isset($style)) { + $style = $this->Conn->GetRow('SELECT * FROM '.TABLE_PREFIX.'Skins WHERE IsPrimary = 1'); + } + + $css_path = WRITEABLE.'/user_files'; + $css_url = $this->Application->BaseURL(WRITEBALE_BASE).'user_files/'; + + if (isset($params['type']) && $params['type'] == 'logo') { + return $css_url.$style['Logo']; + } + + $last_compiled = $style['LastCompiled']; + + $style_name = strtolower( $style['Name'] ); + + if( file_exists($css_path.'/'.'admin-'.$style_name.'-'.$last_compiled.'.css') ) + { + $ret = $css_url.'admin-'.$style_name.'-'.$last_compiled.'.css'; + + } + else + { + // search for previously compiled stylesheet + $last_compiled = 0; + if( $dh = opendir($css_path) ) + { + while( ($file = readdir($dh)) !== false ) + { + if( preg_match('/admin-(.*)-([\d]+).css/', $file, $rets) ) + { + if( $rets[1] == $style_name && $rets[2] > $last_compiled ) $last_compiled = $rets[2]; + } + } + closedir($dh); + } + if ($last_compiled) { + // found + $ret = $css_url.'admin-'.$style_name.'-'.$last_compiled.'.css'; + } + else { + // not found + return ''; + } + } + + if (isset($params['file_only'])) return $ret; + + return ''; + } } ?> \ No newline at end of file