Le 15/10/2013 19:04, Marc-Etienne VARGENAU a écrit :
Author: vargenau
Date: 2013-10-15 19:04:01 +0200 (Tue, 15 Oct 2013)
New Revision: 18236

Modified:
    trunk/src/common/widget/WidgetLayoutManager.class.php
    trunk/src/www/widgets/updatelayout.php
Log:
Replace spaces with underscores in getCategory

Modified: trunk/src/common/widget/WidgetLayoutManager.class.php
===================================================================
--- trunk/src/common/widget/WidgetLayoutManager.class.php       2013-10-15 
17:00:46 UTC (rev 18235)
+++ trunk/src/common/widget/WidgetLayoutManager.class.php       2013-10-15 
17:04:01 UTC (rev 18236)
@@ -592,7 +592,8 @@
                foreach($widgets as $widget_name) {
                        if ($widget = Widget::getInstance($widget_name)) {
                                if ($widget->isAvailable()) {
-                                       $cs = explode(',', 
$widget->getCategory());
+                                       $category = str_replace(' ', '_', 
$widget->getCategory());
+                                       $cs = explode(',', $category);
                                        foreach($cs as $c) {
                                                if ($c = trim($c)) {
                                                        if (!isset($categ[$c])) 
{

Modified: trunk/src/www/widgets/updatelayout.php
===================================================================
--- trunk/src/www/widgets/updatelayout.php      2013-10-15 17:00:46 UTC (rev 
18235)
+++ trunk/src/www/widgets/updatelayout.php      2013-10-15 17:04:01 UTC (rev 
18236)
@@ -87,7 +87,8 @@
                                                                                
break;
                                                                        case 
'add':
                                                                        default:
-                                                                               
$redirect ='/widgets/widgets.php?owner='. $owner_type.$owner_id.'&layout_id='. 
$layout_id.'#filter-widget-categ-'.$widget->getCategory();
+                                                                               
$category = str_replace(' ', '_', $widget->getCategory());
+                                                                               
$redirect ='/widgets/widgets.php?owner='. $owner_type.$owner_id.'&layout_id='. 
$layout_id.'#filter-widget-categ-'.$category;
                                                                                
$lm->addWidget($owner_id, $owner_type, $layout_id, $name, $widget, $request);
                                                                                
break;
                                                                }



This commit is probably incomplete. Or am I missing something ?
Now, the listed categories in "Add Widgets" page are using "underscore" in the displayed name (i.e: Documents Manager is now : Documents_Manager).

What was your purpose here ? Make it cleaner in the code or unreadable for common user ?

Regards.
Franck

--
TrivialDev Founder
http://trivialdev.com

<<attachment: franck_villaume.vcf>>

_______________________________________________
Fusionforge-general mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-general

Reply via email to