2007-07-19 12:40:05 +02:00
|
|
|
if(typeof SiteTreeHandlers == 'undefined') SiteTreeHandlers = {};
|
|
|
|
|
|
|
|
SiteTree.prototype = {
|
|
|
|
castAsTreeNode: function(li) {
|
|
|
|
behaveAs(li, SiteTreeNode, this.options);
|
|
|
|
},
|
|
|
|
|
|
|
|
getIdxOf : function(treeNode) {
|
|
|
|
if(treeNode && treeNode.id)
|
|
|
|
return treeNode.id;
|
|
|
|
},
|
|
|
|
|
|
|
|
getTreeNodeByIdx : function(idx) {
|
|
|
|
if(!idx) idx = "0";
|
|
|
|
return document.getElementById(idx);
|
|
|
|
},
|
|
|
|
|
|
|
|
initialise: function() {
|
|
|
|
this.observeMethod('SelectionChanged', this.changeCurrentTo);
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
SiteTreeNode.prototype.onselect = function() {
|
|
|
|
$('sitetree').changeCurrentTo(this);
|
2009-11-21 04:15:32 +01:00
|
|
|
jQuery('#sitetree').trigger('selectionchanged');
|
2007-07-19 12:40:05 +02:00
|
|
|
if($('sitetree').notify('SelectionChanged', this)) {
|
|
|
|
this.getPageFromServer();
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
};
|
|
|
|
|
|
|
|
SiteTreeNode.prototype.getPageFromServer = function() {
|
|
|
|
if(this.id)
|
|
|
|
$('Form_EditForm').getPageFromServer(this.id);
|
|
|
|
};
|
|
|
|
|
|
|
|
function reloadSiteTree() {
|
|
|
|
|
|
|
|
new Ajax.Request( 'admin/report/getsitetree', {
|
|
|
|
method: get,
|
|
|
|
onSuccess: function( response ) {
|
|
|
|
$('sitetree_holder').innerHTML = response.responseText;
|
|
|
|
},
|
|
|
|
onFailure: function( response ) {
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2009-11-21 03:37:27 +01:00
|
|
|
jQuery(document).ready(function() {
|
2008-11-14 00:03:14 +01:00
|
|
|
if($('sitetree')) {
|
|
|
|
var selectedNode = $('sitetree').getElementsByTagName('li')[1];
|
|
|
|
selectedNode.onselect();
|
|
|
|
}
|
2007-07-19 12:40:05 +02:00
|
|
|
});
|