Index: branches/5.0.x/core/units/admin/admin_tag_processor.php =================================================================== diff -u -r12202 -r12233 --- branches/5.0.x/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 12202) +++ branches/5.0.x/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 12233) @@ -1,6 +1,6 @@ Conn->GetRow('SELECT * FROM '.TABLE_PREFIX.'Skins WHERE IsPrimary = 1'); - } + $skin_helper =& $this->Application->recallObject('SkinHelper'); + /* @var $skin_helper SkinHelper */ - $css_path = WRITEABLE . DIRECTORY_SEPARATOR . 'user_files'; - $css_url = $this->Application->BaseURL( str_replace(DIRECTORY_SEPARATOR, '/', WRITEBALE_BASE) ) . 'user_files/'; - - $type = array_key_exists('type', $params) ? $params['type'] : false; - if ($type == 'logo') { - $type = 'Logo'; - } - - if ($type == 'Logo' || $type == 'LogoBottom' || $type == 'LogoLogin') { - return $style[$type] ? $css_url.$style[$type] : ''; - } - - $last_compiled = $style['LastCompiled']; - - $style_name = mb_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 (try to compile on the fly) - $object =& $this->Application->recallObject('skin.-item', null, Array ('skip_autoload' => true)); - /* @var $object kDBItem */ - - $skin_eh =& $this->Application->recallObject('skin_EventHandler'); - /* @var $skin_eh SkinEventHandler */ - - $object->Load(1, 'IsPrimary'); - $skin_eh->Compile($object); - $ret = $css_url.'admin-'.$style_name.'-'.adodb_mktime().'.css'; - } - } - - if (isset($params['file_only'])) return $ret; - - return ''; + return $skin_helper->AdminSkinTag($params); } function PrintCompileErrors($params)