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: 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 ?

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-Etienne

--
Marc-Etienne Vargenau [email protected]
Alcatel-Lucent France, Route de Villejust, 91620 NOZAY, FRANCE
+33 1 30 77 28 33 OnNet 2103 2833


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

Reply via email to