Radius/add network structure

This commit is contained in:
Luca Haid
2025-12-09 05:34:24 +00:00
parent 60556e5d63
commit 167b038c20
37 changed files with 6833 additions and 2920 deletions

View File

@@ -165,6 +165,33 @@ class Helper {
$controller->layout()->setTemplate("VueViews/Vue");
}
/**
* Displays Vue 3 component with the given header title.
* Uses TT-Core component library instead of legacy Vue 2 components.
*
* @param mfBaseController $controller The controller instance to generate $JSGlobals for.
* @param string $pageName The name of the Vue component to render.
* @param string $headerTitle The title to display in the header.
* @param array $additionalGlobals Additional global variables to pass to the Vue component.
*/
public static function renderVue3(mfBaseController $controller, string $pageName, string $headerTitle, array $additionalGlobals = []) {
$JSGlobals = ["BASE_URL" => $controller::getUrl($pageName),
"MF_URL" => $controller::getUrl(""),
"DASHBOARD_URL" => $controller::getUrl("Dashboard"),
"MF_APP_NAME" => MFAPPNAME_SLUG,
"BASE_PATH" => $controller::getUrl(""),
"PAGE_TITLE" => $headerTitle,
"PATH" => [["text" => MFAPPNAME_SLUG, "href" => $controller::getUrl("Dashboard")],
["text" => $headerTitle, "href" => $controller::getUrl($pageName)]],];
$JSGlobals = array_merge($JSGlobals, $additionalGlobals);
$controller->layout()->set("vueViewName", $pageName);
$controller->layout()->set("JSGlobals", $JSGlobals);
$controller->layout()->set("useVue3", true); // Flag to indicate Vue 3 mode
$controller->layout()->setTemplate("VueViews/Vue3");
}
/**
* Converts an array of objects to a CSV file.
* @param array $rows The array of objects to convert to CSV.