------------------------------------------------------------
revno: 1047
committer: Jon Phillips <rejon@gandi0>
branch nick: htdocs
timestamp: Thu 2012-01-26 06:04:38 +0100
message:
  * Fixed some old misspellings that old aiki sites have in them which crashes
    old sites. Should be useful for updating openclipart
  
  * also made it so there is no comment output if NOT in debug mode, which
    makes bloated pages. Now have to turn config["debug"] = true; to get 
    comments in the code for widget ids and where records start
modified:
  assets/images/favicon.ico
  libs/Output.php
  libs/widgets.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 'assets/images/favicon.ico'
Binary files assets/images/favicon.ico	2012-01-19 08:01:17 +0000 and assets/images/favicon.ico	2012-01-26 05:04:38 +0000 differ
=== modified file 'libs/Output.php'
--- libs/Output.php	2012-01-25 06:58:05 +0000
+++ libs/Output.php	2012-01-26 05:04:38 +0000
@@ -260,7 +260,7 @@
 	 * @param     integer  $columns     number of columns
 	 * @return    string
 	 *
-	 * @todo remove hardcoded html
+	 * @todo remove hardcoded html. NOTE, this relies upon debug-time only opt.
 	 */
 	public function displayInTable($widget, $columns) {
 		$widgetTabled = "<table width='100%'>";

=== modified file 'libs/widgets.php'
--- libs/widgets.php	2012-01-22 19:46:09 +0000
+++ libs/widgets.php	2012-01-26 05:04:38 +0000
@@ -143,11 +143,12 @@
 	 * @global aiki   $aiki glboal aiki object
 	 * @global string $url 
 	 * @global string $custom_output
+     * @global array  $config configs the old way
 	 *
 	 * @todo this all need to be broken down into helper functions, too big!
 	 */
 	private function createWidget($widget_group) {
-		global $db, $aiki, $custom_output;
+		global $db, $aiki, $custom_output, $config;
 
 		/**
 		 * Daddy this is where widgets come from...
@@ -179,12 +180,17 @@
 			if ($widget->css) {
 				$this->widgets_css[]= $widget->id ;
 			}	
+			if ( isset($widget->custome_output) )
+                            $widget->custom_output = $widget->custome_output;
 
 			if ($widget->custom_output) {
 				$custom_output = true;
 				$this->widget_custom_output = true;
 			}
 
+                        if ( isset($widget->custome_header) )
+                            $widget->custom_header = $widget->custome_header;
+
 			if ( $widget->custom_header && $widget->custom_header != '' ) {
 				$custom_headers = explode("\n", $widget->custom_header);
 				foreach ($custom_headers as $custom_header) {
@@ -193,17 +199,13 @@
 					}
 				}
 			}
-			/**
-			 * @todo all output of comments needs to be an option, since
-			 *		 it makes output pages bigger by default.
-			 *		 Should only turn on for debug mode IMO.
-			 */
-			
-			
-			
-			if (!$custom_output) {
-				$this->widget_html .=
+			
+			if (!$custom_output)
+            {
+                if ( isset($config["debug"]) and $config["debug"] ) {
+				    $this->widget_html .=
 					"\n <!--start {$widget->widget_name}({$widget->id})--> \n";
+                }
 				
 				if ( $widget->widget_type &&
 					$widget->remove_container != 1 ) {
@@ -246,13 +248,10 @@
 					$this->widget_html .= "\n</$widget->widget_type>\n";
 				}
 				
-				/**
-				 * @todo all output of comments needs to be an option, since
-				 *		 it makes output pages bigger by default.
-				 *		 Should only turn on for debug mode IMO.
-				 */
-				$this->widget_html .=
-					"\n <!--{$widget->widget_name}({$widget->id}) end--> \n";
+                if ( (isset($config["debug"]) and $config["debug"]) ) {
+				    $this->widget_html .=
+					   "\n <!--{$widget->widget_name}({$widget->id}) end--> \n";
+                }
 			}
 			
 
@@ -279,6 +278,7 @@
 
 			switch ($widget->widget_target){
 				case "body": 
+				    error_log ( $this->widget_target, 0);
 					$this->html_output .= $this->widget_html;
 					break;
 				case "header": 
@@ -448,14 +448,19 @@
 					/**
 					 * @todo put this behind debug time option
 					 */
-					if (!$custom_output) {
+					if (!$custom_output and 
+                        ( isset($config["debug"]) and $config["debug"] ) ) 
+                    {
 						$widgetContents .= 
 							"\n<!-- The Beginning of a Record -->\n";
 					}
 					$widgetContents .=  $this->parse_widget_with_data(
 						$template,
 						$widget_value);
-					if (!$custom_output) {
+
+					if (!$custom_output and
+                        ( isset($config["debug"]) and $config["debug"] ) ) 
+                    {
 						$widgetContents .= 
 							"\n<!-- The End of a Record -->\n";
 					}

_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to     : aikiframework-devel@lists.launchpad.net
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help   : https://help.launchpad.net/ListHelp

Reply via email to