{
var ret = { };
var _this = this;
- ['id', 'name', 'parent', 'title', 'path', 'items' ].forEach( function(k) {
- ret[k] = _this[k];
+ ['id', 'name', 'parent', 'title', 'path', 'items' , 'permname' ].forEach( function(k) {
+ ret[k] = typeof(_this[k]) == 'undefined' ? '' _this[k];
});
return ret;
},
left = "'" + leftv + "'";
} else if (leftv.match(/[^A-Z_]+/i)) { // not plain a-z... - quoted.
var val = JSON.stringify(leftv);
- left = "'" + val.substring(1, val.length-1).replace(/'/, "\\'") + "'";
+ left = "'" + val.substring(1, val.length-1).replace(/'/g, "\\'") + "'";
} else {
left = '' + leftv;
}
// standard. .
if (typeof(obj[i]) != 'string') {
els.push(left + JSON.stringify(obj[i]));
- continue;
+ return;
}
// strings..
- if (!this.doubleStringProps) {
+ if (!_this.doubleStringProps) {
els.push(left + JSON.stringify(obj[i]));
+ return;
}
- if (this.doubleStringProps.indexOf(i) > -1) {
+ if (_this.doubleStringProps.indexOf(i) > -1) {
els.push(left + JSON.stringify(obj[i]));
- continue;
+ return;
}
// single quote..
- els.push(left + "'" + v.replace(/'/g, "\\'") + "'");
+ els.push(left + "'" + obj[i].replace(/'/g, "\\'") + "'");
});