diff --git a/Core/Frameworks/Baikal/Controller/Main.php b/Core/Frameworks/Baikal/Controller/Main.php new file mode 100644 index 0000000..9ee579c --- /dev/null +++ b/Core/Frameworks/Baikal/Controller/Main.php @@ -0,0 +1,39 @@ + +# All rights reserved +# +# http://sabre.io/baikal +# +# This script is part of the Baïkal Server project. The Baïkal +# Server project is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# The GNU General Public License can be found at +# http://www.gnu.org/copyleft/gpl.html. +# +# This script is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# This copyright notice MUST APPEAR in all copies of the script! +################################################################# + + +namespace Baikal\Controller; + +class Main extends \Flake\Core\Controller { + + function execute() { + } + + function render() { + $oView = new \Baikal\View\Main(); + return $oView->render(); + } +} diff --git a/Core/Frameworks/Baikal/Controller/Navigation/Topbar/Anonymous.php b/Core/Frameworks/Baikal/Controller/Navigation/Topbar/Anonymous.php new file mode 100644 index 0000000..69d5182 --- /dev/null +++ b/Core/Frameworks/Baikal/Controller/Navigation/Topbar/Anonymous.php @@ -0,0 +1,39 @@ + +# All rights reserved +# +# http://sabre.io/baikal +# +# This script is part of the Baïkal Server project. The Baïkal +# Server project is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# The GNU General Public License can be found at +# http://www.gnu.org/copyleft/gpl.html. +# +# This script is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# This copyright notice MUST APPEAR in all copies of the script! +################################################################# + + +namespace Baikal\Controller\Navigation\Topbar; + +class Anonymous extends \Flake\Core\Controller { + + function execute() { + } + + function render() { + $oView = new \Baikal\View\Navigation\Topbar\Anonymous(); + return $oView->render(); + } +} diff --git a/Core/Frameworks/Baikal/Core/View.php b/Core/Frameworks/Baikal/Core/View.php new file mode 100644 index 0000000..f48e9fa --- /dev/null +++ b/Core/Frameworks/Baikal/Core/View.php @@ -0,0 +1,36 @@ + +# All rights reserved +# +# http://baikal-server.com +# +# This script is part of the Baïkal Server project. The Baïkal +# Server project is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# The GNU General Public License can be found at +# http://www.gnu.org/copyleft/gpl.html. +# +# This script is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# This copyright notice MUST APPEAR in all copies of the script! +################################################################# + + +namespace Baikal\Core; + +class View extends \Flake\Core\View { + function templatesPath() { + $sViewName = get_class($this); + $sTemplate = str_replace("\\", "/", substr($sViewName, strlen("Baikal\\View\\"))) . ".html"; + return PROJECT_PATH_ROOT . "Core/Resources/Web/Baikal/Templates/" . $sTemplate; + } +} diff --git a/Core/Frameworks/Baikal/Resources/Images/logo-baikal.png b/Core/Frameworks/Baikal/Resources/Images/logo-baikal.png new file mode 100644 index 0000000..1a623ea Binary files /dev/null and b/Core/Frameworks/Baikal/Resources/Images/logo-baikal.png differ diff --git a/Core/Frameworks/Baikal/Resources/Templates/Main.html b/Core/Frameworks/Baikal/Resources/Templates/Main.html new file mode 100644 index 0000000..1f2ed22 --- /dev/null +++ b/Core/Frameworks/Baikal/Resources/Templates/Main.html @@ -0,0 +1,14 @@ +{% autoescape false %} +
+

Baïkal +

Lightweight CalDAV+CardDAV server.

+
+ +{{ message }} + +
+ +
+{% endautoescape %} diff --git a/Core/Frameworks/Baikal/Resources/Templates/Navigation/Topbar/Anonymous.html b/Core/Frameworks/Baikal/Resources/Templates/Navigation/Topbar/Anonymous.html new file mode 100644 index 0000000..e2ab048 --- /dev/null +++ b/Core/Frameworks/Baikal/Resources/Templates/Navigation/Topbar/Anonymous.html @@ -0,0 +1,20 @@ +{% autoescape false %} + +{% endautoescape %} diff --git a/Core/Frameworks/Baikal/Resources/Templates/Page/index.html b/Core/Frameworks/Baikal/Resources/Templates/Page/index.html new file mode 100644 index 0000000..c85f01c --- /dev/null +++ b/Core/Frameworks/Baikal/Resources/Templates/Page/index.html @@ -0,0 +1,53 @@ +{% autoescape false %} + + + + + {{ pagetitle }} + + + + + + + + + + + + + {{ head }} + + + {{ navbar }} + +
+ {{ Payload }} +
+ + + + + + + {{ javascript }} + + +{% endautoescape %} diff --git a/Core/Frameworks/Baikal/View/Main.php b/Core/Frameworks/Baikal/View/Main.php new file mode 100644 index 0000000..6bd4fdf --- /dev/null +++ b/Core/Frameworks/Baikal/View/Main.php @@ -0,0 +1,32 @@ + +# All rights reserved +# +# http://baikal-server.com +# +# This script is part of the Baïkal Server project. The Baïkal +# Server project is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# The GNU General Public License can be found at +# http://www.gnu.org/copyleft/gpl.html. +# +# This script is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# This copyright notice MUST APPEAR in all copies of the script! +################################################################# + + +namespace Baikal\View; + +class Main extends \Baikal\Core\View { + +} diff --git a/Core/Frameworks/Baikal/View/Navigation/Topbar/Anonymous.php b/Core/Frameworks/Baikal/View/Navigation/Topbar/Anonymous.php new file mode 100644 index 0000000..48afed6 --- /dev/null +++ b/Core/Frameworks/Baikal/View/Navigation/Topbar/Anonymous.php @@ -0,0 +1,32 @@ + +# All rights reserved +# +# http://baikal-server.com +# +# This script is part of the Baïkal Server project. The Baïkal +# Server project is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# The GNU General Public License can be found at +# http://www.gnu.org/copyleft/gpl.html. +# +# This script is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# This copyright notice MUST APPEAR in all copies of the script! +################################################################# + + +namespace Baikal\View\Navigation\Topbar; + +class Anonymous extends \Baikal\Core\View { + +} diff --git a/Core/Frameworks/Baikal/WWWRoot/index.php b/Core/Frameworks/Baikal/WWWRoot/index.php index 60d5a31..092a21c 100644 --- a/Core/Frameworks/Baikal/WWWRoot/index.php +++ b/Core/Frameworks/Baikal/WWWRoot/index.php @@ -49,16 +49,17 @@ require PROJECT_PATH_ROOT . 'vendor/autoload.php'; \Flake\Framework::bootstrap(); # Bootstrapping Baïkal -\Baikal\Framework::bootstrap(); +\BaikalAdmin\Framework::bootstrap(); -?> - - - Baïkal Server - - - -

Baïkal is running alright.

- - +# Create and setup a page object +$oPage = new \Flake\Controller\Page(PROJECT_PATH_ROOT . "Core/Resources/Web/Baikal/Templates/Page/index.html"); +$oPage->injectHTTPHeaders(); +$oPage->setTitle("Baïkal server"); +$oPage->setBaseUrl(PROJECT_URI); + +# Draw page +$oPage->zone("navbar")->addBlock(new \Baikal\Controller\Navigation\Topbar\Anonymous()); +$oPage->zone("Payload")->addBlock(new \Baikal\Controller\Main()); + +# Render the page +echo $oPage->render(); diff --git a/Core/Resources/Web/Baikal b/Core/Resources/Web/Baikal new file mode 120000 index 0000000..9f5895a --- /dev/null +++ b/Core/Resources/Web/Baikal @@ -0,0 +1 @@ +../../Frameworks/Baikal/Resources \ No newline at end of file