' +
LANG_PUBLISHED + ':
' + LANG_YES + '';
} else {
html += '/components/com_zoom/www/images/publish_x.png" alt="" border="0" /> ' +
LANG_PUBLISHED + ':
' + LANG_NO + '';
}
html += '
' +
LANG_SHARED + ':
' + LANG_YES + '';
} else {
html += '/components/com_zoom/www/images/share_l.png" alt="" border="0" /> ' +
LANG_SHARED + ':
' + LANG_NO + '';
}
html += '
ID:
' + id + ' ';
overlib(html);
},
getToolbar :
function(action) {
var buttons;
if (typeof action == "undefined") action = "catsmgr";
var params = 'uid=' + this.uid + '&id=' + id + '&action=' + action + '&task=get_toolbar';
this.connector = new Ajax.Request(this.req_uri, {
method: this.method,
encoding: this.charset,
parameters: params,
onSuccess: this.buildToolbar});
},
buildToolbar :
function(callback) {
var i, j, name, caption, domButton, domImg;
var spacerSize = 10; //width of the table cells that function as a spacer in 'px'
var buttons = callback.responseXML.getElementsByTagName('button');
var toolbar = IS_BACKEND ? $('toolbar').rows[0] : $('ZMG_toolbar');
if (IS_BACKEND) {
if (is_ie) { //apparently, IE doesn't like it when you clear a table row with 'innerHTML' :S
for (i = 0; i < toolbar.childNodes.length; i++) {
if (toolbar.childNodes[i]) {
if (toolbar.childNodes[i].clientWidth == 10)
toolbar.childNodes[i].style.width = "0px";
if (toolbar.childNodes[i].nodeName && toolbar.childNodes[i].nodeName.toLowerCase() == "td") {
try {
toolbar.removeChild(toolbar.childNodes[i]);
} catch (ex) {}; //do nothing...
}
}
}
} else {
toolbar.innerHTML = "";
}
//spacer:
toolbar.insertCell(0).width = spacerSize;
domButton = toolbar.insertCell(0).appendChild(document.createElement('a'));
domButton.id = "ZMG_back";
domButton.href = Zoom.site_uri + "/administrator/index2.php?option=com_zoom&page=admin";
Element.addClassName(domButton, 'toolbar');
domImg = domButton.appendChild(document.createElement('img'));
domImg.border = 0;
domImg.align = "middle";
domImg.name = "back";
domImg.alt = LANG_BTN_BACK;
domImg.src = Zoom.site_uri + "/administrator/images/back_f2.png";
domButton.appendChild(document.createElement('br'));
domButton.appendChild(document.createTextNode(LANG_BTN_BACK));
} else {
toolbar.innerHTML = "";
}
for (var j = 0; j < buttons.length; j++) {
name = buttons[j].getAttribute('type');
caption = buttons[j].getAttribute('caption') || '';
if (IS_BACKEND) {
//spacer:
toolbar.insertCell(0).width = spacerSize;
domButton = toolbar.insertCell(0).appendChild(document.createElement('a'));
domButton.id = "ZMG_" + name;
domButton.href = "#";
domButton.onclick = function() {
Zoom.dispatch(this.id.replace(/ZMG_/g, ''));
};
Element.addClassName(domButton, 'toolbar');
domImg = domButton.appendChild(document.createElement('img'));
domImg.border = 0;
domImg.align = "middle";
domImg.name = name;
domImg.alt = caption;
domImg.src = Zoom.site_uri + "/administrator/images/" + name + "_f2.png";
domButton.appendChild(document.createElement('br'));
domButton.appendChild(document.createTextNode(caption));
} else {
new Zoom.Button(name, '', toolbar, {
width: 32,
height: 32,
group: caption,
classEnter: 'zmg_tb_btn_' + name + '_hover',
classLeave: 'zmg_tb_btn_' + name,
onEnter: function(button) {
overlib(button.options.group);
},
onLeave : function(button) {
nd();
},
onLeftClick: function(button) {
Zoom.dispatch(button.getId());
}
});
}
}
if (IS_BACKEND) {
//spacer:
toolbar.insertCell(0).width = spacerSize;
domButton = toolbar.insertCell(0).appendChild(document.createElement('a'));
domButton.id = "ZMG_ordersave";
domButton.href = "#";
domButton.onclick = function() {
Zoom.resortGallery();
};
Element.addClassName(domButton, 'toolbar');
domImg = domButton.appendChild(document.createElement('img'));
domImg.border = 0;
domImg.align = "middle";
domImg.name = "ordersave";
domImg.alt = LANG_BTN_ORDERSAVE;
domImg.src = Zoom.site_uri + "/components/com_zoom/www/images/admin/ordersave_f2.png";
domButton.appendChild(document.createElement('br'));
domButton.appendChild(document.createTextNode(LANG_BTN_ORDERSAVE));
} else {
new Zoom.Button('ZMG_ordersave', '', toolbar, {
width: 32,
height: 32,
group: LANG_BTN_ORDERSAVE,
classEnter: 'zmg_tb_btn_ordersave_hover',
classLeave: 'zmg_tb_btn_ordersave',
onEnter: function(button) {
overlib(button.options.group);
},
onLeave : function(button) {
nd();
},
onLeftClick: function(button) {
Zoom.resortGallery();
}
});
}
},
getParentOptions :
function() {
var params = 'uid=' + this.uid + '&id=' + id + '&task=get_galleries';
this.connector = new Ajax.Request(this.req_uri, {
method: this.method,
encoding: this.charset,
parameters: params,
onSuccess: this.setParentOptions});
},
setParentOptions :
function(callback) {
var oParent = document.catsmgr.elements['parent'];
var sel = "0";
var options = callback.responseXML.getElementsByTagName('gallery');
var option, id;
oParent.innerHTML = "";
for (var j = 0; j < options.length; j++) {
id = options[j].getAttribute('id');
if (id != Zoom.activeCat) {
var option = document.createElement('option');
option.value = id;
option.innerHTML = options[j].firstChild.nodeValue;
if (option.value == Zoom.activeSubcat)
option.selected = true;
oParent.appendChild(option);
}
}
},
dispatch :
function(action) {
var i, descr = getEditorContent();
if (descr == null)
descr = $F('catdescr');
var form = document.catsmgr;
var oParent = form.elements['parent'];
var sParent = "0";
if (action == "delete" && !confirm(LANG_CONFIRM_DEL)) return;
showMe();
for (i = 0; i < oParent.childNodes.length; i++)
if (oParent.childNodes[i].selected) sParent = oParent.childNodes[i].value;
var params = 'uid=' + this.uid + '&id=' + id + '&catid=' + $F('catid') + '&task=catsmgr_' + action + '&parent=' + sParent +
'&name=' + $F('catname').replace('&', '%26') + '&dir=' + $F('catdir') +
'&password=' + $F('catpassword') + '&keywords=' + $F('catkeywords').replace('&', '%26') +
'&descr=' + descr + '&hide_msg=' + ((form.elements['hidemsg'].checked) ? "1" : "0") +
'&published=' + ((form.elements['published'].checked) ? "1" : "0") + '&shared=' + ((form.elements['shared'].checked) ? "1" : "0");
for (i = 0; i < form.elements['members_sel'].options.length; i++)
params += '&members_sel[]=' + form.elements['members_sel'].options[i].value;
this.connector = new Ajax.Request(this.req_uri, {
method: this.method,
encoding: this.charset,
parameters: params,
onSuccess: Zoom.setFormFields });
},
doPinTree: function() {
if (this.treePinned)
this.unpinTree();
else
this.pinTree();
},
unpinTree: function() {
//if (is_ie) this.treeUnsetDragdrop();
var oTree = $('cats_tree_container');
var oTreeCaption = $('cats_tree_caption');
oTree.style.zIndex = 200;
oTreeCaption.style.zIndex = 200;
Position.prepare();
Position.absolutize(oTree);
Position.absolutize(oTreeCaption);
var aPosT = Position.page(oTree);
var aPosC = Position.page(oTreeCaption);
this.treePos = [aPosT[0] + Position.deltaX, aPosT[1] + Position.deltaY];
this.treeCaptionPos = [aPosC[0] + Position.deltaX, aPosC[1] + Position.deltaY];
Element.addClassName($('cats_tree'), 'cats_tree_unpinned');
Element.addClassName(oTreeCaption, 'cats_tree_caption_unpinned');
this.treeDrag = new Draggable(oTreeCaption);
oTreeCaption.style.cursor = "move";
document.body.appendChild(oTreeCaption);
document.body.appendChild(oTree);
Element.hide($('cats_tree_table'));
var oImg = $('cats_tree_pinimg');
oImg.src = oImg.src.replace(/unpin.gif/, 'pin.gif');
this.treePinned = false;
this.dragTree(this.treeDrag);
},
pinTree: function() {
//if (is_ie) this.treeSetDragdrop();
var oTree = $('cats_tree_container');
var oTable = $('cats_tree_table');
var oTreeCaption = $('cats_tree_caption');
oTree.style.zIndex = 0;
oTreeCaption.style.zIndex = 0;
Element.show(oTable);
Position.prepare();
oTree.style.left = this.treePos[0] + "px";
oTree.style.top = this.treePos[1] + "px";
oTreeCaption.style.left = this.treeCaptionPos[0] + "px";
oTreeCaption.style.top = this.treeCaptionPos[1] + "px";
Position.relativize(oTree);
Position.relativize(oTreeCaption);
this.treeDrag.destroy();
this.treeDrag = null;
oTreeCaption.style.cursor = "";
Element.removeClassName($('cats_tree'), 'cats_tree_unpinned');
Element.removeClassName(oTreeCaption, 'cats_tree_caption_unpinned');
oTable.appendChild(oTreeCaption);
oTable.appendChild(oTree);
var oImg = $('cats_tree_pinimg');
oImg.src = oImg.src.replace(/pin.gif/, 'unpin.gif');
this.treePinned = true;
},
dragTree:
function(draggable) {
if (draggable == this.treeDrag) {
var d = draggable.currentDelta();
//$('catsmgr_tabs_page1').innerHTML += "DEBUG: " + draggable + ", " + pos[0] + ", " + pos[1] + "