Index: trunk/kernel/admin_templates/incs/fw_menu.js =================================================================== diff -u -N -r5009 -r5060 --- trunk/kernel/admin_templates/incs/fw_menu.js (.../fw_menu.js) (revision 5009) +++ trunk/kernel/admin_templates/incs/fw_menu.js (.../fw_menu.js) (revision 5060) @@ -33,7 +33,7 @@ this.menuBorderBgColor = "#777777"; this.menuHiliteBgColor = "#e0e0da"; this.menuContainerBgColor = "#cccccc"; - this.imagePath = (typeof(activeTab) != 'undefined') ? 'images/' : 'img/'; + this.imagePath = img_path.replace('#MODULE#', 'kernel'); this.childMenuIcon = "menu_arrow.gif"; this.items = new Array(); this.actions = new Array(); Index: trunk/kernel/admin_templates/incs/toolbar.js =================================================================== diff -u -N -r5057 -r5060 --- trunk/kernel/admin_templates/incs/toolbar.js (.../toolbar.js) (revision 5057) +++ trunk/kernel/admin_templates/incs/toolbar.js (.../toolbar.js) (revision 5060) @@ -25,41 +25,35 @@ ToolBarButton.prototype.CheckTitleModule = function() { if (this.Title.match(/([^:]+):(.*)$/)) { + // has module set directly this.Title = RegExp.$2; - this.Module = RegExp.$1 + '/'; + this.Module = RegExp.$1; } - else this.Module = ''; + else { + // use default module + this.Module = 'kernel'; + } } ToolBarButton.prototype.IconsPath = function() { if (!img_path) { alert('error: toolbar image path not set'); } -// alert('base toolbar button: ['+img_path + this.Module + 'toolbar/'+'];'); - return img_path + this.Module + 'toolbar/'; + return img_path.replace('#MODULE#', this.Module) + 'toolbar/'; } ToolBarButton.prototype.GetHTML = function() { - return ''; + return ''; } -ToolBarButton.prototype.GetObject = function() { - var $img = document.createElement('IMG'); - $img.id = this.GetToolId(); - $img.src = this.IconsPath() + this.ToolBar.IconPrefix + this.Title + '.gif'; - $img.title = this.Alt; - return $img; -} - -ToolBarButton.prototype.GetToolId = function() { +ToolBarButton.prototype.GetToolID = function() { return this.Prefix == '' ? 'tool_' + this.Title : 'tool_['+this.Prefix+'][' + this.Title+']' } ToolBarButton.prototype.Init = function() { - - img = document.getElementById(this.GetToolId()); - + + img = document.getElementById(this.GetToolID()); this.imgObject = img; img.btn = this; this.SetOnMouseOver(); @@ -152,17 +146,9 @@ ToolBarSeparator.prototype = new ToolBarButton; ToolBarSeparator.prototype.GetHTML = function() { - return ''; + return ''; } -ToolBarSeparator.prototype.GetObject = function() { - var $img = document.createElement('IMG'); - $img.id = 'tool_' + this.Title; - $img.src = this.IconsPath() + 'tool_divider.gif'; - $img.title = ''; - return $img; -} - ToolBarSeparator.prototype.Init = function() { img = document.getElementById(this.ToolBar.IconPrefix + this.Title); this.imgObject = img; @@ -175,13 +161,10 @@ /* ----------- */ - -function ToolBar(icon_prefix) +function ToolBar(icon_prefix, $module) { - if (typeof(icon_prefix) == 'undefined') - this.IconPrefix = 'tool_'; - else - this.IconPrefix = icon_prefix; + this.Module = $module ? $module : 'kernel'; + this.IconPrefix = icon_prefix ? icon_prefix : 'tool_'; this.Buttons = new Array(); } @@ -194,13 +177,13 @@ ToolBar.prototype.Render = function($container) { if ($container) { - html = ''; + $container.innerHTML = ''; // container will contain only buttons for (var i in this.Buttons) { btn = this.Buttons[i]; - html += btn.GetHTML(); -// appendChild( btn.GetObject() ); + $container.innerHTML += btn.GetHTML(); } - $container.innerHTML = html; + + // init all buttons after because objects are not yet created directly after assigning to innerHTML for (var i in this.Buttons) { btn = this.Buttons[i]; btn.Init(); Index: trunk/core/admin_templates/catalog/catalog.tpl =================================================================== diff -u -N -r5048 -r5060 --- trunk/core/admin_templates/catalog/catalog.tpl (.../catalog.tpl) (revision 5048) +++ trunk/core/admin_templates/catalog/catalog.tpl (.../catalog.tpl) (revision 5060) @@ -138,6 +138,14 @@ + + + + + + - Index: trunk/kernel/admin_templates/incs/header.tpl =================================================================== diff -u -N -r5044 -r5060 --- trunk/kernel/admin_templates/incs/header.tpl (.../header.tpl) (revision 5044) +++ trunk/kernel/admin_templates/incs/header.tpl (.../header.tpl) (revision 5060) @@ -30,7 +30,7 @@ var tpl_changed = 0; var base_url = ''; var $base_path = ''; -var img_path = '/img/'; +var img_path = '/img/'; Index: trunk/kernel/admin_templates/catalog.tpl =================================================================== diff -u -N -r5048 -r5060 --- trunk/kernel/admin_templates/catalog.tpl (.../catalog.tpl) (revision 5048) +++ trunk/kernel/admin_templates/catalog.tpl (.../catalog.tpl) (revision 5060) @@ -138,6 +138,14 @@ +
@@ -151,13 +159,9 @@ " PrefixSpecial="c" Grid="Default" style="border: 1px solid grey;"> +
+ + + + + - Index: trunk/kernel/admin_templates/img/toolbar/tool_new_discount.gif =================================================================== diff -u -N -r1566 -r5060 Binary files differ Index: trunk/kernel/admin_templates/img/toolbar/tool_new_discount_f2.gif =================================================================== diff -u -N -r1566 -r5060 Binary files differ Index: trunk/core/kernel/processors/main_processor.php =================================================================== diff -u -N -r5044 -r5060 --- trunk/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 5044) +++ trunk/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 5060) @@ -33,7 +33,14 @@ */ function TemplatesBase($params) { - return $this->Application->BaseURL().substr(THEMES_PATH, 1); + if ($this->Application->IsAdmin()) { + $module = isset($params['module']) ? $params['module'] : 'kernel'; + $path = preg_replace('/\/(.*?)\/(.*)/', $module.'/\\2', THEMES_PATH); // remove leading slash + substitute module + } + else { + $path = substr(THEMES_PATH, 1); + } + return $this->Application->BaseURL().$path; } /**
@@ -151,13 +159,9 @@ " PrefixSpecial="c" Grid="Default" style="border: 1px solid grey;"> +