Пример #1
0
 /**
  * Creates a hyperlink to the single view page of the event $event.
  *
  * @param tx_seminars_Model_Event $event
  *        the event which to link to
  * @param string $linkText the link text, must not be empty
  * @param bool $htmlspecialcharLinkText whether to htmlspecialchar the link text
  *
  * @return string HTML code for the link to the event's single view page
  */
 public function createSingleViewLink(tx_seminars_Model_Event $event, $linkText, $htmlspecialcharLinkText = TRUE)
 {
     $processedLinkText = $htmlspecialcharLinkText ? htmlspecialchars($linkText) : $linkText;
     $linkConditionConfiguration = $this->getConfValueString('linkToSingleView', 's_listView');
     $createLink = $linkConditionConfiguration === 'always' || $linkConditionConfiguration === 'onlyForNonEmptyDescription' && $event->hasDescription();
     if (!$createLink) {
         return $processedLinkText;
     }
     $url = $this->getLinkBuilder()->createRelativeUrlForEvent($event);
     return '<a href="' . htmlspecialchars($url) . '">' . $processedLinkText . '</a>';
 }
Пример #2
0
 /**
  * @test
  */
 public function hasDescriptionForEventDateWithDescriptionReturnsTrue()
 {
     $topic = tx_oelib_MapperRegistry::get('tx_seminars_Mapper_Event')->getLoadedTestingModel(array('description' => 'this is a great event.'));
     $this->fixture->setData(array('object_type' => tx_seminars_Model_Event::TYPE_DATE, 'topic' => $topic));
     self::assertTrue($this->fixture->hasDescription());
 }
Пример #3
0
 /**
  * @test
  */
 public function hasDescriptionForSingleEventWithDescriptionReturnsTrue()
 {
     $this->fixture->setData(array('object_type' => tx_seminars_Model_Event::TYPE_COMPLETE, 'description' => 'this is a great event.'));
     self::assertTrue($this->fixture->hasDescription());
 }
Пример #4
0
 /**
  * @test
  */
 public function hasDescriptionForEventTopicWithDescriptionReturnsTrue()
 {
     $this->fixture->setData(array('object_type' => tx_seminars_Model_Event::TYPE_TOPIC));
     $this->fixture->setDescription('this is a great event.');
     self::assertTrue($this->fixture->hasDescription());
 }