Skip to content

Commit

Permalink
solve bug 0000050
Browse files Browse the repository at this point in the history
  • Loading branch information
domjos1994 committed Sep 3, 2018
1 parent 1fbfa6a commit b1e2513
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 1 deletion.
16 changes: 16 additions & 0 deletions Classes/Domain/Model/TimelineEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ class TimelineEvent extends AbstractEntity {
* */
protected $title = '';

/**
* The link for the title
*
* @var string
* */
protected $eventLink = '';

/**
* The description of the Event
*
Expand All @@ -36,6 +43,7 @@ class TimelineEvent extends AbstractEntity {

public function __construct($title = '', $description = '', $startDate = null, $endDate = null) {
$this->title = $title;
$this->eventLink = "";
$this->description = $description;
$this->startDate = $startDate;
$this->endDate = $endDate;
Expand All @@ -48,6 +56,14 @@ public function setTitle($title) {
public function getTitle() {
return $this->title;
}

public function setEventLink($eventLink) {
$this->eventLink = $eventLink;
}

public function getEventLink() {
return $this->eventLink;
}

public function setDescription($description) {
$this->description = $description;
Expand Down
24 changes: 23 additions & 1 deletion Configuration/TCA/tx_timeline_domain_model_timelineevent.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,28 @@
'eval' => 'trim,required'
]
],
'event_link' => [
'exclude' => 1,
'label' => 'LLL:EXT:timeline/Resources/Private/Language/locallang_db.xlf:tx_timeline_domain_model_timelineevent.item_event_title',
'config' => array(
'type' => 'input',
'wizards' => array(
'link' => array(
'type' => 'popup',
'title' => 'Link',
'icon' => 'link_popup.gif',
'module' => array(
'name' => 'wizard_element_browser',
'urlParameters' => array(
'mode' => 'wizard'
)
),
'JSopenParams' => 'height=300,width=500,status=0,menubar=0,scrollbars=1'
),
),
'softref' => 'typolink[linkList]',
),
],
'description' => [
'label' => 'LLL:EXT:timeline/Resources/Private/Language/locallang_db.xlf:tx_timeline_domain_model_timelineevent.item_description',
'config' => [
Expand All @@ -55,7 +77,7 @@
],
],
'types' => [
'0' => ['showitem' => 'title, description, start_date, end_date']
'0' => ['showitem' => 'title, event_link, description, start_date, end_date']
]
];

3 changes: 3 additions & 0 deletions Resources/Private/Language/locallang_db.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
<trans-unit id="tx_timeline_domain_model_timelineevent.item_title">
<source>Title</source>
</trans-unit>
<trans-unit id="tx_timeline_domain_model_timelineevent.item_event_title">
<source>Link zu den Details</source>
</trans-unit>
<trans-unit id="tx_timeline_domain_model_timelineevent.item_description">
<source>Description</source>
</trans-unit>
Expand Down
6 changes: 6 additions & 0 deletions Resources/Private/Templates/Timeline/List.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
<div class='content'>
<p>
{event.description}
<f:if condition="{event.eventLink}">
<f:then>
<br/>
<f:link.typolink parameter="{event.eventLink}">More Details</f:link.typolink>
</f:then>
</f:if>
</p>
</div>
</li>
Expand Down
1 change: 1 addition & 0 deletions ext_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CREATE TABLE tx_timeline_domain_model_timelineevent (
pid int(11) DEFAULT '0' NOT NULL,

title varchar(255) DEFAULT '' NOT NULL,
event_link text,
description text NOT NULL,
start_date int(11) DEFAULT '0' NOT NULL,
end_date int(11) DEFAULT '0',
Expand Down

0 comments on commit b1e2513

Please sign in to comment.