Initial commit
This commit is contained in:
parent
611c7a6a25
commit
f0d26dd75b
10
PHP/Public/.htaccess
Normal file
10
PHP/Public/.htaccess
Normal file
@ -0,0 +1,10 @@
|
||||
RewriteEngine On
|
||||
|
||||
# Do not remove this line, otherwise mod_rewrite rules will stop working
|
||||
RewriteBase /
|
||||
|
||||
RewriteRule ^StyleSheets/(.*)\.css$ lessc.php?filename=$1 [PT,L,QSA]
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^(.*)$ index.php?virtualpath=$1 [PT,L,QSA]
|
||||
0
PHP/Public/Include/Configuration.inc.php
Normal file
0
PHP/Public/Include/Configuration.inc.php
Normal file
8
PHP/Public/Include/MasterPages/000-WebPage.inc.php
Normal file
8
PHP/Public/Include/MasterPages/000-WebPage.inc.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace UniversalEditor\PublicWebsite\MasterPages;
|
||||
|
||||
class WebPage extends \WebFX\WebPage
|
||||
{
|
||||
|
||||
}
|
||||
?>
|
||||
19
PHP/Public/Include/Modules/000-Default/Main.inc.php
Normal file
19
PHP/Public/Include/Modules/000-Default/Main.inc.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace UniversalEditor\PublicWebsite\Modules;
|
||||
|
||||
use WebFX\System;
|
||||
use WebFX\Module;
|
||||
use WebFX\ModulePage;
|
||||
|
||||
use UniversalEditor\PublicWebsite\Pages\MainPage;
|
||||
|
||||
System::$Modules[] = new Module("com.universaleditor.PublicWebsite.Default", array
|
||||
(
|
||||
new ModulePage("", function($path)
|
||||
{
|
||||
$page = new MainPage();
|
||||
$page->Render();
|
||||
return true;
|
||||
})
|
||||
));
|
||||
?>
|
||||
15
PHP/Public/Include/Pages/000-MainPage.inc.php
Normal file
15
PHP/Public/Include/Pages/000-MainPage.inc.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace UniversalEditor\PublicWebsite\Pages;
|
||||
|
||||
use UniversalEditor\PublicWebsite\MasterPages\WebPage;
|
||||
|
||||
class MainPage extends WebPage
|
||||
{
|
||||
protected function RenderContent()
|
||||
{
|
||||
?>
|
||||
Welcome to Universal Editor!
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
40
PHP/Public/index.php
Normal file
40
PHP/Public/index.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
// =============================================================================
|
||||
// WebFX bootstrapper - loads the application modules and executes WebFX
|
||||
// Copyright (C) 2013-2014 Mike Becker
|
||||
//
|
||||
// This program 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 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program 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.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// =============================================================================
|
||||
|
||||
// We need to get the root path of the Web site. It's usually something like
|
||||
// /var/www/yourdomain.com.
|
||||
global $RootPath;
|
||||
$RootPath = dirname(__FILE__);
|
||||
|
||||
// Now that we have defined the root path, load the WebFX content (which also
|
||||
// include_once's the modules and other WebFX-specific stuff)
|
||||
require_once("WebFX/WebFX.inc.php");
|
||||
|
||||
// Bring in the WebFX\System and WebFX\IncludeFile classes so we can simply refer
|
||||
// to them (in this file only) as "System" and "IncludeFile", respectively, from
|
||||
// now on
|
||||
use WebFX\System;
|
||||
use WebFX\IncludeFile;
|
||||
|
||||
// Tell WebFX that we are ready to launch the application. This cycles through
|
||||
// all of the modules (usually you will define your main application content in
|
||||
// 000-Default) and executes the first module page that corresponds to the path
|
||||
// the user is GETting.
|
||||
System::Launch();
|
||||
?>
|
||||
29
PHP/Public/lessc.php
Normal file
29
PHP/Public/lessc.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
require("lessc.inc.php");
|
||||
|
||||
header("Content-Type: text/css");
|
||||
|
||||
$filename = "StyleSheets/" . $_GET["filename"];
|
||||
|
||||
if ((isset($_GET["compile"]) && $_GET["compile"] == "false") || file_exists($filename . ".css"))
|
||||
{
|
||||
readfile($filename . ".css");
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
$less = new lessc();
|
||||
$less->formatterName = "compressed";
|
||||
$v = $less->compileFile($filename . ".less");
|
||||
|
||||
echo("/* compiled with lessphp v0.4.0 - GPLv3/MIT - http://leafo.net/lessphp */\n");
|
||||
echo("/* for human-readable source of this file, replace .css with .less in the file name */\n");
|
||||
echo($v);
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
echo "/* " . $e->getMessage() . " */\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
x
Reference in New Issue
Block a user