diff --git a/api/js/etemplate/et2_core_DOMWidget.js b/api/js/etemplate/et2_core_DOMWidget.js index dcc88516a2..8ecf911aa3 100644 --- a/api/js/etemplate/et2_core_DOMWidget.js +++ b/api/js/etemplate/et2_core_DOMWidget.js @@ -399,7 +399,7 @@ var et2_DOMWidget = /** @class */ (function (_super) { } // Initialize the action manager and add some actions to it // Only look 1 level deep - var gam = egw_action_js_1.egw_getActionManager(this.egw().appName, true, 1); + var gam = window.egw_getActionManager(this.egw().appName, true, 1); if (typeof this._actionManager != "object") { if (gam.getActionById(this.getInstanceManager().uniqueId, 1) !== null) { gam = gam.getActionById(this.getInstanceManager().uniqueId, 1); diff --git a/api/js/etemplate/et2_core_DOMWidget.ts b/api/js/etemplate/et2_core_DOMWidget.ts index b2b360b115..5439f82dfb 100644 --- a/api/js/etemplate/et2_core_DOMWidget.ts +++ b/api/js/etemplate/et2_core_DOMWidget.ts @@ -575,7 +575,7 @@ export abstract class et2_DOMWidget extends et2_widget implements et2_IDOMNode // Initialize the action manager and add some actions to it // Only look 1 level deep - var gam = egw_getActionManager(this.egw().appName,true,1); + var gam = window.egw_getActionManager(this.egw().appName,true,1); if(typeof this._actionManager != "object") { if(gam.getActionById(this.getInstanceManager().uniqueId,1) !== null) diff --git a/api/js/etemplate/et2_core_arrayMgr.js b/api/js/etemplate/et2_core_arrayMgr.js index 3790186996..ecd18ada7b 100644 --- a/api/js/etemplate/et2_core_arrayMgr.js +++ b/api/js/etemplate/et2_core_arrayMgr.js @@ -7,7 +7,13 @@ * @subpackage api * @link http://www.egroupware.org * @author Andreas Stöckel - */ + * + +/*egw:uses + et2_core_common; + egw_inheritance; + et2_core_phpExpressionCompiler; +*/ var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || @@ -323,7 +329,9 @@ exports.et2_arrayMgr = et2_arrayMgr; var et2_readonlysArrayMgr = /** @class */ (function (_super) { __extends(et2_readonlysArrayMgr, _super); function et2_readonlysArrayMgr() { - return _super !== null && _super.apply(this, arguments) || this; + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.readOnly = true; + return _this; } /** * Find out if the given ID is readonly, according to the array data diff --git a/api/js/etemplate/et2_core_arrayMgr.ts b/api/js/etemplate/et2_core_arrayMgr.ts index 1e8ad92e70..58637791ef 100644 --- a/api/js/etemplate/et2_core_arrayMgr.ts +++ b/api/js/etemplate/et2_core_arrayMgr.ts @@ -6,7 +6,7 @@ * @subpackage api * @link http://www.egroupware.org * @author Andreas Stöckel - */ + * /*egw:uses et2_core_common; @@ -33,7 +33,7 @@ export class et2_arrayMgr }; protected static compiledExpressions: object = {}; private readonly _parentMgr: et2_arrayMgr; - private readOnly: boolean = false; + protected readOnly: boolean = false; /** * Constructor @@ -358,6 +358,8 @@ export class et2_arrayMgr */ export class et2_readonlysArrayMgr extends et2_arrayMgr { + readOnly : boolean = true; + /** * Find out if the given ID is readonly, according to the array data * diff --git a/api/js/etemplate/et2_core_widget.js b/api/js/etemplate/et2_core_widget.js index 44e85c1629..5edb3ef408 100644 --- a/api/js/etemplate/et2_core_widget.js +++ b/api/js/etemplate/et2_core_widget.js @@ -126,10 +126,6 @@ var et2_widget = /** @class */ (function (_super) { // Set the legacyOptions array to the names of the properties the "options" // attribute defines. _this.legacyOptions = []; - /** - * Set this variable to true if this widget can have namespaces - */ - _this.createNamespace = false; _this._children = []; _this._mgrs = {}; /** @@ -164,7 +160,7 @@ var et2_widget = /** @class */ (function (_super) { _this.supportedWidgetClasses = [et2_widget]; if (_attrs["id"]) { // Create a namespace for this object - if (_this.createNamespace) { + if (_this._createNamespace()) { _this.checkCreateNamespace(); } } @@ -487,7 +483,7 @@ var et2_widget = /** @class */ (function (_super) { if (this.getArrayMgr("modifications")) { var data = this.getArrayMgr("modifications").getEntry(this.id); // Check for already inside namespace - if (this.createNamespace && this.getArrayMgr("modifications").perspectiveData.owner == this) { + if (this._createNamespace() && this.getArrayMgr("modifications").perspectiveData.owner == this) { data = this.getArrayMgr("modifications").data; } if (typeof data === 'object') { @@ -812,6 +808,17 @@ var et2_widget = /** @class */ (function (_super) { } } }; + /** + * Widgets that do support a namespace should override and return true. + * + * Since a private attribute doesn't get instanciated properly before it's needed, + * we use a method so we can get what we need while still in the constructor. + * + * @private + */ + et2_widget.prototype._createNamespace = function () { + return false; + }; /** * Sets the instance manager object (of type etemplate2, see etemplate2.js) * @@ -841,7 +848,7 @@ var et2_widget = /** @class */ (function (_super) { et2_widget.prototype.getPath = function () { var path = this.getArrayMgr("content").getPath(); // Prevent namespaced widgets with value from going an extra layer deep - if (this.id && this.createNamespace && path[path.length - 1] == this.id) + if (this.id && this._createNamespace() && path[path.length - 1] == this.id) path.pop(); return path; };