Index: trunk/kernel/admin_templates/incs/toolbar.js =================================================================== diff -u -r5009 -r5044 --- trunk/kernel/admin_templates/incs/toolbar.js (.../toolbar.js) (revision 5009) +++ trunk/kernel/admin_templates/incs/toolbar.js (.../toolbar.js) (revision 5044) @@ -35,13 +35,22 @@ 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/'; } ToolBarButton.prototype.GetHTML = function() { return ''; } +ToolBarButton.prototype.GetObject = function() { + var $img = document.createElement('IMG'); + $img.id = 'tool_' + this.Title; + $img.src = this.IconsPath() + this.ToolBar.IconPrefix + this.Title + '.gif'; + $img.title = this.Alt; + return $img; +} + ToolBarButton.prototype.Init = function() { img = document.getElementById('tool_' + this.Title); this.imgObject = img; @@ -139,6 +148,14 @@ 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; @@ -167,13 +184,22 @@ this.Buttons[a_button.Title] = a_button; } -ToolBar.prototype.Render = function() +ToolBar.prototype.Render = function($container) { - for (var i in this.Buttons) { - btn = this.Buttons[i]; - document.write( btn.GetHTML() ); - btn.Init(); + if ($container) { + for (var i in this.Buttons) { + btn = this.Buttons[i]; + $container.appendChild( btn.GetObject() ); + btn.Init(); + } } + else { + for (var i in this.Buttons) { + btn = this.Buttons[i]; + document.write( btn.GetHTML() ); + btn.Init(); + } + } } ToolBar.prototype.EnableButton = function(button_id) {