etemplate2 object now creates not passed entries in the data array

This commit is contained in:
Andreas Stöckel 2011-08-15 12:46:27 +00:00
parent 8c9fd0f636
commit fd21e247a1

View File

@ -60,6 +60,22 @@ etemplate2.prototype.clear = function()
*/ */
etemplate2.prototype._createArrayManagers = function(_data) etemplate2.prototype._createArrayManagers = function(_data)
{ {
if (typeof _data == "undefined")
{
_data = {};
}
// Create all neccessary _data entries
var neededEntries = ["content", "readonlys", "validation_errors"];
for (var i = 0; i < neededEntries.length; i++)
{
if (typeof _data[neededEntries[i]] == "undefined")
{
et2_debug("info", "Created not passed entry '" + neededEntries[i] + "' in data array.");
_data[neededEntries[i]] = {};
}
}
var result = {}; var result = {};
// Create an array manager object for each part of the _data array. // Create an array manager object for each part of the _data array.