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:55:28 UTC
svn commit: r744733 - /incubator/shindig/trunk/php/src/gadgets/Gadget.php
Author: chabotc
Date: Sun Feb 15 19:55:28 2009
New Revision: 744733
URL: http://svn.apache.org/viewvc?rev=744733&view=rev
Log:
Default to the empty view name if no matching or default view is found
Modified:
incubator/shindig/trunk/php/src/gadgets/Gadget.php
Modified: incubator/shindig/trunk/php/src/gadgets/Gadget.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/Gadget.php?rev=744733&r1=744732&r2=744733&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/gadgets/Gadget.php (original)
+++ incubator/shindig/trunk/php/src/gadgets/Gadget.php Sun Feb 15 19:55:28 2009
@@ -38,6 +38,13 @@
return $this->gadgetSpec->views[$viewName];
} elseif (isset($this->gadgetSpec->views[self::DEFAULT_VIEW])) {
return $this->gadgetSpec->views[self::DEFAULT_VIEW];
+ } else {
+ // see if there's any empty entries, we'll use that as default then (old iGoogle style)
+ foreach ($this->gadgetSpec->views as $view) {
+ if (empty($view['view'])) {
+ return $view;
+ }
+ }
}
throw new GadgetException("Invalid view specified for this gadget");
}