Index: branches/RC/core/units/admin/admin_tag_processor.php =================================================================== diff -u -N -r11705 -r11721 --- branches/RC/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 11705) +++ branches/RC/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 11721) @@ -800,8 +800,8 @@ $style = $this->Conn->GetRow('SELECT * FROM '.TABLE_PREFIX.'Skins WHERE IsPrimary = 1'); } - $css_path = (defined('WRITEABLE') ? WRITEABLE : FULL_PATH.'/kernel') . '/user_files'; - $css_url = $this->Application->BaseURL(defined('WRITEBALE_BASE') ? WRITEBALE_BASE : '/kernel') . 'user_files/'; + $css_path = (defined('WRITEABLE') ? WRITEABLE : FULL_PATH. DIRECTORY_SEPARATOR . 'kernel') . DIRECTORY_SEPARATOR . 'user_files'; + $css_url = $this->Application->BaseURL(defined('WRITEBALE_BASE') ? str_replace(DIRECTORY_SEPARATOR, '/', WRITEBALE_BASE) : '/kernel') . 'user_files/'; $type = array_key_exists('type', $params) ? $params['type'] : false; if ($type == 'logo') { Index: branches/RC/core/kernel/db/db_event_handler.php =================================================================== diff -u -N -r11711 -r11721 --- branches/RC/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 11711) +++ branches/RC/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 11721) @@ -554,7 +554,7 @@ $object =& $event->getObject(); $id = $this->getPassedID($event); - if ($object->isLoaded() && ($object->GetID() == $id)) { + if ($object->isLoaded() && !is_array($id) && ($object->GetID() == $id)) { // object is already loaded by same id return ; } @@ -2337,6 +2337,7 @@ $path = FULL_PATH.$options['upload_dir'].$this->Application->GetVar('file'); } + $path = str_replace('/', DIRECTORY_SEPARATOR, $path); $type = mime_content_type($path); header('Content-Length: '.filesize($path)); Index: branches/RC/core/units/general/helpers/image_helper.php =================================================================== diff -u -N -r11305 -r11721 --- branches/RC/core/units/general/helpers/image_helper.php (.../image_helper.php) (revision 11305) +++ branches/RC/core/units/general/helpers/image_helper.php (.../image_helper.php) (revision 11721) @@ -64,7 +64,7 @@ if ($needs_resize || array_key_exists('wm_filename', $params) && $params['wm_filename']) { // resize required OR watermarking required -> change resulting image name ! - $dst_image = preg_replace('/^'.preg_quote($src_path, '/').'(.*)\.(.*)$/', $src_path.'/resized\\1_'.crc32(serialize($params)).'.\\2', $src_image); + $dst_image = preg_replace('/^'.preg_quote($src_path, '/').'(.*)\.(.*)$/', $src_path . DIRECTORY_SEPARATOR . 'resized\\1_' . crc32(serialize($params)) . '.\\2', $src_image); if (!file_exists($dst_image) || filemtime($src_image) > filemtime($dst_image)) { // resized image not available OR should be recreated due source image change $params['dst_image'] = $dst_image; @@ -87,7 +87,7 @@ } $base_url = rtrim($this->Application->BaseURL(), '/'); - return preg_replace('/^'.preg_quote(FULL_PATH, '/').'(.*)/', $base_url.'\\1', $src_image); + return str_replace(DIRECTORY_SEPARATOR, '/', preg_replace('/^'.preg_quote(FULL_PATH, '/').'(.*)/', $base_url.'\\1', $src_image)); } /** Index: branches/RC/core/kernel/utility/formatters/upload_formatter.php =================================================================== diff -u -N -r11361 -r11721 --- branches/RC/core/kernel/utility/formatters/upload_formatter.php (.../upload_formatter.php) (revision 11361) +++ branches/RC/core/kernel/utility/formatters/upload_formatter.php (.../upload_formatter.php) (revision 11721) @@ -233,13 +233,13 @@ $image_helper =& $this->Application->recallObject('ImageHelper'); /* @var $image_helper ImageHelper */ - return $image_helper->ResizeImage(FULL_PATH.$upload_dir.$value, $format); + return $image_helper->ResizeImage(FULL_PATH . str_replace('/', DIRECTORY_SEPARATOR, $upload_dir) . $value, $format); } switch ($format) { case 'full_url': if (isset($options['direct_links']) && $options['direct_links']) { - return rtrim($this->Application->BaseURL(), '/').$upload_dir.$value; + return rtrim($this->Application->BaseURL(), '/') . str_replace(DIRECTORY_SEPARATOR, '/', $upload_dir) . $value; } else { $url_params = Array ( @@ -252,18 +252,18 @@ break; case 'full_path': - return FULL_PATH.$upload_dir.$value; + return FULL_PATH . str_replace('/', DIRECTORY_SEPARATOR, $upload_dir) . $value; break; case 'file_size': - return filesize(FULL_PATH.$upload_dir.$value); + return filesize(FULL_PATH . str_replace('/', DIRECTORY_SEPARATOR, $upload_dir) . $value); break; case 'img_size': $image_helper =& $this->Application->recallObject('ImageHelper'); /* @var $image_helper ImageHelper */ - $image_info = $image_helper->getImageInfo(FULL_PATH . $upload_dir . $value); + $image_info = $image_helper->getImageInfo(FULL_PATH . str_replace('/', DIRECTORY_SEPARATOR, $upload_dir) . $value); return $image_info ? $image_info[3] : ''; break; } Index: branches/RC/core/units/skins/skin_eh.php =================================================================== diff -u -N -r10098 -r11721 --- branches/RC/core/units/skins/skin_eh.php (.../skin_eh.php) (revision 10098) +++ branches/RC/core/units/skins/skin_eh.php (.../skin_eh.php) (revision 11721) @@ -2,7 +2,32 @@ class SkinEventHandler extends kDBEventHandler { + function mapPermissions() + { + parent::mapPermissions(); + $permissions = Array ( + 'OnItemBuild' => Array ('self' => true), + ); + + $this->permMapping = array_merge($this->permMapping, $permissions); + } + /** + * With "primary" special loads primary skin + * + * @param kEvent $event + * @return int + */ + function getPassedID(&$event) + { + if ($event->Special == 'primary') { + return Array ('IsPrimary' => 1); + } + + return parent::getPassedID($event); + } + + /** * Allows to set selected theme as primary * * @param kEvent $event