[dev] Weather block; need advice/help

Rick Emery rick at emery.homelinux.net
Mon Jan 12 05:58:34 PST 2004


I'm working on the weather.com block, and need some help from more experienced
horde/php developers.

The pear Services_Weather module searches for the location ID by receiving a
location string (for example, "Sanford, FL") and querying the web service. It
returns either a) a pear error if the location isn't found, b) a string
containing the ID of the location, or c) an array of possible matches.

I'm having trouble figuring out how to accomplish this in the getParams()
function. It can receive the location in a text box, but how could it check
and handle the return value? It could become very annoying to do it in the
_content() funtion. Imagine: the user goes into the portal layout, selects
weather for the block, types a location and clicks save. The user then goes to
the portal page, sees a message that the location doesn't exist, or that there
were multiple matches, and has to go back into the layout to edit the block,
typing a new location until finding the correct one.

It would be great if there were a way to query Services_Weather with the
location, evaluate the return, and present appropriate feedback to the user
while still inside the layout.

Any ideas/recommendations?
Thanks in advance!

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



More information about the dev mailing list