summaryrefslogtreecommitdiffstats
path: root/system/page
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2017-03-10 21:46:12 +0100
committerThomas Lange <code@nerdmind.de>2017-03-10 21:46:12 +0100
commite33c245d910e55b8cab407a03e669470509a705d (patch)
treee958504564ab47e72e0d3dcfe0b967440007b1d9 /system/page
parentaae885b9784466ab412e4010893808867e93c213 (diff)
downloadblog-e33c245d910e55b8cab407a03e669470509a705d.tar.gz
blog-e33c245d910e55b8cab407a03e669470509a705d.tar.xz
blog-e33c245d910e55b8cab407a03e669470509a705d.zip
Several changes have been made in this commit, which together with the previous commits result in version 1.1:v1.1
+ The rules for the Apache and nginx configuration have been changed and redirects now all requests to the index.php. + A router class has been added which now handles all requests that arrives at the application on the index.php. + Short-hand functions "PAGE", "POST" and "USER" for use in templates added to get specific item data by ID. + More language variables have been added to the core language.
Diffstat (limited to 'system/page')
-rw-r--r--system/page/list.php5
-rw-r--r--system/page/main.php13
2 files changed, 10 insertions, 8 deletions
diff --git a/system/page/list.php b/system/page/list.php
index 5d07d30..7c3956e 100644
--- a/system/page/list.php
+++ b/system/page/list.php
@@ -1,8 +1,9 @@
<?php
#===============================================================================
-# INCLUDE: Main configuration
+# Get instances
#===============================================================================
-require_once '../../core/application.php';
+$Database = Application::getDatabase();
+$Language = Application::getLanguage();
$site_size = Application::get('PAGE.LIST_SIZE');
$site_sort = Application::get('PAGE.LIST_SORT');
diff --git a/system/page/main.php b/system/page/main.php
index cf723d2..88652fd 100644
--- a/system/page/main.php
+++ b/system/page/main.php
@@ -1,19 +1,20 @@
<?php
#===============================================================================
-# INCLUDE: Main configuration
+# Get instances
#===============================================================================
-require_once '../../core/application.php';
+$Database = Application::getDatabase();
+$Language = Application::getLanguage();
#===============================================================================
# TRY: Page\Exception, User\Exception
#===============================================================================
try {
if(Application::get('PAGE.SLUG_URLS')) {
- $Page = Page\Factory::buildBySlug(HTTP::GET('param'));
+ $Page = Page\Factory::buildBySlug($param);
}
else {
- $Page = Page\Factory::build(HTTP::GET('param'));
+ $Page = Page\Factory::build($param);
}
$User = User\Factory::build($Page->attr('user'));
@@ -68,9 +69,9 @@ try {
catch(Page\Exception $Exception) {
try {
if(Application::get('PAGE.SLUG_URLS') === FALSE) {
- $Page = Page\Factory::buildBySlug(HTTP::GET('param'));
+ $Page = Page\Factory::buildBySlug($param);
} else {
- $Page = Page\Factory::build(HTTP::GET('param'));
+ $Page = Page\Factory::build($param);
}
HTTP::redirect($Page->getURL());