[dev] patch for sunrise.php block

Rick Emery rick at emery.homelinux.net
Sat Jul 19 18:41:27 PDT 2003


On 07/06, Mike Cochrane committed a change to jonah/lib/Block/sunrise.php to
"Show the location name in the title of the block". I thought this was a great
idea, but later realized that, because of my location (Orlando, Orlando
International Airport), it made the column containing that block at least twice
as wide as necessary.

I offer the following patch, which displays the location inside the block so
that it wraps instead of widening the block. I'd like to take a screen shot,
but don't know how. The patch put's the location below the title using the
"control" class. This is just like the words "Quick Search" in the turba
minisearch block.

Thanks for your consideration,
Rick
-------------- next part --------------
Index: sunrise.php
===================================================================
RCS file: /repository/jonah/lib/Block/sunrise.php,v
retrieving revision 1.7
diff -r1.7 sunrise.php
25,38d24
<         $location = '';
<         global $geo_locations;
<         if (!is_array($geo_locations)) {
<             require JONAH_BASE . '/config/geolocations.php';
<         }
<         foreach($geo_locations as $country) {
<             if (array_key_exists($this->_params['location'], $country)) {
<                 $location = $country[$this->_params['location']];
<                 break;
<             }
<         }
<         if (!empty($location)) {
<             $title .= ': ' . $location;
<         }
54a41,52
>         $location = '';
>         global $geo_locations;
>         if (!is_array($geo_locations)) {
>             require JONAH_BASE . '/config/geolocations.php';
>         }
>         foreach($geo_locations as $country) {
>             if (array_key_exists($this->_params['location'], $country)) {
>                 $location = $country[$this->_params['location']];
>                 break;
>             }
>         }
> 
55a54
>         $html .= '<td colspan="2" class="control"><b>' . $location . '</b></td></tr><tr>';


More information about the dev mailing list