Index: branches/5.0.x/core/units/skins/skin_eh.php =================================================================== diff -u -r12202 -r12233 --- branches/5.0.x/core/units/skins/skin_eh.php (.../skin_eh.php) (revision 12202) +++ branches/5.0.x/core/units/skins/skin_eh.php (.../skin_eh.php) (revision 12233) @@ -1,6 +1,6 @@ SwitchToLive(); $ids = $event->MasterEvent->getEventParam('ids'); - if (!is_array($ids)) $ids = explode(',', $ids); - - if(!$ids) return false; - foreach($ids as $id) - { - $object->Load($id); - $this->Compile($object); + if (!is_array($ids)) { + $ids = explode(',', $ids); } - } - function Compile(&$object) - { - $ret = $object->GetDBField('CSS'); - $options = $object->GetDBField('Options'); - $options = unserialize($options); - $options['base_url'] = array('Value'=>rtrim($this->Application->BaseURL(), '/')); - foreach ($options as $key => $row) { - $ret = str_replace('@@'.$key.'@@', $row['Value'], $ret); + if (!$ids) { + return false; } - $compile_ts = adodb_mktime(); - $css_path = WRITEABLE . '/user_files/'; + $skin_helper =& $this->Application->recallObject('SkinHelper'); + /* @var $skin_helper SkinHelper */ - $css_file = $css_path.'admin-'.mb_strtolower($object->GetDBField('Name')).'-'.$compile_ts.'.css'; - - $fp = fopen($css_file,'w'); - if($fp) - { - $prev_css = $css_path.'admin-'.mb_strtolower($object->GetDBField('Name')).'-'.$object->GetDBField('LastCompiled').'.css'; - if( file_exists($prev_css) ) unlink($prev_css); - - fwrite($fp, $ret); - fclose($fp); - - $sql = 'UPDATE '.$object->TableName.' SET LastCompiled = '.$compile_ts.' WHERE '.$object->IDField.' = '.$object->GetID(); - $this->Conn->Query($sql); + foreach($ids as $id) { + $object->Load($id); + $skin_helper->compile($object); } } } \ No newline at end of file