Ejemplo n.º 1
0
 public function linkForItem(KurogoObject $post, $data = null)
 {
     $options = array('id' => $post->getID());
     foreach (array('feed', 'filter') as $field) {
         if (isset($data[$field])) {
             $options[$field] = $data[$field];
         }
     }
     $addBreadcrumb = isset($data['addBreadcrumb']) ? $data['addBreadcrumb'] : true;
     $noBreadcrumbs = isset($data['noBreadcrumbs']) ? $data['noBreadcrumbs'] : false;
     if ($noBreadcrumbs) {
         $url = $this->buildURL('detail', $options);
     } else {
         $url = $this->buildBreadcrumbURL('detail', $options, $addBreadcrumb);
     }
     $subtitle = $this->elapsedTime($post->getCreated()->format('U'));
     $author = false;
     if (isset($data['feed'])) {
         $subtitle = $this->feeds[$data['feed']]->getTitle() . ' ' . $subtitle;
         $author = $this->feeds[$data['feed']]->getUser($post->getAuthor());
     }
     $link = array('url' => $url, 'body' => $post->getBody(), 'title' => $post->getBody(), 'created' => $this->elapsedTime($post->getCreated()->format('U')), 'subtitle' => $this->elapsedTime($post->getCreated()->format('U')), 'sort' => $post->getCreated()->format('U'), 'class' => $post->getServiceName());
     if ($author) {
         $link['author'] = $author->getName();
         $link['img'] = $author->getImageURL();
     }
     return $link;
 }
Ejemplo n.º 2
0
 protected function linkForSchedule(KurogoObject $event, $data = null)
 {
     $subtitle = DateFormatter::formatDateRange($event->getRange(), DateFormatter::NO_STYLE, DateFormatter::SHORT_STYLE);
     $current = $this->getArg('time', time(), FILTER_VALIDATE_INT);
     $beginningOfDay = mktime(0, 0, 0, date('n', $current), date('j', $current));
     $endOfDay = mktime(23, 59, 59, date('n', $current), date('j', $current));
     $eventStart = $event->getStart();
     $eventEnd = $event->getEnd();
     if ($eventStart < $beginningOfDay) {
         // if starts more than one day before, put the date
         if ($eventStart < strtotime('-1 day', $beginningOfDay)) {
             $startDate = DateFormatter::formatDate($eventStart, DateFormatter::SHORT_STYLE, DateFormatter::NO_STYLE);
         } else {
             $startDate = $this->getLocalizedString('THE_PREVIOUS_DAY');
             //'the previous day'
         }
         $subtitle = $this->getLocalizedString('IF_STARTS_EARLIER_DATE', $startDate) . $subtitle;
     }
     if ($eventEnd > $endOfDay) {
         // if ends more than one day after, put the date
         if ($eventEnd > strtotime('+1 day', $endOfDay)) {
             $endDate = DateFormatter::formatDate($eventEnd, DateFormatter::SHORT_STYLE, DateFormatter::NO_STYLE);
         } else {
             $endDate = $this->getLocalizedString('THE_FOLLOWING_DAY');
             //'the following day'
         }
         $subtitle .= $this->getLocalizedString('IF_ENDS_LATER_DATE', $endDate);
     }
     $options = array('id' => $event->getID(), 'time' => $event->getStart());
     if (isset($data['section'])) {
         $options['section'] = $data['section'];
     }
     if (isset($data['groupID'])) {
         $options['groupID'] = $data['groupID'];
     }
     $class = '';
     if ($this->SHOW_EVENT_DETAILS) {
         $url = $this->buildBreadcrumbURL('schedule', $options, true);
     } else {
         $url = false;
     }
     if ($event->getRange()->contains(new TimeRange(time()))) {
         $class = 'open';
     } else {
         $class = 'closed';
     }
     return array('title' => $event->getTitle(), 'subtitle' => $subtitle, 'url' => $url, 'listclass' => $this->SHOW_HOURS_STATUS ? $class : null);
 }
Ejemplo n.º 3
0
 public function linkForItem(KurogoObject $video, $data = null)
 {
     $options = array('videoid' => $video->getID());
     foreach (array('section', 'filter') as $field) {
         if (isset($data[$field])) {
             $options[$field] = $data[$field];
         }
     }
     $addBreadcrumb = isset($data['addBreadcrumb']) ? $data['addBreadcrumb'] : true;
     $noBreadcrumbs = isset($data['noBreadcrumbs']) ? $data['noBreadcrumbs'] : false;
     if ($noBreadcrumbs) {
         $url = $this->buildURL('detail', $options);
     } else {
         $url = $this->buildBreadcrumbURL('detail', $options, $addBreadcrumb);
     }
     $desc = $video->getDescription();
     if (isset($data['federatedSearch']) && $data['federatedSearch']) {
         $subtitle = '';
     } else {
         $subtitle = "(" . VideoModuleUtils::getDuration($video->getDuration()) . ") " . $desc;
     }
     return array('url' => $url, 'title' => $video->getTitle(), 'subtitle' => $subtitle, 'imgWidth' => 120, 'imgHeight' => 100, 'img' => $video->getImage());
 }
Ejemplo n.º 4
0
 protected function getFiledDataForSchedule(KurogoObject $event)
 {
     return array('title' => $event->getTitle(), 'description' => $event->getDescription() ? $event->getDescription() : '', 'id' => $event->getID(), 'sport' => $event->getSport(), 'sportName' => $event->getSportName(), 'gender' => $event->getGender(), 'start' => $event->getStartTime(), 'pastStatus' => $event->getStartTime() > time() ? false : true, 'location' => $event->getLocation(), 'link' => $event->getLink(), 'allday' => $event->isAllDay());
 }
Ejemplo n.º 5
0
 public function linkForItem(KurogoObject $mapItem, $options = null)
 {
     $result = array('title' => $mapItem->getTitle(), 'subtitle' => $mapItem->getSubtitle());
     if ($mapItem instanceof Placemark) {
         $result['class'] = 'placemark';
         if ($mapItem instanceof BasePlacemark && ($url = $mapItem->getURL())) {
             // if url was set via setURL -- only applies to campus placemarks on worldmap
             $result['url'] = $url;
         } else {
             $urlArgs = $mapItem->getURLParams();
             $addBreadcrumb = $options && isset($options['addBreadcrumb']) && $options['addBreadcrumb'];
             $result['url'] = $this->buildBreadcrumbURL($this->pageForPlacemark($mapItem), $urlArgs, $addBreadcrumb);
         }
         if (($distance = $mapItem->getField('distance')) && $this->getOptionalModuleVar('SHOW_DISTANCES', true)) {
             $result['subtitle'] = $this->displayTextFromMeters($distance);
         }
     } else {
         $external = $options && isset($options['external']) && $options['external'];
         $feedId = $options && isset($options['feed']) ? $options['feed'] : null;
         $groupId = $options && isset($options['group']) ? $options['group'] : null;
         $category = implode(MAP_CATEGORY_DELIMITER, $mapItem->getIdStack());
         $result['url'] = $this->categoryURL($category, $feedId, $groupId, $external);
     }
     return $result;
 }
Ejemplo n.º 6
0
 public function linkForItem(KurogoObject $story, $data = null)
 {
     if ($pubDate = $story->getPubDate()) {
         $date = DateFormatter::formatDate($pubDate, DateFormatter::MEDIUM_STYLE, DateFormatter::NO_STYLE);
     } else {
         $date = "";
     }
     $image = $this->showImages ? $story->getImage() : false;
     $link = array('title' => $this->htmlEncodeFeedString($story->getTitle()), 'pubDate' => $date, 'author' => $this->htmlEncodeFeedString($story->getAuthor()), 'subtitle' => $this->htmlEncodeFeedString($story->getDescription()), 'img' => $image ? $image->getURL() : '');
     if ($storyID = $story->getGUID()) {
         $options = array('storyID' => $storyID);
         foreach (array('section', 'start', 'filter') as $field) {
             if (isset($data[$field])) {
                 $options[$field] = $data[$field];
             }
         }
         $addBreadcrumb = isset($data['addBreadcrumb']) ? $data['addBreadcrumb'] : true;
         $noBreadcrumbs = isset($data['noBreadcrumbs']) ? $data['noBreadcrumbs'] : false;
         if ($noBreadcrumbs) {
             $link['url'] = $this->buildURL('story', $options);
         } else {
             $link['url'] = $this->buildBreadcrumbURL('story', $options, $addBreadcrumb);
         }
     } elseif ($url = $story->getLink()) {
         $link['url'] = $url;
     }
     return $link;
 }
Ejemplo n.º 7
0
 public function linkForItem(KurogoObject $story, $data = null)
 {
     if ($pubDate = $story->getPubDate()) {
         $date = DateFormatter::formatDate($pubDate, DateFormatter::MEDIUM_STYLE, DateFormatter::NO_STYLE);
     } else {
         $date = "";
     }
     $image = false;
     $large = false;
     if ($this->showImages) {
         if ($this->page == 'pane' && ($image = $story->getImage())) {
             $large = true;
         } elseif ($image = $story->getThumbnail()) {
             $large = false;
         }
     }
     if (isset($data['federatedSearch']) && $data['federatedSearch'] && !$this->getOptionalModuleVar('SHOW_DESCRIPTION_IN_FEDERATED_SEARCH', 1)) {
         $subtitle = '';
     } else {
         $subtitle = $this->htmlEncodeFeedString($story->getDescription());
         if ($this->getOptionalModuleVar('STRIP_TAGS_IN_DESCRIPTION', 1)) {
             $subtitle = Sanitizer::sanitizeHTML($subtitle, array());
         } else {
             $subtitle = Sanitizer::sanitizeHTML($subtitle, 'inline');
         }
     }
     $link = array('title' => $this->htmlEncodeFeedString($story->getTitle()), 'pubDate' => $date, 'author' => $this->htmlEncodeFeedString($story->getAuthor()), 'subtitle' => $subtitle, 'img' => $image ? $image->getURL() : '', 'large' => $large);
     if ($storyID = $story->getGUID()) {
         $options = array('id' => $storyID);
         foreach (array('feed', 'start', 'filter') as $field) {
             if (isset($data[$field])) {
                 $options[$field] = $data[$field];
             }
         }
         $addBreadcrumb = isset($data['addBreadcrumb']) ? $data['addBreadcrumb'] : true;
         $noBreadcrumbs = isset($data['noBreadcrumbs']) ? $data['noBreadcrumbs'] : false;
         if ($noBreadcrumbs) {
             $link['url'] = $this->buildURL('story', $options);
         } else {
             $link['url'] = $this->buildBreadcrumbURL('story', $options, $addBreadcrumb);
         }
     } elseif ($url = $story->getLink()) {
         $link['url'] = $url;
     }
     return $link;
 }
 public function linkforItem(KurogoObject $person, $options = null)
 {
     $title = $person->getName() ? $this->htmlEncodeString($person->getName()) : $this->getLocalizedString('NO_HEADER_TITLE');
     return array('title' => $title, 'url' => $this->buildBreadcrumbURL('detail', array('id' => $person->getId(), 'filter' => self::argVal($options, 'filter'), 'feed' => $this->feed)));
 }
Ejemplo n.º 9
0
 protected function linkForScheduleItem(KurogoObject $event, $data = null)
 {
     $options = array('id' => $event->getID());
     if (isset($data['sport'])) {
         $options['sport'] = $data['sport'];
     }
     $return = array('title' => $event->getTitle(), 'subtitle' => sprintf("%s<br />%s", $this->timeText($event), $event->getLocation()), 'url' => $this->buildBreadcrumbURL('schedule_detail', $options, true));
     if (isset($data['label'])) {
         $return['label'] = $data['label'];
     }
     return $return;
 }
Ejemplo n.º 10
0
 public function linkforItem(KurogoObject $person, $options = null)
 {
     return array('title' => $this->htmlEncodeString($person->getName()), 'url' => $this->buildBreadcrumbURL('detail', array('uid' => $person->getId(), 'filter' => $this->getArg('filter'))));
 }