------------------------------------------------------------
revno: 1198
committer: Roger Martin <[email protected]>
branch nick: aikiframework
timestamp: Wed 2012-05-09 21:06:20 +0200
message:
move aiki engine correction to aiki engine
modified:
index.php
libs/Engine_aiki.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-05-08 22:00:36 +0000
+++ index.php 2012-05-09 19:06:20 +0000
@@ -57,18 +57,9 @@
$engineClass= "Engine_" . $engineType;
$engine = new $engineClass();
- $html_output = $engine->render($aiki->site->engine_parameters());
-
+ $html_output = $engine->render($aiki->site->engine_parameters());
$custom_output = isset($_REQUEST["noheaders"]) || $engine->widget_custom_output;
- // corrections for old aiki engine
- // @TODO, someday, this will be deleted.
- if ( $engineType == "aiki" ){
- if ( !$custom_output ) {
- $html_output = str_replace( '[page_title]', $aiki->Output->get_title(), $html_output);
- }
- $html_output = $aiki->languages->L10n($html_output);
- }
-
+
} else {
// engine is no valid
$html_output =
=== modified file 'libs/Engine_aiki.php'
--- libs/Engine_aiki.php 2012-05-08 21:34:14 +0000
+++ libs/Engine_aiki.php 2012-05-09 19:06:20 +0000
@@ -84,10 +84,17 @@
"body"=>"" ,
"header"=>"",
"css"=>array() );
-
+
$aiki->widgets->render_site($this);
- return $aiki->Output->render_output($this);
-
+ $html_output = $aiki->Output->render_output($this);
+
+ // corrections for old aiki engine
+ // @TODO, someday, this will be deleted.
+ if ( isset($_REQUEST["noheaders"]) || $this->widget_custom_output ) {
+ $html_output = str_replace( '[page_title]', $aiki->Output->get_title(), $html_output);
+ }
+ $html_output = $aiki->languages->L10n($html_output);
+ return $html_output;
}
@@ -105,7 +112,7 @@
*/
function parseWidget($widget) {
global $aiki, $custom_output ;
-
+
// fix custome_.. to custom_..
if (!isset($widget->custom_output)) {
$widget->custom_output = $widget->custome_output;
@@ -126,28 +133,28 @@
}
}
}
-
+
// creat widget content.
- $content = $this->createWidgetContent($widget);
+ $content = $this->createWidgetContent($widget);
if ($content === false ) {
- if ($widget->if_no_results) {
+ if ($widget->if_no_results) {
$content = $this->parse_no_results($widget->if_no_results) ;
} else {
return "";
- }
+ }
}
-
+
if ($custom_output) {
return $content;
} else {
$start = $end = $tag = $endTag = "";
- if ( is_debug_on() ){
+ if ( is_debug_on() ){
$start = "\n <!--start {$widget->widget_name}({$widget->id})--> \n";
$end = "\n <!--end {$widget->widget_name}({$widget->id})--> \n";
- }
+ }
if ( $widget->widget_type && $widget->remove_container != 1 ) {
$tag =
- "<$widget->widget_type id=\"$widget->widget_name\" ".
+ "<$widget->widget_type id=\"$widget->widget_name\" ".
( $widget->style_id ? " class=\"$widget->style_id\" ": "" ).
">\n";
$endTag = "\n</{$widget->widget_type}>";
@@ -179,7 +186,7 @@
*/
-
+
private function createWidgetContent($widget, $normal_select=false) {
global $aiki, $db, $membership, $nogui, $custom_output, $config;
@@ -359,7 +366,7 @@
$this->parsDBpars($no_loop_part, $widget_value).
$widgetContents.
$this->parsDBpars($no_loop_bottom_part, $widget_value);
-
+
// insert pagination.
if ((isset($pagination) || $pagination != false) &&
strpos($widgetContents, "[no_pagination]") === false) {
@@ -503,8 +510,8 @@
$aiki->processVars($widget->if_no_results);
return $widget->if_no_results;
//return stripslashes($widget->if_no_results);
- }
- }
+ }
+ }
return $processed_widget;
} // end of createWidgetContent()
@@ -772,7 +779,7 @@
return $template;
}
-
+
@@ -795,7 +802,7 @@
}
// isset on NULL value return false need to check keys
$keys = array_keys(get_object_vars($widget_value));
-
+
foreach ($matches['1'] as $parsed) {
if ($parsed) {
$is_array = $aiki->get_string_between($parsed, "[", "]");
@@ -847,7 +854,7 @@
}
}
-
+
if (!isset($widget_value->$parsed) and
isset($this->global_values->$parsed)) {
$widget_value->$parsed = $this->global_values->$parsed;
@@ -855,7 +862,7 @@
if (in_array($parsed, $keys)) {
//if (isset($widget_value->$parsed)) {
-
+
$widget_value->$parsed =
$aiki->security->remove_markup($widget_value->$parsed);
// If there are results and the results are not from cache
@@ -863,9 +870,9 @@
if ( $widget_value->$parsed and !$cached_values ) {
$this->global_values->$parsed = $widget_value->$parsed;
}
-
+
$text = str_replace(
- "(($parsed))",
+ "(($parsed))",
$widget_value->$parsed,
$text);
}
@@ -977,7 +984,7 @@
if ($inline_select) {
$select = trim($inline_select);
- }
+ }
// Kill the query if it is not select.
// roger: this filter is not aplied over $inline_select
@@ -1042,14 +1049,14 @@
* @return string Output widget.
*
*/
-
- private function inline_widgets($widget){
+
+ private function inline_widgets($widget){
return preg_replace_callback (
'/\(\#\(widget\:(.*)\)\#\)/Us',
array( $this, "inline_widgets_helper"),
$widget);
}
-
+
private function inline_widgets_helper($match){
return "";
return $this->parseWidget($match[1]);
@@ -1067,21 +1074,21 @@
private function inherent_widgets($widget) {
global $db, $aiki;
- // Fix a typo that was in the first version inherit was called inherent.
-
+ // Fix a typo that was in the first version inherit was called inherent.
+
$widget = str_replace("(#(inherit", "(#(inherent", $widget);
if (preg_match_all('/\(\#\(inherent\:(.*)\)\#\)/Us', $widget, $matches)) {
-
+
foreach ($matches['1'] as $i=>$widget_info) {
$widget_para = explode("|", $widget_info);
$widget_data = $aiki->widgets->get_widget($widget_para[0]);
-
+
if ( is_null( $widget_data ) ) {
- $widget_html = is_debug_on() ?
+ $widget_html = is_debug_on() ?
sprintf( t("Widget %s doesn't exist"), $widget_para[0]):
"" ;
- } else {
+ } else {
// widget css is added
if ( trim($widget_data->css) ) {
$this->target["css"][$widget_data->id]=true ;
@@ -1094,7 +1101,7 @@
}
}
-
+
return $widget;
} // end of inherent_widgets function
@@ -1116,8 +1123,8 @@
if (!preg_match('/^select(.*) from /Usi', $sql, $select)){
if ( preg_match('/^select (.*) /Usi',$sql) ) {
return 1;
- }
- return false;
+ }
+ return false;
}
if (stripos($sql, " GROUP BY ") || stripos($sql, " LIMIT")) {
_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help : https://help.launchpad.net/ListHelp