Prechádzať zdrojové kódy

TODO: UI_AjaxContent

Piotr Labudda 6 rokov pred
rodič
commit
2145d5d9e6

+ 19 - 0
SE/se-lib/UI/AjaxContent.php

@@ -0,0 +1,19 @@
+<?php
+
+class UI_AjaxContent implements UITagInterface {
+
+	/**
+	 * @param string $tagName = 'p5:AjaxContent'
+	 * @param array $props
+	 * @param array $childrens
+	 * 
+	 * @return string html code
+	 */
+	static function h($tagName, $props = [], $childrens = []) {
+		if (empty($props['url'])) throw new Exception("Missing url!");
+		// if (empty($props['url'])) throw new Exception("Missing url!");
+
+		return UI::h('div', [], "loading...");
+	}
+
+}

+ 17 - 0
SE/se-lib/UI/SidePanelButton.php

@@ -61,6 +61,23 @@ class UI_SidePanelButton implements UITagInterface {
 				])
 			:	null // created by JS on demand
 			,
+			('dynamic' === $mode)
+			?
+				// TODO: create in JS
+				// like UI_AjaxContent inside `p5-side_panel__content`
+				UI::h('div', [ 'style' => "display:none" ], [
+					UI::h('div', [ 'class' => "p5-side_panel p5-side_panel--from-right", 'id' => $idHtmlNode ], [
+						UI::h('header', [ 'class' => "p5-side_panel__header" ], [
+							UI::h('h1', [], $props['title']),
+							UI::h('button', [ 'class' => "p5-side_panel__close p5-side_panel--js-close" ], "Close"),
+						]),
+						UI::h('div', [ 'class' => "p5-side_panel__container" ], [
+							UI::h('div', [ 'class' => "p5-side_panel__content" ], $childrens),
+						]),
+					]),
+				])
+			:	null // created by JS on demand
+			,
 			UI::hScript($jsFile = __FILE__ . '.script.js', $jsonVars = [
 				// 'FUNCTION_NAME' => $jsFuncName,
 				// 'ID_HTML_NODE' => $idHtmlNode,