------------------------------------------------------------
revno: 1083
committer: Roger Martin <[email protected]>
branch nick: aikiframework
timestamp: Sat 2012-02-11 18:05:59 +0100
message:
aiki accept multiple engines
modified:
index.php
--
lp:aikiframework
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk
Your team Aiki Framework Developers is subscribed to branch lp:aikiframework.
To unsubscribe from this branch go to
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk/+edit-subscription
=== modified file 'index.php'
--- index.php 2012-02-09 20:35:59 +0000
+++ index.php 2012-02-11 17:05:59 +0000
@@ -45,39 +45,58 @@
*/
$html_cache_file = $aiki->Output->cache_file();
-/**
- * @see widgets.php
- */
-require_once("libs/widgets.php");
-$layout = new CreateLayout();
-
-$noheaders = false;
-$nogui = false;
-if (isset($global_widget) or isset($_REQUEST['noheaders'])) {
- $noheaders = true;
- $nogui = true;
-}
-
-
-if ($layout->widget_custom_output) {
- $noheaders = true;
-}
-
-if ($noheaders) {
- $html_output = $layout->html_output;
-} else {
- $html_output = $aiki->Output->headers();
-
- $layout->html_output = str_replace(
- '[page_title]',
- $aiki->Output->get_title(),
- $layout->html_output);
-
- $html_output .= $layout->html_output;
- $html_output .= $aiki->Output->footer();
-}
-
-$html_output = $aiki->languages->L10n($html_output);
+
+$engineType = config("engine","aiki");
+
+if ( $engineType =="aiki" ){
+
+ /**
+ * @see widgets.php
+ */
+ require_once("libs/widgets.php");
+
+ require_once("libs/widgets.php");
+ $layout = new CreateLayout();
+
+ $noheaders = false;
+ $nogui = false;
+ if (isset($global_widget) or isset($_REQUEST['noheaders'])) {
+ $noheaders = true;
+ $nogui = true;
+ }
+
+ if ($layout->widget_custom_output) {
+ $noheaders = true;
+ }
+
+ if ($noheaders) {
+ $html_output = $layout->html_output;
+ } else {
+ $html_output = $aiki->Output->headers();
+
+ $layout->html_output = str_replace(
+ '[page_title]',
+ $aiki->Output->get_title(),
+ $layout->html_output);
+
+ $html_output .= $layout->html_output;
+ $html_output .= $aiki->Output->footer();
+ }
+
+ $html_output = $aiki->languages->L10n($html_output);
+
+} elseif ( file_exists( "$AIKI_ROOT_DIR/libs/Engine_$engineType.php") ) {
+ include "$AIKI_ROOT_DIR/libs/Engine_$engineType.php";
+ $engineClass= "engine_" . $engineType;
+ $engine = new $engineClass();
+ $html_output = $engine->layout();
+
+} else {
+ $html_output = "<p>".
+ t( sprintf('Unkown engine %1$s. File /libs/Engine_%1$s.php doesn\'t exists.',$engineType)).
+ "</p>";
+}
+
/**
* Tidy html using libtidy, or output compressed output, or just output.
@@ -109,6 +128,8 @@
} // end of using tidy
+
+
if ($html_cache_file) {
//write the cache file
error_log($html_output, 3, $html_cache_file);
_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help : https://help.launchpad.net/ListHelp