[horde] Small modification to Upcoming Events block

Todd Aiken taiken at mvtech.ca
Tue Jan 5 20:10:08 UTC 2021


Greetings,

I am trying to make a small modification to the Horde portal's  
"Upcoming Events" block.  On my main portal page, I have several of  
them configured, with one showing "All Visible" calendars, and others  
only showing one specific calendar.  I'm trying to get the title of  
the specific calendar blocks to display the name of the calendar  
configured in the block settings.  So far I've patched the file  
horde/kronolith/lib/Block/Monthlist.php to display the calendar ID by  
changing the protected function _title() to the following:

     protected function _title()
     {
         $url = Horde::url($GLOBALS['registry']->getInitialPage(), true);
         if (isset($this->_params['calendar']) &&
             $this->_params['calendar'] != '__all') {
             $url->add('display_cal', $this->_params['calendar']);
             $title = $url->link() . _("Upcoming Events - " .  
$this->_params['calendar']) . '</a>';
         }
         else {
             $title = $url->link() . _("Upcoming Events") . '</a>';
         }
         return $title;
     }

Just wondering how the name of the calendar could be displayed instead  
of the ID?

Thanks in advance.





CU L8R...

Todd Aiken

"V8!  Return to base, immediately!"
   - The Last V8 as spoken on the Commodore 64

Even in the 21st century, HTML in email is
still like putting an air conditioner on a motorcycle.




More information about the horde mailing list