Commit 63bb8052 authored by Henning Leutz's avatar Henning Leutz 🥋

refactor: v 1.2.11

parent 4f5065cf
......@@ -2,7 +2,7 @@
"name": "quiqqer/quiqqer",
"type": "quiqqer-system",
"description": "A modular based management system written in JavaScript and PHP",
"version": "1.2.10",
"version": "1.2.11",
"license": "GPL-3.0+",
"authors": [
{
......
......@@ -615,6 +615,32 @@ class Utils
return $Project->get($urlQueryParams['id']);
}
/**
* Return a site by an url (relative url)
*
* @param Project $Project
* @param $link
* @return Projects\Site
*
* @throws QUI\Exception
*/
public static function getSiteByUrl(Project $Project, $link)
{
$link = str_replace('.html', '', $link);
$link = trim($link);
$link = trim($link, '/');
$parts = explode('/', $link);
$Site = $Project->firstChild();
foreach ($parts as $part) {
$id = $Site->getChildIdByName($part);
$Site = $Project->get($id);
}
return $Site;
}
/**
* Return sites from a site list
* sitelist from controls/projects/project/site/Select
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment