# HG changeset patch # User Dan # Date 1237697706 14400 # Node ID a86a69394a9549d665e5bb1e58ae5fe95a1fad70 # Parent d6c7b310295dbbe52cc674cbcb5869fa9f4d5084 Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable. diff -r d6c7b310295d -r a86a69394a95 images/rename.png Binary file images/rename.png has changed diff -r d6c7b310295d -r a86a69394a95 includes/clientside/css/enano-shared.css --- a/includes/clientside/css/enano-shared.css Sun Mar 22 00:46:44 2009 -0400 +++ b/includes/clientside/css/enano-shared.css Sun Mar 22 00:55:06 2009 -0400 @@ -150,6 +150,11 @@ padding-right: 5px; } +div.toolbar_vert li > span { + display: block; + padding: 4px 5px; +} + div.breadcrumbs { margin: 10px 0; padding: 5px; border: 1px solid #AAAAAA; background-color: #E8E8E8; font-size: smaller; font-weight: bold; } /* Tables */ @@ -325,55 +330,6 @@ display: block; } -/* - * Docking Boxes code (for the sidebar editor) - */ - -/* group container(s) */ -#sbedit { - margin: 0; - padding: 0; - /* position:relative; /* additional outer containers must also have position:relative */ -} -/* keyboard navigation tooltip */ -.dbx-tooltip { - display:block; - position:absolute; - margin:36px 0 0 125px; - width:185px; - border:1px solid #000; - background:#ffd; - color:#000; - font:normal normal normal 0.85em tahoma, arial, sans-serif; - padding:2px 4px 3px 5px; - text-align:left; - } -* html .dbx-tooltip { width:195px; } - -/* use CSS2 system colors in CSS2 browsers - but not safari, which doesn't support them */ -*[class="dbx-tooltip"]:lang(en) { - border-color:InfoText; - background:InfoBackground; - color:InfoText; - font:small-caption; - font-weight:normal; - } -/* additional clone styles */ -.dbx-clone { - opacity: 0.8; -} -.dbx-content ul { - margin: 0; padding: 0; - list-style: none; -} -.dbx-content li a, .dbx-content li a:hover { - text-decoration: none; color: #666; -} -.dbx-content2 { - margin: 0px 1px 0px 1px; -} - /* Progress bars */ div.progressbar { padding: 2px; @@ -1002,3 +958,63 @@ background-repeat: no-repeat; margin: 0 auto; } + +/** + * Sidebar editor + */ + +div.sbedit-block { + background-color: #f7f7f7; + border: 1px solid #c2c2c2; + padding: 4px; + width: 150px; + margin: 0 7px 5px 0; +} + +div.sbedit-block.disabled { + background-color: #ffe2e2; + border-color: #c7a1a1; +} + +div.sbedit-handle { + background-color: #c7c7c7; + border: 1px solid #909090; + padding: 2px; + margin-bottom: 3px; + cursor: move; +} + +div.sbedit-block.disabled div.sbedit-handle { + background-color: #c77272; + border-color: #aa6060; +} + +div.sbedit-handle input { + display: none; + width: 96%; +} + +div.sbedit-float { + position: absolute; + top: 20px; + left: 20px; +} + +td.sbedit-column { + vertical-align: top; + /* 150 + 4*2 + 7 + 3 (the 3 being a trial-and-error computation) */ + width: 168px; +} + +.ui-sortable-placeholder { + background-color: #e2e2e2 !important; + border: 1px dashed #b7b7b7 !important; + visibility: visible !important; + height: 50px !important; +} + +.ui-sortable-helper { + opacity: 0.6; + filter: alpha(opacity=60); +} + diff -r d6c7b310295d -r a86a69394a95 includes/clientside/dbx-key.js --- a/includes/clientside/dbx-key.js Sun Mar 22 00:46:44 2009 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -function dbx_set_key() -{ - //initialise the docking boxes manager - var manager = new dbxManager('main'); //session ID [/-_a-zA-Z0-9/] - - //onstatechange fires when any group state changes - manager.onstatechange = function() - { - //copy the state string to a local var - var state = this.state; - - //remove group name and open/close state tokens - state = state.replace(/sbedit_(left|right)=/ig, '').replace(/[\-\+]/g, ''); - - //split into an array - state = state.split('&'); - - //output field - var field = document.getElementById('divOrder_Left'); - field.value = state[0]; - var field = document.getElementById('divOrder_Right'); - field.value = state[1]; - - //return value determines whether cookie is set - return false; - }; - - //create new docking boxes group - var sbedit_left = new dbxGroup( - 'sbedit_left', // container ID [/-_a-zA-Z0-9/] - 'vertical', // orientation ['vertical'|'horizontal'] - '7', // drag threshold ['n' pixels] - 'no', // restrict drag movement to container axis ['yes'|'no'] - '10', // animate re-ordering [frames per transition, or '0' for no effect] - 'no', // include open/close toggle buttons ['yes'|'no'] - 'open', // default state ['open'|'closed'] - 'open', // word for "open", as in "open this box" - 'close', // word for "close", as in "close this box" - 'click-down and drag to move this box', // sentence for "move this box" by mouse - 'click to %toggle% this box', // pattern-match sentence for "(open|close) this box" by mouse - 'use the arrow keys to move this box', // sentence for "move this box" by keyboard - ', or press the enter key to %toggle% it', // pattern-match sentence-fragment for "(open|close) this box" by keyboard - '%mytitle% [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts - ); - - //create new docking boxes group - var sbedit_right = new dbxGroup( - 'sbedit_right', // container ID [/-_a-zA-Z0-9/] - 'vertical', // orientation ['vertical'|'horizontal'] - '7', // drag threshold ['n' pixels] - 'no', // restrict drag movement to container axis ['yes'|'no'] - '10', // animate re-ordering [frames per transition, or '0' for no effect] - 'no', // include open/close toggle buttons ['yes'|'no'] - 'open', // default state ['open'|'closed'] - 'open', // word for "open", as in "open this box" - 'close', // word for "close", as in "close this box" - 'click-down and drag to move this box', // sentence for "move this box" by mouse - 'click to %toggle% this box', // pattern-match sentence for "(open|close) this box" by mouse - 'use the arrow keys to move this box', // sentence for "move this box" by keyboard - ', or press the enter key to %toggle% it', // pattern-match sentence-fragment for "(open|close) this box" by keyboard - '%mytitle% [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts - ); -} diff -r d6c7b310295d -r a86a69394a95 includes/clientside/dbx.css --- a/includes/clientside/dbx.css Sun Mar 22 00:46:44 2009 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/**************************************************************** - Docking Boxes core CSS: YOU MUST NOT CHANGE OR OVERRIDE THESE -*****************************************************************/ -.dbx-clone { - position:absolute; - visibility:hidden; - } -.dbx-clone, .dbx-clone .dbx-handle-cursor { - cursor:move !important; - } -.dbx-dummy { - display:block; - width:0; - height:0; - overflow:hidden; - } -.dbx-group, .dbx-box, .dbx-handle { - position:relative; - display:block; - } - - - -/**************************************************************** - avoid padding, margins or borders on dbx-box, - to reduce visual discrepancies between it and the clone. - overall, dbx-box is best left as visually unstyled as possible -*****************************************************************/ -.dbx-box { - margin:0; - padding:0; - border:none; - } - diff -r d6c7b310295d -r a86a69394a95 includes/clientside/dbx.js --- a/includes/clientside/dbx.js Sun Mar 22 00:46:44 2009 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -// DBX2.05 :: Docking Boxes (dbx) -// ***************************************************** -// DOM scripting by brothercake -- http://www.brothercake.com/ -// GNU Lesser General Public License -- http://www.gnu.org/licenses/lgpl.html -//****************************************************** -var dbx;function dbxManager(sid){dbx = this;if(!/^[-_a-z0-9]+$/i.test(sid)) { alert('Error from dbxManager:\n"' + sid + '" is an invalid session ID'); return; }this.supported = !(document.getElementsByTagName('*').length == 0 || (navigator.vendor == 'KDE' && typeof window.sidebar == 'undefined'));if(!this.supported) { return; }this.etype = typeof document.addEventListener != 'undefined' ? 'addEventListener' : typeof document.attachEvent != 'undefined' ? 'attachEvent' : 'none';this.eprefix = (this.etype == 'attachEvent' ? 'on' : '');if(typeof window.opera != 'undefined' && parseFloat(navigator.userAgent.toLowerCase().split(/opera[\/ ]/)[1].split(' ')[0], 10) < 7.5){this.etype = 'none';}if(this.etype == 'none') { this.supported = false; return; }this.running = 0;this.sid = sid;this.savedata = {};this.cookiestate = this.getCookieState();};dbxManager.prototype.setCookieState = function(){var now = new Date();now.setTime(now.getTime() + (365*24*60*60*1000));var str = '';for(j in this.savedata){if(typeof this.savedata[j]!='function'){str += j + '=' + this.savedata[j] + '&'}}this.state = str.replace(/^(.+)&$/, '$1');this.cookiestring = this.state.replace(/,/g, '|');this.cookiestring = this.cookiestring.replace(/=/g, ':');if(typeof this.onstatechange == 'undefined' || this.onstatechange()){document.cookie = 'dbx-' + this.sid + '='+ this.cookiestring+ '; expires=' + now.toGMTString()+ '; path=/';}};dbxManager.prototype.getCookieState = function(){this.cookiestate = null;if(document.cookie){if(document.cookie.indexOf('dbx-' + this.sid)!=-1){this.cookie = document.cookie.split('dbx-' + this.sid + '=')[1].split(';')[0].split('&');for(var i in this.cookie){if(typeof this.cookie[i]!='function'){this.cookie[i] = this.cookie[i].replace(/\|/g, ',');this.cookie[i]= this.cookie[i].replace(/:/g, '=');this.cookie[i] = this.cookie[i].split('=');this.cookie[i][1] = this.cookie[i][1].split(',');}}this.cookiestate = {};for(i in this.cookie){if(typeof this.cookie[i]!='function'){this.cookiestate[this.cookie[i][0]] = this.cookie[i][1];}}}}return this.cookiestate;};dbxManager.prototype.addDataMember = function(gid, order){this.savedata[gid] = order;};dbxManager.prototype.createElement = function(tag){return typeof document.createElementNS != 'undefined' ? document.createElementNS('http://www.w3.org/1999/xhtml', tag) : document.createElement(tag);};dbxManager.prototype.getTarget = function(e, pattern, node){if(typeof node != 'undefined'){var target = node;}else{target = typeof e.target != 'undefined' ? e.target : e.srcElement;}var regex = new RegExp(pattern, '');while(!regex.test(target.className)){target = target.parentNode;}return target;};function dbxGroup(gid, dir, thresh, fix, ani, togs, def, open, close, move, toggle, kmove, ktoggle, syntax){if(!/^[-_a-z0-9]+$/i.test(gid)) { alert('Error from dbxGroup:\n"' + gid + '" is an invalid container ID'); return; }this.container = document.getElementById(gid);if(this.container == null || !dbx.supported) { return; }var self = this;this.gid = gid;this.dragok = false;this.box = null;this.vertical = dir == 'vertical';this.threshold = parseInt(thresh, 10);this.restrict = fix == 'yes';this.resolution = parseInt(ani, 10);this.toggles = togs == 'yes';this.defopen = def != 'closed';this.vocab = {'open' : open,'close' : close,'move' : move,'toggle' : toggle,'kmove' : kmove,'ktoggle' : ktoggle,'syntax' : syntax};this.container.style.position = 'relative';this.container.style.display = 'block';if(typeof window.opera != 'undefined'){this.container.style.display = 'run-in';}this.boxes = [];this.buttons = [];this.order = [];this.eles = this.container.getElementsByTagName('*');for(var i=0; i 0)){var sibling = this.boxes[positions[i + (positive ? 1 : -1)][0]];if(this.resolution > 0){var visipos = { 'x' : parent.offsetLeft, 'y' : parent.offsetTop };var siblingpos = { 'x' : sibling.offsetLeft, 'y' : sibling.offsetTop };}var obj = { 'insert' : (positive ? sibling : parent), 'before' : (positive ? parent : sibling) };this.container.insertBefore(obj.insert, obj.before);if(this.resolution > 0){var animators ={'sibling' : new dbxAnimator(this, sibling, siblingpos, this.resolution, true, anchor),'parent' : new dbxAnimator(this, parent, visipos, this.resolution, true, anchor)};}else{anchor.focus();}break;}}}this.getBoxOrder();}};dbxGroup.prototype.compare = function(a, b){return a[1] - b[1];};dbxGroup.prototype.createTooltip = function(isopen, anchor){if(this.keydown){this.tooltip = this.container.appendChild(dbx.createElement('span'));this.tooltip.style.visibility = 'hidden';this.tooltip.className = 'dbx-tooltip';if(isopen != null){this.tooltip.appendChild(document.createTextNode(this.vocab.kmove + this.vocab.ktoggle.replace('%toggle%', isopen ? this.vocab.close : this.vocab.open)));}else{this.tooltip.appendChild(document.createTextNode(this.vocab.kmove));}var parent = dbx.getTarget(null, 'dbx\-box', anchor);this.tooltip.style.left = parent.offsetLeft + 'px';this.tooltip.style.top = parent.offsetTop + 'px';var tooltip = this.tooltip;window.setTimeout(function(){if(tooltip != null) { tooltip.style.visibility = 'visible'; }}, 500);}};dbxGroup.prototype.removeTooltip = function(){if(this.tooltip != null){this.tooltip.parentNode.removeChild(this.tooltip);this.tooltip = null;}};dbxGroup.prototype.mousedown = function(e, box){var node = typeof e.target != 'undefined' ? e.target : e.srcElement;if(node.nodeName == '#text') { node = node.parentNode; }if(!/dbx\-(toggle|box|group)/i.test(node.className)){while(!/dbx\-(handle|box|group)/i.test(node.className)){node = node.parentNode;}}if(/dbx\-handle/i.test(node.className)){this.removeTooltip();this.released = false;this.initial = { 'x' : e.clientX, 'y' : e.clientY };this.current = { 'x' : 0, 'y' : 0 };this.createCloneBox(box);if(typeof e.preventDefault != 'undefined' ) { e.preventDefault(); }if(typeof document.onselectstart != 'undefined'){document.onselectstart = function() { return false; }}}};dbxGroup.prototype.mousemove = function(e){if(this.dragok && this.box != null){this.positive = this.vertical ? (e.clientY > this.current.y ? true : false) : (e.clientX > this.current.x ? true : false);this.current = { 'x' : e.clientX, 'y' : e.clientY };var overall = { 'x' : this.current.x - this.initial.x, 'y' : this.current.y - this.initial.y };if(((overall.x >= 0 && overall.x <= this.threshold) || (overall.x <= 0 && overall.x >= 0 - this.threshold))&&((overall.y >= 0 && overall.y <= this.threshold) || (overall.y <= 0 && overall.y >= 0 - this.threshold))){this.current.x -= overall.x;this.current.y -= overall.y;}if(this.released || overall.x > this.threshold || overall.x < (0 - this.threshold) || overall.y > this.threshold || overall.y < (0 - this.threshold)){dbx.group = this.container;dbx.box = this.box;dbx.event = e;if(typeof dbx.onboxdrag == 'undefined' || dbx.onboxdrag()){this.released = true;if(!this.restrict || !this.vertical) { this.boxclone.style.left = (this.current.x - this.difference.x) + 'px'; }if(!this.restrict || this.vertical) { this.boxclone.style.top = (this.current.y - this.difference.y) + 'px'; }this.moveOriginalToPosition(this.current.x, this.current.y);if(typeof e.preventDefault != 'undefined' ) { e.preventDefault(); }}}}return true;};dbxGroup.prototype.mouseup = function(e){if(this.box != null){this.moveOriginalToPosition(e.clientX, e.clientY);this.removeCloneBox();this.getBoxOrder();if(typeof document.onselectstart != 'undefined'){document.onselectstart = function() { return true; }}}this.dragok = false;};dbxGroup.prototype.keypress = function(e, anchor){if(/^(3[7-9])|(40)$/.test(e.keyCode)){this.removeTooltip();if((this.vertical && /^(38|40)$/.test(e.keyCode)) || (!this.vertical && /^(37|39)$/.test(e.keyCode))){this.shiftBoxPosition(e, anchor, /^[3][78]$/.test(e.keyCode) ? false : true);if(typeof e.preventDefault != 'undefined') { e.preventDefault(); }else { return false; }typeof e.stopPropagation != 'undefined' ? e.stopPropagation() : e.cancelBubble = true;this.keydown = false;}}return true;};dbxGroup.prototype.getBoxOrder = function(){this.order = [];var len = this.eles.length;for(var j=0; j boxprops.xy && cloneprops.xy < boxprops.xy)||(!this.positive && cloneprops.xy < boxprops.xy && cloneprops.xy + cloneprops.wh > boxprops.xy)){if(this.boxes[i] == this.box) { return; }var sibling = this.box.nextSibling;while(sibling.className == null || !/dbx\-box/.test(sibling.className)){sibling = sibling.nextSibling;}if(this.boxes[i] == sibling) { return; }if(this.resolution > 0){if(this.box[this.vertical ? 'offsetTop' : 'offsetLeft'] < boxprops.xy){var visibox = this.boxes[i].previousSibling;while(visibox.className == null || !/dbx\-box/.test(visibox.className)){visibox = visibox.previousSibling;}}else{visibox = this.boxes[i];}var visipos = { 'x' : visibox.offsetLeft, 'y' : visibox.offsetTop };}var prepos = { 'x' : this.box.offsetLeft, 'y' : this.box.offsetTop };this.container.insertBefore(this.box, this.boxes[i]);this.initial.x += (this.box.offsetLeft - prepos.x);this.initial.y += (this.box.offsetTop - prepos.y);if(this.resolution > 0 && visibox != this.box){var animator = new dbxAnimator(this, visibox, visipos, this.resolution, false, null);}else{}break;}}};function dbxAnimator(caller, box, pos, res, kbd, anchor){this.caller = caller;this.box = box;this.timer = null;var before = pos[this.caller.vertical ? 'y' : 'x'];var after = this.box[this.caller.vertical ? 'offsetTop' : 'offsetLeft'];if(before != after){if(dbx.running > this.caller.boxes.length - 1) { return; }var clone = this.caller.createClone(this.box, 29999, arguments[2]);clone.style.visibility = 'visible';this.box.style.visibility = 'hidden';this.animateClone(clone,before,after > before ? after - before : 0 - (before - after),this.caller.vertical ? 'top' : 'left',res,kbd,anchor);}};dbxAnimator.prototype.animateClone = function(clone, current, change, dir, res, kbd, anchor){var self = this;var count = 0;dbx.running ++;this.timer = window.setInterval(function(){count ++;current += change / res;clone.style[dir] = current + 'px';if(count == res){window.clearTimeout(self.timer);self.timer = null;dbx.running --;self.caller.container.removeChild(clone);self.box.style.visibility = 'visible';if(kbd){if(anchor != null && anchor.parentNode.style.visibility != 'hidden'){anchor.focus();}else if(self.caller.toggles){var button = self.caller.buttons[parseInt(self.box.className.split('dbxid')[1],10)];if(button != null && typeof button.isactive != 'undefined'){button.focus();}}}}}, 20);};if(typeof window.attachEvent != 'undefined'){window.attachEvent('onunload', function(){var ev = ['mousedown', 'mousemove', 'mouseup', 'mouseout', 'click', 'keydown', 'keyup', 'focus', 'blur', 'selectstart', 'statechange', 'boxdrag', 'boxopen', 'boxclose'];var el = ev.length;var dl = document.all.length;for(var i=0; i> 5] |= 0x80 << ((len) % 32); x[(((len + 64) >>> 9) << 4) + 14] = len; var a = 1732584193; var b = -271733879; var c = -1732584194; var d = 271733878; for(var i = 0; i < x.length; i += 16) { var olda = a; var oldb = b; var oldc = c; var oldd = d; a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330); - a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);c = md5_ff(c, d, a, b, x[i+10], 17, -42063);b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);d = md5_ff(d, a, b, c, x[i+13], 12, -40341101); - c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848); - a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463); - c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189); - a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606); - c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551); - a = safe_add(a, olda); b = safe_add(b, oldb); c = safe_add(c, oldc); d = safe_add(d, oldd); } return Array(a, b, c, d); } -function md5_cmn(q, a, b, x, s, t) { return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b); } -function md5_ff(a, b, c, d, x, s, t) { return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); } -function md5_gg(a, b, c, d, x, s, t) { return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); } -function md5_hh(a, b, c, d, x, s, t) { return md5_cmn(b ^ c ^ d, a, b, x, s, t); } -function md5_ii(a, b, c, d, x, s, t) { return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); } -function core_hmac_md5(key, data) { var bkey = str2binl(key); if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz); var ipad = Array(16), opad = Array(16); for(var i = 0; i < 16; i++) { ipad[i] = bkey[i] ^ 0x36363636; opad[i] = bkey[i] ^ 0x5C5C5C5C; } var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz); return core_md5(opad.concat(hash), 512 + 128); } -function safe_add(x, y) {var lsw = (x & 0xFFFF) + (y & 0xFFFF);var msw = (x >> 16) + (y >> 16) + (lsw >> 16);return (msw << 16) | (lsw & 0xFFFF); } -function bit_rol(num, cnt) { return (num << cnt) | (num >>> (32 - cnt)); } -function str2binl(str) { var bin = Array(); var mask = (1 << chrsz) - 1; for(var i = 0; i < str.length * chrsz; i += chrsz) bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32); return bin; } -function binl2str(bin) { var str = ""; var mask = (1 << chrsz) - 1; for(var i = 0; i < bin.length * 32; i += chrsz) str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask); return str; } -function binl2hex(binarray) { var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; var str = ""; for(var i = 0; i < binarray.length * 4; i++) { str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) + hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF); } return str; } -function binl2b64(binarray) { var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var str = ""; for(var i = 0; i < binarray.length * 4; i += 3) { var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16) | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 ) | ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF); for(var j = 0; j < 4; j++) { if(i * 8 + j * 6 > binarray.length * 32) str += b64pad; else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F); } } return str; } - diff -r d6c7b310295d -r a86a69394a95 includes/clientside/sbedit.js --- a/includes/clientside/sbedit.js Sun Mar 22 00:46:44 2009 -0400 +++ b/includes/clientside/sbedit.js Sun Mar 22 00:55:06 2009 -0400 @@ -1,193 +1,266 @@ -var disenable_currentBlock; -function ajaxDisenableBlock(id) -{ - disenable_currentBlock = document.getElementById('disabled_'+id); - ajaxGet(makeUrlNS('Special', 'EditSidebar', 'action=disenable&ajax=true&noheaders&id='+id), function() - { - if ( ajax.readyState == 4 && ajax.status == 200 ) +addOnloadHook(function() + { + load_component(['jquery', 'jquery-ui']); + $('.sbedit-column').sortable({ + handle: '.sbedit-handle', + connectWith: '.sbedit-column', + stop: function() { - if(ajax.responseText == 'GOOD') - { - if(disenable_currentBlock.style.display == 'none') - { - disenable_currentBlock.style.display = 'inline'; - } - else - { - disenable_currentBlock.style.display = 'none'; - } - } - else - { - document.getElementById('ajaxEditContainer').innerHTML = ajax.responseText; - } + ajaxUpdateSidebarOrder(); } }); + }); + +function serialize_sidebar() +{ + var columns = {}; + var i = 0; + $('.sbedit-column').each(function(i, e) + { + var arr = $(e).sortable('toArray'); + for ( var j = 0; j < arr.length; j++ ) + arr[j] = parseInt(arr[j].replace(/^block:/, '')); + + i++; + columns[i] = arr; + }); + return toJSONString(columns); } -var delete_currentBlock; -function ajaxDeleteBlock(id, oElm) +function sbedit_open_editor(a) { - delete_currentBlock = { 0 : id, 1 : oElm }; - ajaxGet(makeUrlNS('Special', 'EditSidebar', 'action=delete&ajax=true&noheaders&id='+id), function() - { - if ( ajax.readyState == 4 && ajax.status == 200 ) + if ( auth_level < USER_LEVEL_ADMIN ) + { + load_component('login'); + ajaxDynamicReauth(function(sid) { - if(ajax.responseText == 'GOOD') - { - e = delete_currentBlock[1]; - e = e.parentNode.parentNode; - e.parentNode.removeChild(e); - } - else - { - document.getElementById('ajaxEditContainer').innerHTML = ajax.responseText; - } - } - }); + sbedit_open_editor(a); + }, USER_LEVEL_ADMIN); + return false; + } + load_component(['fadefilter', 'l10n']); + var shade = darken(true, 50, 'sbedit-shade'); + $(shade).css('z-index', 0); + var parent = sbedit_get_parent(a); + var offset = $(parent).offset(); + var top = (( getHeight() ) / 2) - 200 + getScrollOffset(); + var box = $(parent) + .clone() + .empty() + .attr('id', 'sb_blockedit') + .addClass('sbedit-float') + .css('height', $(parent).height()) + .css('top', offset.top) + .css('left', offset.left) + .appendTo('body') + .animate({ width: 500, height: 400, top: top, left: (getWidth() / 2) - 250 }, 400, function() + { + var whitey = whiteOutElement(this); + $(this).append(''); + $(this).append('

' + $lang.get('etc_save_changes') + ' | ' + $lang.get('etc_cancel') + '

'); + $.get(makeUrlNS('Special', 'EditSidebar', 'action=getsource&noheaders&id=' + this.item_id), {}, function(response, statustext) + { + $('textarea', box).attr('value', response); + $(whitey).remove(); + }, 'html'); + }) + .get(0); + box.parentdiv = parent; + box.item_id = parseInt($(parent).attr('id').replace(/^block:/, '')); } -var blockEdit_current; -function ajaxEditBlock(id, oElm) +function sbedit_edit_save(a) { - blockEdit_current = { 0 : id, 1 : oElm }; - ajaxGet(makeUrlNS('Special', 'EditSidebar', 'action=getsource&noheaders&id='+id), function() + var box = a.parentNode.parentNode; + var parent = box.parentdiv; + var whitey = whiteOutElement(box); + $.post(makeUrlNS('Special', 'EditSidebar', 'noheaders&action=save&id=' + box.item_id), { content: $('textarea', box).attr('value') }, function(response, statustext) { - if ( ajax.readyState == 4 && ajax.status == 200 ) - { - id = blockEdit_current[0]; - oElm = blockEdit_current[1]; - var thediv = document.createElement('div'); - //if(!oElm.id) oElm.id = 'autoEditButton_'+Math.floor(Math.random() * 100000); - oElm = oElm.parentNode; - var magic = $(oElm).Top() + $(oElm).Height(); - var top = String(magic); - top = top + 'px'; - left = $(oElm).Left() + 'px'; - thediv.style.top = top; - thediv.style.left = left; - thediv.style.position = 'absolute'; - thediv.className = 'mdg-comment'; - thediv.style.margin = '0'; - if(ajax.responseText == 'HOUSTON_WE_HAVE_A_PLUGIN') + whiteOutReportSuccess(whitey); + setTimeout(function() { - thediv.innerHTML = '

' + $lang.get('sbedit_msg_cant_edit_plugin_title') + '

' + $lang.get('sbedit_msg_cant_edit_plugin_body', { close_link: 'a href="#" onclick="this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode); return false;"' }) + '

'; - } - else - { - ta = document.createElement('textarea'); - ta.rows = '15'; - ta.cols = '50'; - ta.innerHTML = ajax.responseText; - thediv.appendChild(ta); - b = document.createElement('br'); - thediv.appendChild(b); - thediv.innerHTML += '' + $lang.get('sbedit_btn_edit_save') + ' | ' + $lang.get('sbedit_btn_edit_cancel') + ''; - } - body = document.getElementsByTagName('body'); - body = body[0]; - body.appendChild(thediv); - } + sbedit_close_editor(parent, box); + }, 1250); + }, 'html'); +} + +function sbedit_edit_cancel(a) +{ + var box = a.parentNode.parentNode; + var parent = box.parentdiv; + + sbedit_close_editor(parent, box); +} + +function sbedit_close_editor(parent, box) +{ + var offset = $(parent).offset(); + $(box).empty().animate( + { + width: $(parent).width(), + height: $(parent).height(), + top: offset.top, + left: offset.left, + }, 400, function() + { + $(this).css('background-color', '#f70').fadeOut(1000, function() { $(this).remove(); }); + enlighten(true, 'sbedit-shade'); }); } -var blockSave_current; -function ajaxSaveBlock(oElm, id) +function sbedit_delete_block(a) { - taContent = escape(oElm.previousSibling.previousSibling.value); - taContent = taContent.replace(unescape('%0A'), '%0A'); - taContent = taContent.replace('+', '%2B'); - blockSave_current = { 0 : id, 1 : oElm }; - ajaxPost(makeUrlNS('Special', 'EditSidebar', 'noheaders&action=save&id='+id), 'content='+taContent, function() + var parent = sbedit_get_parent(a); + load_component(['messagebox', 'fadefilter', 'flyin', 'l10n']); + var mp = miniPromptMessage({ + title: $lang.get('sbedit_msg_delete_confirm_title'), + message: $lang.get('sbedit_msg_delete_confirm_body'), + buttons: [ + { + text: $lang.get('sbedit_btn_delete_confirm'), + color: 'red', + onclick: function() + { + var mp = miniPromptGetParent(this); + sbedit_delete_block_s2(mp.target_block); + miniPromptDestroy(this); + return false; + }, + style: { + fontWeight: 'bold' + } + }, + { + text: $lang.get('etc_cancel'), + onclick: function() + { + miniPromptDestroy(this); + return false; + } + } + ] + }); + mp.target_block = parent; +} + +function sbedit_delete_block_s2(box) +{ + var parent = box; + var id = parseInt($(parent).attr('id').replace(/^block:/, '')); + var whitey = whiteOutElement(parent); + + $.get(makeUrlNS('Special', 'EditSidebar', 'action=delete&ajax=true&noheaders&id=' + id), function(response, statustext) { - if ( ajax.readyState == 4 && ajax.status == 200 ) + if ( response == 'GOOD' ) { - id = blockSave_current[0]; - oElm = blockSave_current[1]; - eval(ajax.responseText); - if(status == 'GOOD') - { - var _id = 'disabled_' + String(id); - var parent = document.getElementById(_id).parentNode.parentNode; - oElm.parentNode.parentNode.removeChild(oElm.parentNode); - content = content.replace('%a', unescape('%0A')); - var obj = ( IE ) ? parent.firstChild.nextSibling.nextSibling : parent.firstChild.nextSibling.nextSibling.nextSibling; - if ( obj ) - obj.innerHTML = content; // $content is set in ajax.responseText - } - else - { - alert(status); - } + whiteOutReportSuccess(whitey); + setTimeout(function() + { + $(parent) + .hide('blind', { duration: 500 }, function() + { + $(this).remove(); + ajaxUpdateSidebarOrder(); + }); + }, 1250); } - }); + else + { + whiteOutReportFailure(whitey); + alert(response); + } + }, 'html'); } -function ajaxRenameSidebarStage1(parent, id) +function sbedit_rename_block(a) { - var oldname = parent.firstChild.nodeValue; - parent.removeChild(parent.firstChild); - parent.ondblclick = function() {}; - parent._idcache = id; - var input = document.createElement('input'); - input.type = 'text'; - input.sbedit_id = id; - input.oldvalue = oldname; - input.onkeyup = function(e) - { - if ( typeof(e) != 'object' ) - return false; - if ( !e.keyCode ) - return false; - if ( e.keyCode == 13 ) + var parent = sbedit_get_parent(a); + $('div.sbedit-handle > span', parent).hide(); + var input = $('div.sbedit-handle > input', parent).show().focus().select().keyup(function(e) { - ajaxRenameSidebarStage2(this); - } - if ( e.keyCode == 27 ) - { - ajaxRenameSidebarCancel(this); - } - }; - input.onblur = function() - { - ajaxRenameSidebarCancel(this); - }; - input.value = oldname; - input.style.fontSize = '7pt'; - parent.appendChild(input); - input.focus(); + switch(e.keyCode) + { + case 13: + // enter + var whitey = whiteOutElement(this.parentNode); + var me = this; + var id = parseInt($(parent).attr('id').replace(/^block:/, '')); + $.post(makeUrlNS('Special', 'EditSidebar', 'ajax&noheaders&action=rename&id='+id), { newname: $(this).attr('value') }, function(response, statustext) + { + if ( response == 'GOOD' ) + { + whiteOutReportSuccess(whitey); + setTimeout(function() + { + $(me).hide(); + $('span', me.parentNode).show().text(me.value); + }, 1250); + } + else + { + alert(response); + whiteOutReportFailure(whitey); + } + }, 'html'); + break; + case 27: + // escape + this.value = this.origvalue; + $(this).hide(); + $('span', this.parentNode).show(); + break; + } + }).get(0); + input.origvalue = input.value; } -function ajaxRenameSidebarStage2(input) +function sbedit_disenable_block(a) { - var newname = input.value; - var id = input.sbedit_id; - var parent = input.parentNode; - parent.removeChild(input); - parent.appendChild(document.createTextNode(( newname == '' ? '' : newname ))); - parent.ondblclick = function() { ajaxRenameSidebarStage1(this, this._idcache); return false; }; - var img = document.createElement('img'); - img.src = scriptPath + '/images/loading.gif'; - parent.appendChild(img); - newname = ajaxEscape(newname); - ajaxPost(makeUrlNS('Special', 'EditSidebar', 'ajax&noheaders&action=rename&id='+id), 'newname=' +newname, function() + var parent = sbedit_get_parent(a); + var whitey = whiteOutElement(parent); + $.get(makeUrlNS('Special', 'EditSidebar', 'action=disenable&ajax=true&noheaders&id=' + parseInt($(parent).attr('id').replace(/^block:/, ''))), {}, function(response, statustext) { - if ( ajax.readyState == 4 && ajax.status == 200 ) + if ( response == 'GOOD' ) { - parent.removeChild(img); - if ( ajax.responseText != 'GOOD' ) - new messagebox(MB_OK|MB_ICONSTOP, 'Error renaming block', ajax.responseText); + whiteOutReportSuccess(whitey); + $(parent).toggleClass('disabled'); } - }); + else + { + whiteOutReportFailure(whitey); + alert(response); + } + }, 'html'); } -function ajaxRenameSidebarCancel(input) +function sbedit_get_parent(a) { - var newname = input.oldvalue; - var id = input.sbedit_id; - var parent = input.parentNode; - parent.removeChild(input); - parent.appendChild(document.createTextNode(newname)); - parent.ondblclick = function() { ajaxRenameSidebarStage1(this, this._idcache); return false; }; + var o = a.parentNode; + while ( !$(o).hasClass('sbedit-block') ) + o = o.parentNode; + + return o; } +function ajaxUpdateSidebarOrder() +{ + setAjaxLoading(); + var ser = serialize_sidebar(); + $.post(makeUrlNS('Special', 'EditSidebar', 'update_order'), { order: ser }, function(response, statustext) + { + var msg = document.createElement('div'); + $(msg) + .addClass('info-box-mini') + .text('Sidebar order saved.') + .css('position', 'fixed') + .css('bottom', 1) + .appendTo('body') + .css('left', ( getWidth() / 2 ) - ( $(msg).width() / 2 )); + setTimeout(function() + { + $(msg).fadeOut(500, function() { $(this).remove(); }); + }, 1000); + unsetAjaxLoading(); + }, 'json'); +} + diff -r d6c7b310295d -r a86a69394a95 language/english/admin.json --- a/language/english/admin.json Sun Mar 22 00:46:44 2009 -0400 +++ b/language/english/admin.json Sun Mar 22 00:55:06 2009 -0400 @@ -1090,43 +1090,66 @@ msg_logout_complete: 'You will continue to be logged into the website, but you will need to re-authenticate before you can access the administration panel again.

Return to the Main Page.', }, sbedit: { + header_msg: 'This control panel allows you to organize the sidebars, the collections of links and dynamic blocks that provide navigation for your site. Drag and drop blocks to move them between the left and right sidebars; changes will be saved automatically. Red blocks are disabled. This panel only works if you have Javascript enabled and working in your browser. Create a new block.', + msg_order_update_success: 'The sidebar order information was updated successfully.', err_demo_php_disable: 'Adding PHP code blocks in the Enano administration demo has been disabled for security reasons.', msg_item_added: 'The item was added.', create_intro: 'What type of block should this be?', - block_type_wiki: 'Wiki-formatted block', - block_type_tpl: 'Template-formatted block (old pre-beta 3 behavior)', - block_type_html: 'Raw HTML block', - block_type_php: 'PHP code block (danger, Will Robinson!)', - block_type_plugin: 'Use code from a plugin', + block_type_wiki: 'Textual content (wikitext)', + block_type_tpl: 'List of links', + block_type_html: 'Pure HTML', + block_type_php: 'PHP code', + block_type_plugin: 'Plugin block', field_block_title: 'Block title:', field_block_sidebar: 'Which sidebar:', field_block_sidebar_left: 'Left', field_block_sidebar_right: 'Right', - field_wikitext: 'Wikitext:', - field_tplcode: 'Template code:', - field_html: 'HTML to place inside the sidebar:', + field_wikitext: '

+ This block type is for textual content. This could be information, a random fact, or some other blob of fully formatted text. Links show up inline, + not as a list. +

+

+ Wikitext: +

', + field_tplcode: '

+ This block type is for links. Use wikilinks (both internal and external are supported) to build a list of links. All links will be shown block-style, + or one link per line. You can use logic in these blocks as well: +

+
{if user_logged_in}
+  [[Special:Preferences|User control panel]]
+{/if}
+

+ Template code: +

', + field_html: '

+ This block type is for textual content. HTML you use here will not be filtered or parsed at all - it will be displayed verbatim. This gives you + slightly more control over your content but you can\'t use wikilinks or other wikitext in here. +

+

+ HTML to place inside the sidebar: +

', field_php_disabled: 'Creating PHP blocks in demo mode is disabled for security reasons.', field_php: '

WARNING: If you don\'t know what you\'re doing, or if you are not fluent in PHP, stop now and choose a different block type. You will brick your Enano installation if you are not careful here. - ALWAYS remember to write secure code! The Enano team is not responsible if someone drops all your tables because of an SQL injection vulnerability in your sidebar code. You are probably better off using the template-formatted block type. + ALWAYS remember to write secure code! The Enano team is not responsible if someone drops all your tables because of an SQL injection vulnerability in your sidebar code. You are probably better off using the links and logic block type.

- It is especially important to note that this code is NOT checked for errors! If there is a syntax error in your code here, it will prevent any pages from loading AT ALL. So you need to use an external PHP editor (like jEdit) to check your syntax before you hit save. + It is especially important to note that the syntax of your code is not validated here. If there is a syntax error in your code here, it might prevent Enano from working properly. It is recommended that you use an external PHP editor (like jEdit) to check your syntax before you hit save. You have been warned.

Also, you should avoid using output buffering functions (ob_[start|end|get_contents|clean]) here, because Enano uses those to track output from this script.

- The standard <?php and ?> tags work here. Don\'t use an initial "<?php" or it will cause a parse error. + The standard <?php and ?> tags work here, but don\'t use an initial "<?php" or it will cause a parse error.

PHP code:

', - field_plugin: 'Plugin:', + field_plugin: '

Plugin:

', btn_create_block: 'Create new block', msg_block_moved: 'Item moved.', @@ -1135,11 +1158,13 @@ note_block_unnamed: 'Unnamed', hint_rename: 'Double-click to rename this block', note_block_disabled: '(disabled)', - tip_disenable: 'Enable or disable this block', - tip_edit: 'Edit the contents of this block', - tip_delete: 'Permanently delete this block', - tip_move: 'Move this block to the other sidebar', - msg_delete_confirm: 'Do you really want to delete this block?', + tip_disenable: 'Toggle', + tip_edit: 'Edit block', + tip_delete: 'Delete', + tip_rename: 'Rename', + msg_delete_confirm_title: 'Delete block', + msg_delete_confirm_body: 'Are you sure you want to delete this sidebar block?', + btn_delete_confirm: 'Delete block', btn_revert: 'Revert', btn_create_new_stage1: 'Create new block', btn_main_page: 'Main Page', diff -r d6c7b310295d -r a86a69394a95 plugins/SpecialAdmin.php --- a/plugins/SpecialAdmin.php Sun Mar 22 00:46:44 2009 -0400 +++ b/plugins/SpecialAdmin.php Sun Mar 22 00:55:06 2009 -0400 @@ -2458,14 +2458,41 @@ } else { + if ( isset($_GET['update_order']) ) + { + header('Content-type: text/javascript'); + $order = @$_POST['order']; + try + { + $order = enano_json_decode($order); + } + catch ( Zend_Json_Exception $e ) + { + return print enano_json_encode(array( + 'mode' => 'error', + 'error' => 'bad order' + )); + } + + foreach ( $order as $sidebar_id => $blocks ) + { + foreach ( $blocks as $order => $block_id ) + { + $sbid = intval($sidebar_id); + $order = intval($order); + $block_id = intval($block_id); + $q = $db->sql_query('UPDATE ' . table_prefix . "sidebar SET sidebar_id = $sbid, item_order = $order WHERE item_id = $block_id;"); + if ( !$q ) + $db->die_json(); + } + } + + return print enano_json_encode(array( + 'mode' => 'success' + )); + } - $template->add_header(''); - $template->add_header(''); $template->add_header(''); - $template->add_header(''); - - $template->load_theme('oxygen', 'bleu'); - $template->init_vars(); $template->header(); @@ -2624,27 +2651,21 @@

-

- get('sbedit_field_wikitext'); ?> -

+ get('sbedit_field_wikitext'); ?>

-

- get('sbedit_field_tplcode'); ?> -

+ get('sbedit_field_tplcode'); ?>

-

- get('sbedit_field_html'); ?> -

+ get('sbedit_field_html'); ?>

@@ -2663,9 +2684,7 @@
-

- get('sbedit_field_plugin'); ?> -

+ get('sbedit_field_plugin'); ?>

+

'; + ?> +
+ extract_vars('toolbar.tpl'); + $parser_start = $template->makeParserText($toolbarvars['toolbar_vert_start']); + echo $parser_start->run(); + + $button = $template->makeParserText($toolbarvars['toolbar_vert_button']); + $label = $template->makeParserText($toolbarvars['toolbar_vert_label']); + + $type = ''; + switch($row['block_type']) + { + case BLOCK_WIKIFORMAT: $type .= $lang->get('sbedit_block_type_wiki'); break; + case BLOCK_TEMPLATEFORMAT: $type .= $lang->get('sbedit_block_type_tpl'); break; + case BLOCK_HTML: $type .= $lang->get('sbedit_block_type_html'); break; + case BLOCK_PHP: $type .= $lang->get('sbedit_block_type_php'); break; + case BLOCK_PLUGIN: $type .= $lang->get('sbedit_block_type_plugin'); break; + default: $type .= '$&#@'; break; + } + $type .= ''; + if ( $row['block_type'] == BLOCK_PLUGIN ) + { + $type .= ': ' . $lang->get($row['block_content']); + } + + $label->assign_vars(array( + 'TITLE' => $type + )); + echo $label->run(); + + // edit + if ( $row['block_type'] != BLOCK_PLUGIN ) + { + $button->assign_vars(array( + 'TITLE' => $lang->get('sbedit_tip_edit'), + 'FLAGS' => 'href="#" onclick="sbedit_open_editor(this); return false;"', + 'IMAGE' => cdnPath . '/images/edit.png' + )); + echo $button->run(); + } + + // delete + $button->assign_vars(array( + 'TITLE' => $lang->get('sbedit_tip_delete'), + 'FLAGS' => 'href="#" onclick="sbedit_delete_block(this); return false;"', + 'IMAGE' => cdnPath . '/images/delete.png' + )); + echo $button->run(); + + // rename + $button->assign_vars(array( + 'TITLE' => $lang->get('sbedit_tip_rename'), + 'FLAGS' => 'href="#" onclick="sbedit_rename_block(this); return false;"', + 'IMAGE' => cdnPath . '/images/rename.png' + )); + echo $button->run(); + + // disenable + $button->assign_vars(array( + 'TITLE' => $lang->get('sbedit_tip_disenable'), + 'FLAGS' => 'href="#" onclick="sbedit_disenable_block(this); return false;"', + 'IMAGE' => cdnPath . '/images/disenable.png' + )); + echo $button->run(); + + $parser_end = $template->makeParserText($toolbarvars['toolbar_vert_end']); + echo $parser_end->run(); + ?> +
+ '; } - $db->free_result(); - //if(isset($vars['sidebar_top'])) echo $template->parse($vars['sidebar_bottom']); - echo ''; - echo '
'; - $order = implode(',', $n1); - echo ""; - $order = implode(',', $n2); - echo ""; - echo ' - -
- '; + + if ( !$switched_to_right ) + echo ''; + + echo ''; } $template->footer(); diff -r d6c7b310295d -r a86a69394a95 themes/admin/sidebar-editor.tpl --- a/themes/admin/sidebar-editor.tpl Sun Mar 22 00:46:44 2009 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -
  • {TEXT}
  • - -
  • {HTML}
  • - - -
    - - - - - - -
    -
    - - -
    -
    - {ADMIN_START} - - {TITLE} - {ADMIN_END} - -
    -
    -
      - {CONTENT} -
    -
    -
    - - -
    -
    - {ADMIN_START} - - {TITLE} - {ADMIN_END} - -
    -
    -
    • - {CONTENT} -
    -
    -
    - - -
    - - - - - - -
    -
    - diff -r d6c7b310295d -r a86a69394a95 themes/oxygen/css/bleu.css --- a/themes/oxygen/css/bleu.css Sun Mar 22 00:46:44 2009 -0400 +++ b/themes/oxygen/css/bleu.css Sun Mar 22 00:55:06 2009 -0400 @@ -797,6 +797,11 @@ padding-right: 5px; } +div.toolbar_vert li > span { + display: block; + padding: 4px 5px; +} + /* * Userpage styles */ diff -r d6c7b310295d -r a86a69394a95 themes/oxygen/sidebar-editor.tpl --- a/themes/oxygen/sidebar-editor.tpl Sun Mar 22 00:46:44 2009 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -
  • {TEXT}
  • - -
  • {HTML}
  • - - -
    - - - - - - -
    -
    - - -
    -
    - {ADMIN_START} - - {TITLE} - {ADMIN_END} - -
    -
    -
      - {CONTENT} -
    -
    -
    - - -
    -
    - {ADMIN_START} - - {TITLE} - {ADMIN_END} - -
    -
    - {CONTENT} -
    -
    - - -
    - - - - - - -
    -
    - diff -r d6c7b310295d -r a86a69394a95 themes/printable/sidebar-editor.tpl --- a/themes/printable/sidebar-editor.tpl Sun Mar 22 00:46:44 2009 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -
  • {TEXT}
  • - -
  • {HTML}
  • - - -
    - - - - - - -
    -
    - - -
    -
    - {ADMIN_START} - - {TITLE} - {ADMIN_END} - -
    -
    -
      - {CONTENT} -
    -
    -
    - - -
    -
    - {ADMIN_START} - - {TITLE} - {ADMIN_END} - -
    -
    -
    • - {CONTENT} -
    -
    -
    - - -
    - - - - - - -
    -
    - diff -r d6c7b310295d -r a86a69394a95 themes/stpatty/sidebar-editor.tpl --- a/themes/stpatty/sidebar-editor.tpl Sun Mar 22 00:46:44 2009 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -
  • {TEXT}
  • - -
  • {HTML}
  • - - -
    - - - - - - -
    -
    - - -
    -
    - {ADMIN_START} - - {TITLE} - {ADMIN_END} - -
    -
    -
      - {CONTENT} -
    -
    -
    - - -
    -
    - {ADMIN_START} - - {TITLE} - {ADMIN_END} - -
    -
    -
    • - {CONTENT} -
    -
    -
    - - -
    - - - - - - -
    -
    -