BTW, I had a thought about that, and all can see in the code todos, I
placed @todo wherever aiki is spewing out comments in output.
http://www.aikiframework.org/doc/todolist.html
I think we should only print out /* comments in css */ and <!-- widget
comments --> if the debug config option is set.
For one, it makes pages bigger, and two, most people don't need this.
What do you guys think?
Keep the great commits coming roger! Awesome!
---------- Forwarded message ----------
From: <[email protected]>
Date: Thu, Jun 23, 2011 at 4:12 PM
Subject: [Branch ~aikiframework-devel/aikiframework/trunk] Rev 867:
fixed generated comment for each widget in style.php
To: rejon <[email protected]>
------------------------------------------------------------
revno: 867
committer: Roger Martin <[email protected]>
branch nick: aikiframework
timestamp: Thu 2011-06-23 23:11:27 +0200
message:
fixed generated comment for each widget in style.php
modified:
src/style.php
--
lp:aikiframework
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk
You are subscribed to branch lp:aikiframework.
To unsubscribe from this branch go to
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk/+edit-subscription
=== modified file 'src/style.php'
--- src/style.php 2011-06-11 06:26:38 +0000
+++ src/style.php 2011-06-23 21:11:27 +0000
@@ -35,31 +35,34 @@
* @global string $site
* @todo the site var looks useless here, should trace and remove
*/
-$site = addslashes($_GET['site']);
+$site = isset($_GET['site']) ? addslashes($_GET['site']) : 'default';
/**
* @global string $widgets
*/
-$widgets = addslashes($_GET['widgets']);
-
-if (!$site)
- $site = "default";
-
-if (isset($widgets) and $widgets != '')
-{
- $widgets = str_replace('_', "' or id = '", $widgets);
-
- $get_widgets_css = $db->get_results("SELECT css, widget_name from " .
- "aiki_widgets where id = '$widgets' and is_active = 1 order by id");
-
- if ($get_widgets_css)
+$widgets_list = isset($_GET['widgets']) ? addslashes($_GET['widgets']) : '';
+
+
+
+if ( $widgets_list != ''){
+
+ $where = "id='" . str_replace('_', "' or id = '", $widgets_list). "'";
+ $sql =
+ "SELECT id, css, widget_name" .
+ " FROM aiki_widgets".
+ " WHERE " . $where .
+ " AND is_active = 1".
+ " ORDER BY id";
+ $get_widgets = $db->get_results($sql);
+
+ if ($get_widgets)
{
- foreach ( $get_widgets_css as $widget_css )
+ foreach ( $get_widgets as $widget )
{
/**
* @todo need to be able to disable all output, if not in debug
*/
- echo "\n/*Css for the widget $widgets -
$widget_css->widget_name */\n";
- echo
stripcslashes($aiki->languages->L10n($widget_css->css));
+ echo "\n/*CSS for the widget
{$widget->widget_name}({$widget->id}) */\n";
+ echo
stripcslashes($aiki->languages->L10n($widget->css));
}
}
}
--
Jon Phillips
http://rejon.org/ | http://fabricatorz.com/
chat/skype: kidproto | irc: rejon
+1.415.830.3884 (global) | +1-510-499-0894 (sf)
+86-187-1003-9974 (beijing)
=== modified file 'src/style.php'
--- src/style.php 2011-06-11 06:26:38 +0000
+++ src/style.php 2011-06-23 21:11:27 +0000
@@ -35,31 +35,34 @@
* @global string $site
* @todo the site var looks useless here, should trace and remove
*/
-$site = addslashes($_GET['site']);
+$site = isset($_GET['site']) ? addslashes($_GET['site']) : 'default';
/**
* @global string $widgets
*/
-$widgets = addslashes($_GET['widgets']);
-
-if (!$site)
- $site = "default";
-
-if (isset($widgets) and $widgets != '')
-{
- $widgets = str_replace('_', "' or id = '", $widgets);
-
- $get_widgets_css = $db->get_results("SELECT css, widget_name from " .
- "aiki_widgets where id = '$widgets' and is_active = 1 order by id");
-
- if ($get_widgets_css)
+$widgets_list = isset($_GET['widgets']) ? addslashes($_GET['widgets']) : '';
+
+
+
+if ( $widgets_list != ''){
+
+ $where = "id='" . str_replace('_', "' or id = '", $widgets_list). "'";
+ $sql =
+ "SELECT id, css, widget_name" .
+ " FROM aiki_widgets".
+ " WHERE " . $where .
+ " AND is_active = 1".
+ " ORDER BY id";
+ $get_widgets = $db->get_results($sql);
+
+ if ($get_widgets)
{
- foreach ( $get_widgets_css as $widget_css )
+ foreach ( $get_widgets as $widget )
{
/**
* @todo need to be able to disable all output, if not in debug
*/
- echo "\n/*Css for the widget $widgets - $widget_css->widget_name */\n";
- echo stripcslashes($aiki->languages->L10n($widget_css->css));
+ echo "\n/*CSS for the widget {$widget->widget_name}({$widget->id}) */\n";
+ echo stripcslashes($aiki->languages->L10n($widget->css));
}
}
}
_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help : https://help.launchpad.net/ListHelp