Le 15/10/2013 19:45, Franck Villaume a écrit :
Le 15/10/2013 19:44, Marc-Etienne Vargenau a écrit :Le 15/10/2013 19:37, Franck Villaume a écrit :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: 18236Modified: 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 ?Hello Frank, At the beginning, the string was "Document-Manager" (with an hyphen). I replaced the hyphen with a space and translated the string with gettext. After that, the link no longer worked because the anchor contained a space. So this is a fix so that it always works, even if the translation contains a space. If you have a better solution, let us know. Best regards, Marc-EtienneOk, I'll take a look to improve the solution. Regards. Franck
426c8d9fe5f094296a7507b9ac99133aaba3e67b I still wonder why moving from hyphen to underscore. 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
