You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by ch...@apache.org on 2009/02/15 20:56:04 UTC

svn commit: r744734 - /incubator/shindig/trunk/php/src/gadgets/render/GadgetHtmlRenderer.php

Author: chabotc
Date: Sun Feb 15 19:56:04 2009
New Revision: 744734

URL: http://svn.apache.org/viewvc?rev=744734&view=rev
Log:
Fix a warning when forcedJsLibs was empty

Modified:
    incubator/shindig/trunk/php/src/gadgets/render/GadgetHtmlRenderer.php

Modified: incubator/shindig/trunk/php/src/gadgets/render/GadgetHtmlRenderer.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/render/GadgetHtmlRenderer.php?rev=744734&r1=744733&r2=744734&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/gadgets/render/GadgetHtmlRenderer.php (original)
+++ incubator/shindig/trunk/php/src/gadgets/render/GadgetHtmlRenderer.php Sun Feb 15 19:56:04 2009
@@ -1,5 +1,4 @@
 <?php
-
 /**
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -56,12 +55,13 @@
     }
     $content .= "<script>\n";
     foreach ($gadget->features as $feature) {
-      if (! count($forcedJsLibs) || ! in_array($feature, $forcedJsLibs)) {
+      if (! is_array($forcedJsLibs) || (is_array($forcedJsLibs) && ! in_array($feature, $forcedJsLibs))) {
         $content .= $this->context->getRegistry()->getFeatureContent($feature, $this->context, true);
       }
     }
 
     // Add the JavaScript initialization strings for the configuration, localization and preloads
+    $content .= "\n";
     $content .= $this->appendJsConfig($gadget, count($forcedJsLibs));
     $content .= $this->appendMessages($gadget);
     $content .= $this->appendPreloads($gadget);