/*
* Helma License Notice
*
* The contents of this file are subject to the Helma License
* Version 2.0 (the "License"). You may not use this file except in
* compliance with the License. A copy of the License is available at
* http://adele.helma.org/download/helma/license.txt
*
* Copyright 1998-2005 Helma Software. All Rights Reserved.
*
* $RCSfile: helma.Inspector.js,v $
* $Author: czv $
* $Revision: 1.5 $
* $Date: 2006/04/24 11:12:40 $
*/
// take care of any dependencies
app.addRepository('modules/core/String.js');
app.addRepository('modules/core/Number.js');
app.addRepository('modules/helma/Html.js');
if (!global.helma) {
global.helma = {};
}
helma.Inspector = function(hopObj) {
if (!hopObj)
hopObj == root;
var version = "4.0";
var children = [];
var properties = [];
var collections = [];
var html = new helma.Html();
var keySorter = new String.Sorter("key");
var idSorter = new Number.Sorter("id");
var skins = {
child: createSkin(helma.Inspector.child_skin),
collection: createSkin(helma.Inspector.collection_skin),
date: createSkin(helma.Inspector.date_skin),
editor: createSkin(helma.Inspector.editor_skin),
property: createSkin(helma.Inspector.property_skin)
};
var genOptions = function(start, end, selected) {
res.push();
for (var i=start; i<=end; i+=1) {
res.write("\n");
}
return res.pop();
};
this.render = function() {
for (var i in hopObj) {
var obj = {
key: i,
value: hopObj[i]
};
if (hopObj[i]) {
if (obj.value._prototype &&
obj.value._prototype == "HopObject")
collections.push(obj);
else
properties.push(obj);
}
}
properties.sort(keySorter);
collections.sort(keySorter);
var n = hopObj.size();
for (var i=0; i cols="40" rows="1"><% param.value encoding="form" %> \
\
\
\
\
\
\
\
';
HopObject.prototype[ (app.properties['inspectorAction'] || 'inspector') +'_action' ] = function() {
if (!helma.auth('inspector'))
res.abort();
if (typeof helma == "undefined" || !helma.Inspector) {
res.write("Could not create instance of helma.Inspector ");
res.write("(probably due to missing helmaLib v4.0+)");
return;
}
var inspector = new helma.Inspector(this);
inspector.action();
return;
};
helma.lib = "Inspector";
helma.dontEnum(helma.lib);
for (var i in helma[helma.lib])
helma[helma.lib].dontEnum(i);
for (var i in helma[helma.lib].prototype)
helma[helma.lib].prototype.dontEnum(i);
delete helma.lib;