[dev] weatherdotcom portal block issues

Rick Emery rick at emery.homelinux.net
Wed Feb 4 08:39:03 PST 2004


Quoting Rick Emery <rick at emery.homelinux.net>:

> Quoting Joe Jenkins <joe at nerdnet.com>:
>
>> A couple of things with this block that might be of interest:
>>
>> In order for it to show up in the Portal Editor, you need to have it defined
>> in the registry.php file under the horde config:
>
> You're right; it looks like the patch didn't get applied. I'll resubmit it.
>

Here's a patch to registry.php.dist that adds the weather.com block.

Also, I'd been pondering for some time how to keep from allowing the user to
select weather blocks if the pear Services_Weather package is not installed.
Included in the patch is my attempt to accomplish that; I doubt it's the best
way, but it worked on my install.

As always, feedback is expected and graciously accepted.
Thanks in advance,
Rick

--
Rick Emery

"When once you have tasted flight, you will forever walk the Earth
 with your eyes turned skyward, for there you have been, and there
 you will always long to return"
                                              -- Leonardo Da Vinci
-------------- next part --------------
Index: registry.php.dist
===================================================================
RCS file: /repository/horde/config/registry.php.dist,v
retrieving revision 1.208
diff -u -r1.208 registry.php.dist
--- registry.php.dist	27 Jan 2004 21:57:37 -0000	1.208
+++ registry.php.dist	4 Feb 2004 16:01:04 -0000
@@ -590,6 +590,13 @@
     'name' => _("Moon Phases"),
 );
 
-$this->applets['metar'] = array(
-    'name' => _("Metar Weather"),
-);
+$result = @include_once 'Services/Weather.php';
+if ($result) {
+    $this->applets['metar'] = array(
+        'name' => _("Metar Weather"),
+    );
+
+    $this->applets['weatherdotcom'] = array(
+        'name' => _("weather.com"),
+    );
+}


More information about the dev mailing list