diff --git a/classes/Xodx/Application.php b/classes/Xodx/Application.php index 29f9aa4..fff13e6 100644 --- a/classes/Xodx/Application.php +++ b/classes/Xodx/Application.php @@ -19,7 +19,7 @@ public function run() { /** * Prepare Template */ - $this->_layout->setLayout('templates/layout.phtml'); + $this->_layout->setLayout('layout.phtml'); $request = $bootstrap->getResource('request'); @@ -47,18 +47,23 @@ public function run() { $this->_layout->username = $user->getName(); $this->_layout->notifications = $userController->getNotifications($user->getUri()); - $this->_layout->addDebug($bootstrap->getResource('logger')->getLastLog()); $config = $bootstrap->getResource('config'); - if (isset($config['debug']) && $config['debug'] == false) { - $this->_layout->disableDebug(); + if (!isset($config['debug']) || $config['debug'] == true) { + $debug = new Saft_Template( + 'debug.phtml', array('log' => $bootstrap->getResource('logger')->getLastLog()) + ); + $this->_layout->setPlaceholder('debug', $debug); } } catch (Exception $e) { - $this->_layout->setLayout('templates/errorlayout.phtml'); - $this->_layout->errorType = 'Application Error'; - $this->_layout->exception = $e; - $this->_layout->back = $this->getBaseUri(); - $this->_layout->addContent('templates/error.phtml'); + $this->_layout->setLayout('errorlayout.phtml'); + $options = array( + 'errorType' => 'Application Error', + 'exception' => $e, + 'back' => $this->getBaseUri() + ); + $errorPlaceholder = new Saft_Template('error.phtml', $options); + $this->_layout->setPlaceholder('error', $errorPlaceholder); } $this->_layout->render(); } diff --git a/classes/Xodx/FeedController.php b/classes/Xodx/FeedController.php index 5b895ea..0715a46 100644 --- a/classes/Xodx/FeedController.php +++ b/classes/Xodx/FeedController.php @@ -45,7 +45,7 @@ public function getFeedAction($template, $uri = null, $format = null) $nameHelper = new Xodx_NameHelper($this->_app); - $template->setLayout('templates/feed.phtml'); + $template->setLayout('feed.phtml'); $template->updated = $updated; $template->uri = $uri; $template->feedUri = $feedUri; diff --git a/libraries/Saft b/libraries/Saft index e135046..f181420 160000 --- a/libraries/Saft +++ b/libraries/Saft @@ -1 +1 @@ -Subproject commit e135046f0e80ecc3a730bf1488cd0b2ff26c904c +Subproject commit f1814209771c9daf2d4914a2259f7067bb65f59e diff --git a/templates/activity/addactivity.phtml b/templates/activity/addactivity.phtml new file mode 100644 index 0000000..491ff92 --- /dev/null +++ b/templates/activity/addactivity.phtml @@ -0,0 +1,2 @@ +

New Activity

+A new activity has been created diff --git a/templates/reply.phtml b/templates/activity/reply.phtml similarity index 100% rename from templates/reply.phtml rename to templates/activity/reply.phtml diff --git a/templates/login.phtml b/templates/application/login.phtml similarity index 100% rename from templates/login.phtml rename to templates/application/login.phtml diff --git a/templates/newuser.phtml b/templates/application/newuser.phtml similarity index 100% rename from templates/newuser.phtml rename to templates/application/newuser.phtml diff --git a/templates/debug.phtml b/templates/debug.phtml index 14e5fa6..8e9d9b1 100644 --- a/templates/debug.phtml +++ b/templates/debug.phtml @@ -1,5 +1,8 @@ -debugText)) { - echo $this->debugText; - } -?> +log)) : ?> +
+

Debuglog:

+
+    log ?>
+    
+
+ diff --git a/templates/errorlayout.phtml b/templates/errorlayout.phtml index cf8df43..d26334c 100644 --- a/templates/errorlayout.phtml +++ b/templates/errorlayout.phtml @@ -34,22 +34,11 @@
- _contentFiles as $contentFile) { - include $contentFile; - } - ?> -
- - _debug && !empty($this->_debugLog)) : ?> - -
-

Debuglog:

-
-_debugLog ?>
-        
+ placeholder('error'); ?>
+ has('debug')) : ?> + placeholder('debug'); ?> diff --git a/templates/layout.phtml b/templates/layout.phtml index ff0b4d8..d7b872f 100644 --- a/templates/layout.phtml +++ b/templates/layout.phtml @@ -31,7 +31,7 @@ Xodx partial( - 'templates/menu.phtml', + 'menu.phtml', array('username' => $this->username, 'notifications' => $this->notifications) ); ?> @@ -40,22 +40,11 @@
- _contentFiles as $contentFile) { - include $contentFile; - } - ?> -
- - _debug && !empty($this->_debugLog)) : ?> - -
-

Debuglog:

-
-_debugLog ?>
-        
+ placeholder('main.content'); ?>
+ has('debug')) : ?> + placeholder('debug'); ?> diff --git a/templates/newactivity.phtml b/templates/newactivity.phtml deleted file mode 100644 index 1956654..0000000 --- a/templates/newactivity.phtml +++ /dev/null @@ -1,7 +0,0 @@ -

New Activity

-feedUri . '">' . $this->feedUri . '' ?> -
-activity, true);
-?>
-
diff --git a/templates/menu.phtml b/templates/partials/menu.phtml similarity index 100% rename from templates/menu.phtml rename to templates/partials/menu.phtml diff --git a/templates/profileshow.phtml b/templates/person/show.phtml similarity index 98% rename from templates/profileshow.phtml rename to templates/person/show.phtml index 3558c3f..fdad4a5 100644 --- a/templates/profileshow.phtml +++ b/templates/person/show.phtml @@ -51,7 +51,7 @@
partial( - 'templates/partials/friendlist.phtml', + 'friendlist.phtml', array('personUri' => $this->profileshowPersonUri, 'knows' => $this->profileshowKnows, 'addFriend' => false) ); ?> diff --git a/templates/profilelist.phtml b/templates/profile/list.phtml similarity index 100% rename from templates/profilelist.phtml rename to templates/profile/list.phtml diff --git a/templates/resourceshow.phtml b/templates/resource/show.phtml similarity index 100% rename from templates/resourceshow.phtml rename to templates/resource/show.phtml diff --git a/templates/usershow.phtml b/templates/user/home.phtml similarity index 99% rename from templates/usershow.phtml rename to templates/user/home.phtml index 92ac1a0..ae2f7bf 100644 --- a/templates/usershow.phtml +++ b/templates/user/home.phtml @@ -93,7 +93,7 @@
partial( - 'templates/partials/friendlist.phtml', + 'friendlist.phtml', array('personUri' => $this->profileshowPersonUri, 'knows' => $this->profileshowKnows, 'addFriend' => true) ); ?>