public function icalTags() { static $today = 0; static $contact = null; if (empty($today)) { $today = time(); $contact = PHPWS_Settings::get('users', 'site_contact'); } $tpl['BEGINEVENT'] = "\n"; $tpl['ENDEVENT'] = "\n"; $tpl['TODAY'] = PHPWS_Time::getDTTime($today); $tpl['EMAIL'] = $contact; $tpl['UID'] = sprintf('%s-%s.%s', $this->_schedule->title, $this->_schedule->id, $this->id); $tpl['SUMMARY'] = $this->summary; if (!empty($this->location)) { if (!empty($this->loc_link)) { $tpl['LOCATION'] = $this->loc_link . " " . $this->location; } else { $tpl['LOCATION'] = $this->location; } } $description = strip_tags(str_ireplace('', '', $this->getDescription())); $description = preg_replace(array('/^\\s\\s+/', '/\\s\\s+$/', '/\\s\\s+/u'), array('', '', ' '), $description); if (!empty($description)) { $tpl['DESCRIPTION'] =& $description; } if ($this->all_day) { $tpl['DTSTART_AD'] = PHPWS_Time::getDTTime($this->start_time, 'all_day'); $tpl['DTEND_AD'] = PHPWS_Time::getDTTime($this->end_time, 'all_day'); } else { $tpl['DTSTART'] = PHPWS_Time::getDTTime($this->start_time); $tpl['DTEND'] = PHPWS_Time::getDTTime($this->end_time); } return $tpl; }
public function brief_view() { $template['TITLE'] = $this->title; $template['LOCAL_DATE'] = $this->getPublishDate(); $template['PUBLISHED_DATE'] = PHPWS_Time::getDTTime($this->publish_date); $template['SUMMARY'] = PHPWS_Text::parseTag($this->getSummary(true)); $template['ENTRY'] = PHPWS_Text::parseTag($this->getEntry(true)); $template['IMAGE'] = $this->getFile($this->thumbnail); $template['POSTED_BY'] = dgettext('blog', 'Posted by'); $template['POSTED_ON'] = dgettext('blog', 'Posted at'); $template['PUBLISHED'] = dgettext('blog', 'Published'); if ($this->author_id) { $template['AUTHOR'] = $this->author; } else { $template['AUTHOR'] = dgettext('blog', 'Anonymous'); } return PHPWS_Template::process($template, 'blog', 'view_full.tpl'); }