Banner
@@ -661,7 +677,8 @@ export class EgwFramework extends LitElement
footer
- `;
+ `), html`
Waiting for egw...
+
`)}`;
}
}
diff --git a/kdots/js/EgwFrameworkApp.ts b/kdots/js/EgwFrameworkApp.ts
index 906cb978ef..d724bced96 100644
--- a/kdots/js/EgwFrameworkApp.ts
+++ b/kdots/js/EgwFrameworkApp.ts
@@ -12,6 +12,7 @@ import type {EgwFramework} from "./EgwFramework";
import {etemplate2} from "../../api/js/etemplate/etemplate2";
import {et2_IPrint} from "../../api/js/etemplate/et2_core_interfaces";
import {repeat} from "lit/directives/repeat.js";
+import {until} from "lit/directives/until.js";
/**
* @summary Application component inside EgwFramework
@@ -137,6 +138,7 @@ export class EgwFrameworkApp extends LitElement
/** The application's content must be in an iframe instead of handled normally */
protected useIframe = false;
+ protected _sideboxData : any;
connectedCallback()
{
@@ -161,7 +163,6 @@ export class EgwFrameworkApp extends LitElement
firstUpdated()
{
-
this.load(this.url);
}
@@ -259,7 +260,8 @@ export class EgwFrameworkApp extends LitElement
public setSidebox(sideboxData, hash?)
{
- console.log("Not implemented");
+ this._sideboxData = sideboxData;
+ this.requestUpdate();
}
public showLeft()
@@ -519,36 +521,99 @@ export class EgwFrameworkApp extends LitElement
protected _rightHeaderTemplate()
{
return html`
-
-
- {
- this.egw.refresh("", this.name);
- /* Could also be this.load(false); this.load(this.url) */
- }}
- >
- this.framework.print()}
- >
- ${this.egw.user('apps')['waffles'] !== "undefined" ? html`
-
- {
- // @ts-ignore
- egw_link_handler(`/egroupware/index.php?menuaction=admin.admin_ui.index&load=admin.uiconfig.index&appname=${this.name}&ajax=true`, 'admin');
- }}
- >` : nothing
- }
-
+
+
+
+
+
+ {
+ this.egw.refresh("", this.name);
+ /* Could also be this.load(false); this.load(this.url) */
+ }}
+ >
+
+ ${this.egw.lang("Reload %1", this.egw.lang(this.name))}
+
+ this.framework.print()}
+ >
+
+ ${this.egw.lang("Print")}
+
+ ${this.egw.user('apps')['admin'] !== undefined ? html`
+
+ {
+ // @ts-ignore
+ egw_link_handler(`/egroupware/index.php?menuaction=admin.admin_ui.index&load=admin.uiconfig.index&appname=${this.name}&ajax=true`, 'admin');
+ }}
+ >
+
+ ${this.egw.lang("App configuration")}
+
+
+ ` : nothing}
+ ${this._sideboxMenuTemplate()}
+
+
+
`;
}
+ protected _sideboxMenuTemplate()
+ {
+ if(!this._sideboxData)
+ {
+ return nothing;
+ }
+
+ return html`${repeat(this._sideboxData, (menu) => menu['menu_name'], (menu) =>
+ {
+ // No favorites here
+ if(menu["title"] == "Favorites" || menu["title"] == this.egw.lang("favorites"))
+ {
+ return nothing;
+ }
+ // Just one thing, don't bother with submenu
+ if(menu["entries"].length == 1)
+ {
+ return html`
+
this.egw.open_link(menu["entries"][0]["item_link"])}
+ >
+ ${menu["title"]}
+ `;
+ }
+ return html`
+
+ ${menu["title"]}
+
+ ${repeat(menu["entries"], (entry) =>
+ {
+ return this._sideboxMenuItemTemplate(entry);
+ })}
+
+ `;
+ })}`;
+ }
+
+ _sideboxMenuItemTemplate(item)
+ {
+ if(item["lang_item"] == "
")
+ {
+ return html`
+
`;
+ }
+ return html`
+
this.egw.open_link(item["item_link"])}
+ >
+ ${item["lang_item"]}
+ `;
+
+ }
+
render()
{
const hasLeftSlots = this.hasSideContent("left");
@@ -579,7 +644,8 @@ export class EgwFrameworkApp extends LitElement
- ${this._rightHeaderTemplate()}
+ ${until(this.framework.getEgwComplete().then(() => this._rightHeaderTemplate()), html`
+
`)}