Initial commit
authorjdegroot <jdegroot@735d13b6-9817-0410-8766-e36946ffe9aa>
Tue, 28 Aug 2012 15:10:16 +0000 (15:10 +0000)
committerjdegroot <jdegroot@735d13b6-9817-0410-8766-e36946ffe9aa>
Tue, 28 Aug 2012 15:10:16 +0000 (15:10 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/roq_newsevent/trunk@65674 735d13b6-9817-0410-8766-e36946ffe9aa

57 files changed:
Changelog [new file with mode: 0644]
Classes/Controller/EventController.php [new file with mode: 0644]
Classes/Domain/Model/Event.php [new file with mode: 0644]
Classes/Domain/Repository/EventRepository.php [new file with mode: 0644]
Classes/ViewHelpers/Format/TimeViewHelper.php [new file with mode: 0644]
Classes/ViewHelpers/Format/TrimViewHelper.php [new file with mode: 0644]
Classes/ViewHelpers/IfViewHelper.php [new file with mode: 0644]
Classes/ViewHelpers/LinkViewHelper.php [new file with mode: 0644]
Classes/ViewHelpers/TranslateViewHelper.php [new file with mode: 0644]
Configuration/ExtensionBuilder/settings.yaml [new file with mode: 0644]
Configuration/TCA/Event.php [new file with mode: 0644]
Configuration/TypoScript/constants.txt [new file with mode: 0644]
Configuration/TypoScript/setup.txt [new file with mode: 0644]
ExtensionBuilder.json [new file with mode: 0644]
Resources/Private/.htaccess [new file with mode: 0644]
Resources/Private/Language/locallang.xml [new file with mode: 0644]
Resources/Private/Language/locallang_csh_tx_news_domain_model_news.xml [new file with mode: 0644]
Resources/Private/Language/locallang_db.xml [new file with mode: 0644]
Resources/Private/Layouts/Backend/Default.html [new file with mode: 0644]
Resources/Private/Layouts/Detail.html [new file with mode: 0644]
Resources/Private/Layouts/General.html [new file with mode: 0644]
Resources/Private/Partials/Administration/Buttons.html [new file with mode: 0644]
Resources/Private/Partials/Administration/ListItem.html [new file with mode: 0644]
Resources/Private/Partials/Category/Items.html [new file with mode: 0644]
Resources/Private/Partials/Detail/MediaContainer.html [new file with mode: 0644]
Resources/Private/Partials/Detail/MediaDam.html [new file with mode: 0644]
Resources/Private/Partials/Detail/MediaHtml.html [new file with mode: 0644]
Resources/Private/Partials/Detail/MediaImage.html [new file with mode: 0644]
Resources/Private/Partials/Detail/MediaVideo.html [new file with mode: 0644]
Resources/Private/Partials/Detail/Opengraph.html [new file with mode: 0644]
Resources/Private/Partials/Event/Item.html [new file with mode: 0644]
Resources/Private/Partials/Event/Item.ics [new file with mode: 0644]
Resources/Private/Partials/Event/Item.xml [new file with mode: 0644]
Resources/Private/Partials/EventList/Item.html [new file with mode: 0644]
Resources/Private/Partials/List/Item.html [new file with mode: 0644]
Resources/Private/Templates/News/DateMenu.html [new file with mode: 0644]
Resources/Private/Templates/News/Detail.html [new file with mode: 0644]
Resources/Private/Templates/News/EventDateMenu.html [new file with mode: 0644]
Resources/Private/Templates/News/EventDetail.html [new file with mode: 0644]
Resources/Private/Templates/News/EventDetail.ics [new file with mode: 0644]
Resources/Private/Templates/News/EventList.html [new file with mode: 0644]
Resources/Private/Templates/News/EventList.ics [new file with mode: 0644]
Resources/Private/Templates/News/EventList.xml [new file with mode: 0644]
Resources/Private/Templates/News/List.html [new file with mode: 0644]
Resources/Private/Templates/News/List.xml [new file with mode: 0644]
Resources/Private/Templates/News/SearchForm.html [new file with mode: 0644]
Resources/Private/Templates/News/SearchResult.html [new file with mode: 0644]
Resources/Public/Icons/relation.gif [new file with mode: 0644]
Resources/Public/Icons/tx_news_domain_model_news.gif [new file with mode: 0644]
Tests/Unit/Controller/EventControllerTest.php [new file with mode: 0644]
Tests/Unit/Domain/Model/EventTest.php [new file with mode: 0644]
doc/manual.sxw [new file with mode: 0644]
ext_emconf.php [new file with mode: 0644]
ext_icon.gif [new file with mode: 0644]
ext_localconf.php [new file with mode: 0644]
ext_tables.php [new file with mode: 0644]
ext_tables.sql [new file with mode: 0644]

diff --git a/Changelog b/Changelog
new file mode 100644 (file)
index 0000000..80fecda
--- /dev/null
+++ b/Changelog
@@ -0,0 +1,3 @@
+2012-07-24  Jochem de Groot <jochem@roquin.nl>
+
+       * Created initial version
\ No newline at end of file
diff --git a/Classes/Controller/EventController.php b/Classes/Controller/EventController.php
new file mode 100644 (file)
index 0000000..930b69d
--- /dev/null
@@ -0,0 +1,155 @@
+<?php
+
+/**
+ * Copyright (c) 2012, ROQUIN B.V. (C), http://www.roquin.nl
+ *
+ * @author:         J. de Groot
+ * @file:           EventController.php
+ * @description:    News event Controller, extending functionality from the News Controller
+ */
+
+/**
+ * @package TYPO3
+ * @subpackage roq_newsevent
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
+ */
+class Tx_RoqNewsevent_Controller_EventController extends Tx_News_Controller_NewsController {
+
+       /**
+        * eventRepository
+        *
+        * @var Tx_RoqNewsevent_Domain_Repository_EventRepository
+        */
+       protected $eventRepository;
+
+       /**
+        * injectEventRepository
+        *
+        * @param Tx_RoqNewsevent_Domain_Repository_EventRepository $eventRepository
+        * @return void
+        */
+       public function injectEventRepository(Tx_RoqNewsevent_Domain_Repository_EventRepository $eventRepository) {
+               $this->eventRepository = $eventRepository;
+       }
+
+    /**
+        * Initializes the settings
+     *
+     * @param array $settings
+        * @return array $settings
+        */
+       protected function initializeSettings($settings) {
+        if (isset($settings['event']['dateField'])) {
+            $settings['dateField'] = $settings['event']['dateField'];
+        } else {
+            $settings['dateField'] = 'eventStartdate';
+        }
+
+        return $settings;
+       }
+
+    /**
+     * Create the demand object which define which records will get shown
+     *
+     * @param array $settings
+     * @return Tx_News_Domain_Model_NewsDemand
+     */
+    protected function createDemandObjectFromSettings($settings) {
+        $demand = parent::createDemandObjectFromSettings($settings);
+
+        // set ordering
+        if($demand->getArchiveRestriction() == 'archived') {
+            if ($settings['event']['archived']['orderBy']) {
+                $demand->setOrder($settings['event']['archived']['orderBy']);
+            } else {
+                // default ordering for archived events
+                $demand->setOrder('tx_roqnewsevent_startdate DESC, tx_roqnewsevent_starttime DESC');
+            }
+        } else {
+            if ($settings['event']['orderBy']) {
+                $demand->setOrder($settings['event']['orderBy']);
+            } else {
+                // default ordering for active events
+                $demand->setOrder('tx_roqnewsevent_startdate ASC, tx_roqnewsevent_starttime ASC');
+            }
+        }
+
+        return $demand;
+    }
+
+    /**
+     * Render a menu by dates, e.g. years, months or dates
+     *
+     * @param array|null $overwriteDemand
+     * @return void
+     */
+    public function eventDateMenuAction(array $overwriteDemand = NULL) {
+        $this->settings = $this->initializeSettings($this->settings);
+        $demand = $this->createDemandObjectFromSettings($this->settings);
+
+        $eventRecords = $this->eventRepository->findDemanded($demand);
+
+        if (!$dateField = $this->settings['dateField']) {
+            $dateField = 'eventStartdate';
+        }
+
+        $this->view->assignMultiple(array(
+            'listPid' => ($this->settings['listPid'] ? $this->settings['listPid'] : $GLOBALS['TSFE']->id),
+            'dateField' => $dateField,
+            'events' => $eventRecords,
+            'overwriteDemand' => $overwriteDemand,
+        ));
+    }
+
+    /**
+     * Output a list view of news events
+     *
+     * @param array $overwriteDemand
+     * @return string the Rendered view
+     */
+    public function eventListAction(array $overwriteDemand = NULL) {
+        $this->settings = $this->initializeSettings($this->settings);
+        $demand = $this->createDemandObjectFromSettings($this->settings);
+
+        if ($this->settings['disableOverrideDemand'] != 1 && $overwriteDemand !== NULL) {
+            $demand = $this->overwriteDemandObject($demand, $overwriteDemand);
+        }
+
+        $newsRecords = $this->eventRepository->findDemanded($demand);
+
+        $this->view->assignMultiple(array(
+            'news' => $newsRecords,
+            'overwriteDemand' => $overwriteDemand,
+        ));
+    }
+
+    /**
+     * Single view of a news event record
+     *
+     * @param Tx_RoqNewsevent_Domain_Model_Event $event
+     * @param integer $currentPage current page for optional pagination
+     * @return void
+     */
+    public function eventDetailAction(Tx_RoqNewsevent_Domain_Model_Event $event = NULL, $currentPage = 1) {
+        $this->settings = $this->initializeSettings($this->settings);
+
+        if (is_null($event)) {
+            $previewNewsId = ((int)$this->settings['singleNews'] > 0) ? $this->settings['singleNews'] : $this->request->getArgument('news');
+
+            if ($this->settings['previewHiddenRecords']) {
+                $event = $this->eventRepository->findByUid($previewNewsId, FALSE);
+            } else {
+                $event = $this->eventRepository->findByUid($previewNewsId);
+            }
+        }
+
+        $this->view->assignMultiple(array(
+            'newsItem' => $event,
+            'currentPage' => (int)$currentPage,
+        ));
+
+        Tx_News_Utility_Page::setRegisterProperties($this->settings['detail']['registerProperties'], $event);
+    }
+
+}
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Model/Event.php b/Classes/Domain/Model/Event.php
new file mode 100644 (file)
index 0000000..9f3b8a2
--- /dev/null
@@ -0,0 +1,194 @@
+<?php
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ *
+ *
+ * @package roq_newsevent
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
+ *
+ */
+class Tx_RoqNewsevent_Domain_Model_Event extends Tx_News_Domain_Model_News {
+
+       /**
+        * Event start date
+        *
+        * @var DateTime
+        * @validate NotEmpty
+        */
+       protected $eventStartdate;
+
+       /**
+        * Event start time
+        *
+        * @var DateTime
+        */
+       protected $eventStarttime;
+
+       /**
+        * Event end date
+        *
+        * @var DateTime
+        */
+       protected $eventEnddate;
+
+       /**
+        * Event end time
+        *
+        * @var DateTime
+        */
+       protected $eventEndtime;
+
+       /**
+        * Even location (City, County)
+        *
+        * @var string
+        */
+       protected $eventLocation;
+
+       /**
+        * Returns the eventStartdate
+        *
+        * @return DateTime $eventStartdate
+        */
+       public function getEventStartdate() {
+               return $this->eventStartdate;
+       }
+
+       /**
+        * Sets the eventStartdate
+        *
+        * @param DateTime $eventStartdate
+        * @return void
+        */
+       public function setEventStartdate($eventStartdate) {
+               $this->eventStartdate = $eventStartdate;
+       }
+
+       /**
+        * Returns the eventStarttime
+        *
+        * @return DateTime $eventStarttime
+        */
+       public function getEventStarttime() {
+               return $this->eventStarttime;
+       }
+
+       /**
+        * Sets the eventStarttime
+        *
+        * @param DateTime $eventStarttime
+        * @return void
+        */
+       public function setEventStarttime($eventStarttime) {
+               $this->eventStarttime = $eventStarttime;
+       }
+
+       /**
+        * Returns the eventEnddate
+        *
+        * @return DateTime $eventEnddate
+        */
+       public function getEventEnddate() {
+               return $this->eventEnddate;
+       }
+
+       /**
+        * Sets the eventEnddate
+        *
+        * @param DateTime $eventEnddate
+        * @return void
+        */
+       public function setEventEnddate($eventEnddate) {
+               $this->eventEnddate = $eventEnddate;
+       }
+
+       /**
+        * Returns the eventEndtime
+        *
+        * @return DateTime $eventEndtime
+        */
+       public function getEventEndtime() {
+               return $this->eventEndtime;
+       }
+
+       /**
+        * Sets the eventEndtime
+        *
+        * @param DateTime $eventEndtime
+        * @return void
+        */
+       public function setEventEndtime($eventEndtime) {
+               $this->eventEndtime = $eventEndtime;
+       }
+
+       /**
+        * Returns the eventLocation
+        *
+        * @return string $eventLocation
+        */
+       public function getEventLocation() {
+               return $this->eventLocation;
+       }
+
+       /**
+        * Sets the eventLocation
+        *
+        * @param string $eventLocation
+        * @return void
+        */
+       public function setEventLocation($eventLocation) {
+               $this->eventLocation = $eventLocation;
+       }
+
+    /**
+     * Get year of eventStartdate
+     *
+     * @return integer
+     */
+    public function getYearOfEventStartdate() {
+        return $this->getEventStartdate()->format('Y');
+    }
+
+    /**
+     * Get month of eventStartdate
+     *
+     * @return integer
+     */
+    public function getMonthOfEventStartdate() {
+        return $this->getEventStartdate()->format('m');
+    }
+
+    /**
+     * Get day of eventStartdate
+     *
+     * @return integer
+     */
+    public function getDayOfEventStartdate() {
+        return $this->getEventStartdate()->format('d');
+    }
+
+}
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Repository/EventRepository.php b/Classes/Domain/Repository/EventRepository.php
new file mode 100644 (file)
index 0000000..9b67c72
--- /dev/null
@@ -0,0 +1,152 @@
+<?php
+
+/**
+ * Copyright (c) 2012, ROQUIN B.V. (C), http://www.roquin.nl
+ *
+ * @author:         J. de Groot
+ * @file:           EventRepository.php
+ * @description:    News event Repository, extending functionality from the News Repository
+ */
+
+/**
+ * @package TYPO3
+ * @subpackage roq_newsevent
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
+ */
+class Tx_RoqNewsevent_Domain_Repository_EventRepository extends Tx_News_Domain_Repository_NewsRepository {
+
+    /**
+     * Returns the constraint to determine if a news event is active or not (archived)
+     *
+     * @param Tx_Extbase_Persistence_QueryInterface $query
+     * @return Tx_Extbase_Persistence_QOM_Constraint $constraint
+     */
+    protected function createIsActiveConstraint(Tx_Extbase_Persistence_QueryInterface $query) {
+        /** @var $constraint Tx_Extbase_Persistence_QOM_Constraint */
+        $constraint = null;
+        $timestamp  = time(); // + date('Z');
+
+        $constraint = $query->logicalOr(
+            // future events:
+            $query->greaterThan('tx_roqnewsevent_startdate + tx_roqnewsevent_starttime',$timestamp),
+            // current multiple day events:
+            $query->logicalAnd(
+                $query->lessThan('tx_roqnewsevent_startdate + tx_roqnewsevent_starttime',$timestamp),
+                $query->greaterThan('tx_roqnewsevent_enddate + tx_roqnewsevent_endtime',$timestamp)
+            ),
+            // current single day events:
+            $query->logicalAnd(
+                $query->lessThan('tx_roqnewsevent_startdate + tx_roqnewsevent_starttime',$timestamp),
+                $query->greaterThan('tx_roqnewsevent_startdate + tx_roqnewsevent_endtime',$timestamp),
+                $query->equals('tx_roqnewsevent_enddate',0)
+            )
+        );
+
+        return $constraint;
+    }
+
+    /**
+     * Returns an array of constraints created from a given demand object.
+     *
+     * @param Tx_Extbase_Persistence_QueryInterface $query
+     * @param Tx_News_Domain_Model_DemandInterface $demand
+     * @return array<Tx_Extbase_Persistence_QOM_Constraint>
+     */
+    protected function createConstraintsFromDemand(Tx_Extbase_Persistence_QueryInterface $query, Tx_News_Domain_Model_DemandInterface $demand) {
+        $constraints    = array();
+
+        if ($demand->getCategories() && $demand->getCategories() !== '0') {
+            $constraints[] = $this->createCategoryConstraint(
+                                        $query,
+                                        $demand->getCategories(),
+                                        $demand->getCategoryConjunction(),
+                                        $demand->getIncludeSubCategories()
+                    );
+        }
+
+            // archived
+        if ($demand->getArchiveRestriction() == 'archived') {
+            $constraints[] = $query->logicalNot($this->createIsActiveConstraint($query));
+            // non-archived (active)
+        } elseif ($demand->getArchiveRestriction() == 'active') {
+            $constraints[] = $this->createIsActiveConstraint($query);
+        }
+
+            // top news
+        if ($demand->getTopNewsRestriction() == 1) {
+            $constraints[] = $query->equals('istopnews', 1);
+        } elseif ($demand->getTopNewsRestriction() == 2) {
+            $constraints[] = $query->equals('istopnews', 0);
+        }
+
+            // storage page
+        if ($demand->getStoragePage() != 0) {
+            $pidList = t3lib_div::intExplode(',', $demand->getStoragePage(), TRUE);
+            $constraints[]  = $query->in('pid', $pidList);
+        }
+
+            // month & year OR year only
+        if ($demand->getYear() > 0) {
+            if (is_null($demand->getDateField())) {
+                throw new InvalidArgumentException('No Datefield is set, therefore no Datemenu is possible!');
+            }
+            if ($demand->getMonth() > 0) {
+                if ($demand->getDay() > 0) {
+                    $begin = mktime(0, 0, 0, $demand->getMonth(), $demand->getDay(), $demand->getYear());
+                    $end = mktime(23, 59, 59, $demand->getMonth(), $demand->getDay(), $demand->getYear());
+                } else {
+                    $begin = mktime(0, 0, 0, $demand->getMonth(), 1, $demand->getYear());
+                    $end = mktime(23, 59, 59, ($demand->getMonth() + 1), 0, $demand->getYear());
+                }
+            } else {
+                $begin = mktime(0, 0, 0, 1, 1, $demand->getYear());
+                $end = mktime(23, 59, 59, 12, 31, $demand->getYear());
+            }
+            $constraints[] = $query->logicalAnd(
+                    $query->greaterThanOrEqual($demand->getDateField(), $begin),
+                    $query->lessThanOrEqual($demand->getDateField(), $end)
+                );
+        }
+
+            // Tags
+        if ($demand->getTags()) {
+            $constraints[] = $query->contains('tags', $demand->getTags());
+        }
+
+            // dummy records, used for UnitTests only!
+        if ($demand->getIsDummyRecord()) {
+            $constraints[] = $query->equals('isDummyRecord', 1);
+        }
+
+            // Search
+        if ($demand->getSearch() !== NULL) {
+            /* @var $searchObject Tx_News_Domain_Model_Dto_Search */
+            $searchObject = $demand->getSearch();
+
+            $searchFields = t3lib_div::trimExplode(',', $searchObject->getFields(), TRUE);
+            $searchConstraints = array();
+
+            if (count($searchFields) === 0) {
+                throw new UnexpectedValueException('No search fields defined', 1318497755);
+            }
+
+            $searchSubject = $searchObject->getSubject();
+            foreach($searchFields as $field) {
+                if (!empty($searchSubject)) {
+                $searchConstraints[] = $query->like($field, '%' . $searchSubject . '%');
+                }
+            }
+            $constraints[] = $query->logicalOr($searchConstraints);
+        }
+
+            // Clean not used constraints
+        foreach($constraints as $key => $value) {
+            if (is_null($value)) {
+                unset($constraints[$key]);
+            }
+        }
+
+        return $constraints;
+    }
+}
+?>
\ No newline at end of file
diff --git a/Classes/ViewHelpers/Format/TimeViewHelper.php b/Classes/ViewHelpers/Format/TimeViewHelper.php
new file mode 100644 (file)
index 0000000..7aaf0e7
--- /dev/null
@@ -0,0 +1,122 @@
+<?php
+
+/*                                                                        *
+ * This script belongs to the FLOW3 package "Fluid".                      *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * This script is distributed in the hope that it will be useful, but     *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * Formats a DateTime object.
+ *
+ * = Examples =
+ *
+ * <code title="Defaults">
+ * <f:format.date>{dateObject}</f:format.date>
+ * </code>
+ * <output>
+ * 1980-12-13
+ * (depending on the current date)
+ * </output>
+ *
+ * <code title="Custom date format">
+ * <f:format.date format="H:i">{dateObject}</f:format.date>
+ * </code>
+ * <output>
+ * 01:23
+ * (depending on the current time)
+ * </output>
+ *
+ * <code title="Localized dates using strftime date format">
+ * <f:format.date format="%d. %B %Y">{dateObject}</f:format.date>
+ * </code>
+ * <output>
+ * 13. Dezember 1980
+ * (depending on the current date and defined locale. In the example you see the 1980-12-13 in a german locale)
+ * </output>
+ *
+ * <code title="strtotime string">
+ * <f:format.date format="d.m.Y - H:i:s">+1 week 2 days 4 hours 2 seconds</f:format.date>
+ * </code>
+ * <output>
+ * 13.12.1980 - 21:03:42
+ * (depending on the current time, see http://www.php.net/manual/en/function.strtotime.php)
+ * </output>
+ *
+ * <code title="output date from unix timestamp">
+ * <f:format.date format="d.m.Y - H:i:s">@{someTimestamp}</f:format.date>
+ * </code>
+ * <output>
+ * 13.12.1980 - 21:03:42
+ * (depending on the current time. Don't forget the "@" in front of the timestamp see http://www.php.net/manual/en/function.strtotime.php)
+ * </output>
+ *
+ * <code title="Inline notation">
+ * {f:format.date(date: dateObject)}
+ * </code>
+ * <output>
+ * 1980-12-13
+ * (depending on the value of {dateObject})
+ * </output>
+ *
+ * <code title="Inline notation (2nd variant)">
+ * {dateObject -> f:format.date()}
+ * </code>
+ * <output>
+ * 1980-12-13
+ * (depending on the value of {dateObject})
+ * </output>
+ *
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ * @api
+ */
+class Tx_RoqNewsevent_ViewHelpers_Format_TimeViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractViewHelper {
+
+       /**
+        * Render the supplied DateTime object as a formatted date.
+        *
+        * @param mixed $time either a DateTime object or a string that is accepted by DateTime constructor
+        * @param string $format Format String which is taken to format the Date/Time
+        * @return string Formatted time
+        */
+       public function render($time = NULL, $format = 'H:i:s') {
+        $timeStamp      = NULL;
+        $timeZoneOffset = NULL;
+
+               if ($time === NULL) {
+                       $time = $this->renderChildren();
+                       if ($time === NULL) {
+                               return '';
+                       }
+               }
+
+               if (!$time instanceof DateTime) {
+                       try {
+                $time = new DateTime($time);
+                       } catch (Exception $exception) {
+                               throw new Tx_Fluid_Core_ViewHelper_Exception('"' . $time . '" could not be parsed by DateTime constructor.', 1241722579);
+                       }
+               }
+
+        $timeZoneOffset = $time->getTimezone()->getOffset($time);
+        $timeStamp      = strtotime($time->format($format));
+
+        return date($format, $timeStamp - $timeZoneOffset);
+    }
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/ViewHelpers/Format/TrimViewHelper.php b/Classes/ViewHelpers/Format/TrimViewHelper.php
new file mode 100644 (file)
index 0000000..77f06e6
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Copyright (c) 2012, ROQUIN B.V. (C), http://www.roquin.nl
+ *
+ * @author:         J. de Groot <jochem@roquin.nl>
+ * @file:           TrimViewHelper.php
+ * @created:        26-7-12 15:58
+ * @description:    ViewHelper to trim content with PHP trim function
+ */
+
+class Tx_RoqNewsevent_ViewHelpers_Format_TrimViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractViewHelper {
+
+       /**
+     * @param boolean $replaceDoubleSpaces Flag which defines if double spaces must be replaced with single spaces
+     * @param boolean $trimTabs Flag which defines if (indentation) tabs must be trimmed
+        * @return string The trimmed string
+        */
+       public function render($replaceDoubleSpaces = TRUE, $trimTabs = TRUE) {
+               $content = $this->renderChildren();
+
+        if($replaceDoubleSpaces) {
+            $content = preg_replace("/\s\s+/", " ", $content);
+        }
+
+        if($trimTabs) {
+            $content = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*|[\t]*[\r\n\']+/", "\n", $content);
+        } else {
+            $content = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n\']+/", "\n", $content);
+        }
+
+        return $content;
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/ViewHelpers/IfViewHelper.php b/Classes/ViewHelpers/IfViewHelper.php
new file mode 100644 (file)
index 0000000..bcca36e
--- /dev/null
@@ -0,0 +1,178 @@
+<?php
+
+/*                                                                        *
+ * This script belongs to the FLOW3 package "Fluid".                      *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * This script is distributed in the hope that it will be useful, but     *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * This view helper implements an if/else condition.
+ * @see Tx_Fluid_Core_Parser_SyntaxTree_ViewHelperNode::convertArgumentValue() to find see how boolean arguments are evaluated
+ *
+ * = Conditions =
+ *
+ * As a condition is a boolean value, you can just use a boolean argument.
+ * Alternatively, you can write a boolean expression there.
+ * Boolean expressions have the following form:
+ * XX Comparator YY
+ * Comparator is one of: ==, !=, <, <=, >, >= and %
+ * The % operator converts the result of the % operation to boolean.
+ * Complex expressions are supported via && and ||
+ * Parenthesis may be used to group && and || expressions
+ *
+ * XX and YY can be one of:
+ * - number
+ * - Object Accessor
+ * - Array
+ * - a ViewHelper
+ * - singlequoted simple strings
+ * - complex comparisons
+ *
+ * <code title="condition example">
+ * <f:if condition="{rank} > 100">
+ *   Will be shown if rank is > 100
+ * </f:if>
+ * <f:if condition="{rank} % 2">
+ *   Will be shown if rank % 2 != 0.
+ * </f:if>
+ * <f:if condition="{rank} == {k:bar()}">
+ *   Checks if rank is equal to the result of the ViewHelper "k:bar"
+ * </f:if>
+ * <f:if condition="'{foo}' == '{bar}'">
+ *   Checks if string in {foo} equals string in var {bar}
+ * </f:if>
+ * <f:if condition="'{foo}' == '{bar}' && '{foo}' != 'invalidString'">
+ *   CHecks if two strings match and the first string is not 'invalidString'
+ * </f:if>
+ * </code>
+ *
+ * = Examples =
+ *
+ * <code title="Basic usage">
+ * <f:if condition="somecondition">
+ *   This is being shown in case the condition matches
+ * </f:if>
+ * </code>
+ *
+ * Everything inside the <f:if> tag is being displayed if the condition evaluates to TRUE.
+ *
+ * <code title="If / then / else">
+ * <f:if condition="somecondition">
+ *   <f:then>
+ *     This is being shown in case the condition matches.
+ *   </f:then>
+ *   <f:else>
+ *     This is being displayed in case the condition evaluates to FALSE.
+ *   </f:else>
+ * </f:if>
+ * </code>
+ * <output>
+ * Everything inside the "then" tag is displayed if the condition evaluates to TRUE.
+ * Otherwise, everything inside the "else"-tag is displayed.
+ * </output>
+ *
+ * <code title="inline notation">
+ * {f:if(condition: someCondition, then: 'condition is met', else: 'condition is not met')}
+ * </code>
+ * <output>
+ * The value of the "then" attribute is displayed if the condition evaluates to TRUE.
+ * Otherwise, everything the value of the "else"-attribute is displayed.
+ * </output>
+ *
+ *
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ * @api
+ */
+class Tx_RoqNewsevent_ViewHelpers_IfViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractConditionViewHelper {
+
+       public function initializeArguments() {
+               parent::initializeArguments();
+               $this->registerArgument('condition', 'mixed', 'View helper condition expression, evaluated', TRUE);
+       }
+
+       /**
+        * renders <f:then> child if $condition is true, otherwise renders <f:else> child.
+        *
+        * @return string the rendered string
+        * @author Sebastian Kurf├╝rst <sebastian@typo3.org>
+        * @author Bastian Waidelich <bastian@typo3.org>
+        * @api
+        */
+       public function render() {
+               $condition = $this->arguments['condition'];
+
+               if (is_null($condition)) {
+                       return $this->renderElseChild();
+               } elseif ($condition === TRUE) {
+                       return $this->renderThenChild();
+               } elseif ($condition === FALSE) {
+                       return $this->renderElseChild();
+               } elseif (is_array($condition)) {
+                       return (count($condition) > 0);
+               } elseif ($condition instanceof Countable) {
+                       return (count($condition) > 0);
+               } elseif (is_string($condition) && trim($condition) === '') {
+                       if (trim($condition) === '') {
+                               return $this->renderElseChild();
+                       } else if (preg_match('/[a-z^]/', $condition)) {
+                               $condition = '\'' . $condition . '\'';
+                       }
+               } elseif (is_object($condition)) {
+                       if ($condition instanceof Iterator && method_exists($condition, 'count')) {
+                               return (call_user_method('count', $condition) > 0);
+                       } else if ($condition instanceof DateTime) {
+                               return $this->renderThenChild();
+                       } else if ($condition instanceof stdClass) {
+                               return $this->renderThenChild();
+                       } else {
+                               $access = t3lib_div::makeInstance('Tx_Extbase_Reflection_ObjectAccess');
+                               $propertiesCount = count($access->getGettableProperties($condition));
+                               if ($propertiesCount > 0) {
+                                       return $this->renderThenChild();
+                               } else {
+                                       throw new Exception('Unknown object type in IfViewHelper condition: ' . get_class($condition), 1309493049);
+                               }
+                       }
+               }
+               $leftParenthesisCount = substr_count($condition, '(');
+               $rightParenthesisCount = substr_count($condition, ')');
+               $singleQuoteCount = substr_count($condition, '\'');
+               $escapedSingleQuoteCount = substr_count($condition, '\\\'');
+               if ($rightParenthesisCount !== $leftParenthesisCount) {
+                       throw new Exception('Syntax error in IfViewHelper condition, mismatched number of opening and closing paranthesis', 1309490125);
+               }
+               if (($singleQuoteCount-$escapedSingleQuoteCount) % 2 != 0) {
+                       throw new Exception('Syntax error in IfViewHelper condition, mismatched number of unescaped single quotes', 1309490125);
+               }
+
+               $evaluation             = NULL;
+               $evaluationCondition    = trim($condition, ';');
+               $evaluationExpression   = '$evaluation = (bool) (' . $evaluationCondition . ');';
+
+               @eval($evaluationExpression);
+               if ($evaluation === NULL) {
+                       throw new Exception('Syntax error while analyzing computed IfViewHelper expression: ' . $evaluationExpression, 1309537403);
+                       return $this->renderElseChild();
+               } else if ($evaluation === TRUE) {
+                       return $this->renderThenChild();
+               } else {
+                       return $this->renderElseChild();
+               }
+       }
+}
+?>
diff --git a/Classes/ViewHelpers/LinkViewHelper.php b/Classes/ViewHelpers/LinkViewHelper.php
new file mode 100644 (file)
index 0000000..8a902be
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+
+/**
+ * Copyright (c) 2012, ROQUIN B.V. (C), http://www.roquin.nl
+ *
+ * @author:         J. de Groot
+ * @file:           EventLinkViewHelper.php
+ * @description:    ViewHelper to render proper links for event detail view
+ */
+
+class Tx_RoqNewsevent_ViewHelpers_LinkViewHelper extends Tx_News_ViewHelpers_LinkViewHelper {
+
+    /**
+     * Render link to news item or internal/external pages
+     *
+     * @param Tx_News_Domain_Model_News $newsItem
+     * @param array $settings
+     * @param boolean $hsc add htmlspecialchars() at the end
+     * @param array $configuration optional typolink configuration
+     * @param string $action optional typolink additional action
+     * @return string url
+     */
+    public function render(Tx_News_Domain_Model_News $newsItem, array $settings = array(), $hsc = FALSE, $configuration = array(), $action = NULL) {
+        if($action !== NULL) {
+            $configuration['additionalParams'] .= '&tx_news_pi1[action]=' . $action;
+        }
+
+        $link = parent::render($newsItem, $settings, $hsc, $configuration);
+
+        // ignore the getDynamicGetVarsManipulation settings, which can cause the action to be added hardcoded (which is only applicable for news only items)
+        if(stristr($link, urlencode('tx_news_pi1[action]') . '=detail') !== FALSE) {
+            $link = str_replace(urlencode('tx_news_pi1[action]') . '=detail', urlencode('tx_news_pi1[action]') . '=' . $action, $link);
+        }
+
+        return $link;
+    }
+
+}
\ No newline at end of file
diff --git a/Classes/ViewHelpers/TranslateViewHelper.php b/Classes/ViewHelpers/TranslateViewHelper.php
new file mode 100644 (file)
index 0000000..dd3e363
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+
+/**
+ * Copyright (c) 2012, ROQUIN B.V. (C), http://www.roquin.nl
+ *
+ * @author:         J. de Groot <jochem@roquin.nl>
+ * @file:           EventController.php
+ * @description:    Translate view helper, extending the fluid translate viewhelper
+ */
+
+class Tx_RoqNewsevent_ViewHelpers_TranslateViewHelper extends Tx_Fluid_ViewHelpers_TranslateViewHelper {
+
+       /**
+        * Translate a given key or use the tag body as default.
+        *
+        * @param string $key The locallang key
+        * @param string $default if the given locallang key could not be found, this value is used. . If this argument is not set, child nodes will be used to render the default
+        * @param boolean $htmlEscape TRUE if the result should be htmlescaped. This won't have an effect for the default value
+        * @param array $arguments Arguments to be replaced in the resulting string
+        * @return string The translated key or tag body if key doesn't exist
+        */
+       public function render($key, $default = NULL, $htmlEscape = TRUE, array $arguments = NULL) {
+        $value = parent::render($key, $default, $htmlEscape, $arguments);
+
+        if(!isset($value)) {
+            //$value = Tx_Extbase_Utility_Localization::translate($key, $GLOBALS['_EXTKEY'], $arguments);
+            $value = Tx_Extbase_Utility_Localization::translate($key, 'roq_newsevent', $arguments);
+        }
+
+               return $value;
+       }
+}
+
+?>
diff --git a/Configuration/ExtensionBuilder/settings.yaml b/Configuration/ExtensionBuilder/settings.yaml
new file mode 100644 (file)
index 0000000..1322b64
--- /dev/null
@@ -0,0 +1,93 @@
+#
+# Extension Builder settings for extension roq_newsevent
+# generated 2012-06-26
+#
+# See http://www.yaml.org/spec/1.2/spec.html
+#
+
+---
+
+###########    Overwrite settings  ###########
+#
+# These settings only apply, if the roundtrip feature of the extension builder
+# is enabled in the extension manager
+#
+# Usage:
+# nesting reflects the file structure
+# a setting applies to a file or recursive to all files and subfolders
+#
+# merge:
+# means for classes: All properties ,methods and method bodies
+# of the existing class will be modified according to the new settings
+# but not overwritten
+#
+# for locallang xml files: Existing keys and labels are always
+# preserved (renaming in the GUI has only influence on the property and method names)
+#
+# for other files: You will find a Split token at the end of the file
+# After this token you can write whatever you want and it will be appended
+# everytime the code is generated
+#
+# keep:
+# files are never overwritten
+# These settings may break the functionality of the extension builder!
+# Handle with care!
+#
+#
+
+############  extension settings  ##############
+
+overwriteSettings:
+  Classes:
+    Controller: merge
+    Domain:
+      Model: merge
+      Repository: merge
+
+  Configuration:
+    #TCA: merge
+    #TypoScript: keep
+
+  Resources:
+    Private:
+      Language:
+        #locallang.xml: merge
+        #locallang.xlf: merge
+      #Templates: keep
+
+  ext_icon.gif: keep
+
+#  ext_localconf.php: merge
+
+#  ext_tables.php: merge
+
+#  ext_tables.sql: merge
+
+## ext_autoload.php is only needed in special cases ##
+createAutoloadRegistry: false
+
+######### settings for classBuilder #############################
+#
+# here you may define default parent classes for your classes
+# these settings only apply for new generated classes
+# you may also just change the parent class in the generated class file.
+# It will be kept on next code generation, if the overwrite settings
+# are configured to merge it
+#
+#  Experimental!!
+#################################################################
+
+classBuilder:
+
+  Controller:
+    parentClass: Tx_Extbase_MVC_Controller_ActionController
+
+  Model:
+    AbstractEntity:
+      parentClass: Tx_Extbase_DomainObject_AbstractEntity
+
+    AbstractValueObject:
+      parentClass: Tx_Extbase_DomainObject_AbstractValueObject
+
+  Repository:
+    parentClass: Tx_Extbase_Persistence_Repository
\ No newline at end of file
diff --git a/Configuration/TCA/Event.php b/Configuration/TCA/Event.php
new file mode 100644 (file)
index 0000000..e408a6f
--- /dev/null
@@ -0,0 +1,6 @@
+<?php
+if (!defined ('TYPO3_MODE')) {
+       die ('Access denied.');
+}
+
+?>
\ No newline at end of file
diff --git a/Configuration/TypoScript/constants.txt b/Configuration/TypoScript/constants.txt
new file mode 100644 (file)
index 0000000..e152215
--- /dev/null
@@ -0,0 +1,6 @@
+plugin.roq_newsevent {
+    view {
+        templateRootPath = EXT:roq_newsevent/Resources/Private/Templates
+        partialRootPath = EXT:roq_newsevent/Resources/Private/Partials
+    }
+}
\ No newline at end of file
diff --git a/Configuration/TypoScript/setup.txt b/Configuration/TypoScript/setup.txt
new file mode 100644 (file)
index 0000000..cd88382
--- /dev/null
@@ -0,0 +1,49 @@
+config.tx_extbase {
+    persistence {
+        classes {
+            Tx_News_Domain_Model_News {
+                subclasses {
+                    Tx_RoqNewsevent_Event = Tx_RoqNewsevent_Domain_Model_Event
+                       }
+            }
+
+            Tx_RoqNewsevent_Domain_Model_Event {
+                mapping {
+                    tableName = tx_news_domain_model_news
+                    recordType = Tx_RoqNewsevent_Event
+                    columns {
+                        tx_roqnewsevent_startdate.mapOnProperty = eventStartdate
+                        tx_roqnewsevent_starttime.mapOnProperty = eventStarttime
+                        tx_roqnewsevent_enddate.mapOnProperty = eventEnddate
+                        tx_roqnewsevent_endtime.mapOnProperty = eventEndtime
+                        tx_roqnewsevent_location.mapOnProperty = eventLocation
+                    }
+                }
+            }
+       }
+    }
+
+    objects {
+        Tx_News_Controller_NewsController.className = Tx_RoqNewsevent_Controller_EventController
+    }
+}
+
+plugin.tx_news {
+    view {
+        partialRootPath = {$plugin.roq_newsevent.view.partialRootPath}
+        templateRootPath = {$plugin.roq_newsevent.view.templateRootPath}
+       }
+
+       settings {
+        # event configuration
+       event {
+           orderBy = tx_roqnewsevent_startdate ASC, tx_roqnewsevent_starttime ASC
+
+           archived {
+                orderBy = tx_roqnewsevent_startdate DESC, tx_roqnewsevent_starttime DESC
+            }
+
+            dateField = eventStartdate
+       }
+    }
+}
\ No newline at end of file
diff --git a/ExtensionBuilder.json b/ExtensionBuilder.json
new file mode 100644 (file)
index 0000000..806de77
--- /dev/null
@@ -0,0 +1 @@
+{"modules":[{"config":{"position":[189,44]},"name":"New Model Object","value":{"actionGroup":{"_default0_list":false,"_default1_show":false,"_default2_new_create":false,"_default3_edit_update":false,"_default4_delete":false,"customActions":[]},"name":"Event","objectsettings":{"aggregateRoot":true,"description":"Event info","mapToTable":"tx_news_domain_model_news","parentClass":"Tx_News_Domain_Model_News","type":"Entity","uid":"1319266301844"},"propertyGroup":{"properties":[{"propertyDescription":"Event start date","propertyIsExcludeField":false,"propertyIsRequired":true,"propertyName":"eventStartdate","propertyType":"Date","uid":"714533072165"},{"propertyDescription":"Event start time","propertyIsExcludeField":false,"propertyIsRequired":false,"propertyName":"eventStarttime","propertyType":"Time","uid":"204153757822"},{"propertyDescription":"Event end date","propertyIsExcludeField":false,"propertyIsRequired":false,"propertyName":"eventEnddate","propertyType":"Date","uid":"932242795268"},{"propertyDescription":"Event end time","propertyIsExcludeField":false,"propertyIsRequired":false,"propertyName":"eventEndtime","propertyType":"Time","uid":"544341132953"},{"propertyDescription":"Even location (City, County)","propertyIsExcludeField":false,"propertyIsRequired":false,"propertyName":"eventLocation","propertyType":"String","uid":"631114468182"}]},"relationGroup":{"relations":[]}}}],"properties":{"backendModules":[],"description":"Event extension based on the versatile news extension and extbase & fluid. Supplies additional event fields to the new news records (similar to mbl_newsevent for tt_news).","emConf":{"category":"plugin","custom_category":"","dependsOn":"extbase => 1.3\nfluid => 1.3\ntypo3 => 4.5\nnews => 1.4\n","disableVersioning":false,"priority":"","shy":false,"state":"alpha","targetVersion":"4.5","version":""},"extensionKey":"roq_newsevent","name":"News event","originalExtensionKey":"roq_newsevent","persons":[],"plugins":[]},"wires":[],"log":{"last_modified":"2012-08-08 12:02","extension_builder_version":"2.3.0","be_user":" (1)"}}
\ No newline at end of file
diff --git a/Resources/Private/.htaccess b/Resources/Private/.htaccess
new file mode 100644 (file)
index 0000000..dfc0272
--- /dev/null
@@ -0,0 +1 @@
+deny  from all
\ No newline at end of file
diff --git a/Resources/Private/Language/locallang.xml b/Resources/Private/Language/locallang.xml
new file mode 100644 (file)
index 0000000..909c1cf
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<T3locallang>
+       <meta type="array">
+               <type>module</type>
+               <description>Language labels for the News event extension in the FRONTEND</description>
+       </meta>
+       <data type="array">
+
+               <languageKey index="default" type="array">
+                       <label index="tx_roqnewsevent_domain_model_event">Event info</label>
+                       <label index="tx_roqnewsevent_domain_model_event.event_startdate">Start date</label>
+                       <label index="tx_roqnewsevent_domain_model_event.even_starttime">Start time</label>
+                       <label index="tx_roqnewsevent_domain_model_event.event_enddate">End date</label>
+                       <label index="tx_roqnewsevent_domain_model_event.event_endtime">End time</label>
+
+            <label index="event_location">Location</label>
+            <label index="event_date">Date</label>
+            <label index="event_time">Time</label>
+            <label index="event_till">to</label>
+               </languageKey>
+
+        <languageKey index="nl" type="array">
+            <label index="tx_roqnewsevent_domain_model_event">Evenement info</label>
+            <label index="tx_roqnewsevent_domain_model_event.event_startdate">Startdatum</label>
+            <label index="tx_roqnewsevent_domain_model_event.event_starttime">Starttijd</label>
+            <label index="tx_roqnewsevent_domain_model_event.event_enddate">Einddatum</label>
+            <label index="tx_roqnewsevent_domain_model_event.event_endtime">Eindtijd</label>
+
+            <label index="event_location">Locatie</label>
+            <label index="event_date">Datum</label>
+            <label index="event_time">Tijd</label>
+            <label index="event_till">tot</label>
+        </languageKey>
+
+       </data>
+</T3locallang>
\ No newline at end of file
diff --git a/Resources/Private/Language/locallang_csh_tx_news_domain_model_news.xml b/Resources/Private/Language/locallang_csh_tx_news_domain_model_news.xml
new file mode 100644 (file)
index 0000000..e239c66
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<T3locallang>
+       <meta type="array">
+               <description>Context Sensitive Help (CSH) for table tx_news_domain_model_news</description>
+               <type>CSH</type>
+               <csh_table>tx_news_domain_model_news</csh_table>
+       </meta>
+       <data type="array">
+
+           <languageKey index="default" type="array">
+                       <label index="event_startdate.description">Event start date</label>
+                       <label index="event_starttime.description">Event start time</label>
+                       <label index="event_enddate.description">Event end date</label>
+                       <label index="event_endtime.description">Event end time</label>
+                       <label index="event_location.description">Event location (Where, City)</label>
+               </languageKey>
+
+        <languageKey index="nl" type="array">
+            <label index="event_startdate.description">Startdatum van het evenement</label>
+            <label index="event_starttime.description">Starttijd van het evenement</label>
+            <label index="event_enddate.description">Einddatum van het evenement</label>
+            <label index="event_endtime.description">Eindtijd van het evenement</label>
+            <label index="event_location.description">Locatie van het evenement (Waar, Plaats)</label>
+        </languageKey>
+
+       </data>
+</T3locallang>
\ No newline at end of file
diff --git a/Resources/Private/Language/locallang_db.xml b/Resources/Private/Language/locallang_db.xml
new file mode 100644 (file)
index 0000000..e741d90
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<T3locallang>
+       <meta type="array">
+               <type>database</type>
+               <description>Language labels for database tables/fields belonging to extension 'roq_newsevent'</description>
+       </meta>
+       <data type="array">
+               <languageKey index="default" type="array">
+                       <label index="tx_roqnewsevent_domain_model_event">Event</label>
+                       <label index="tx_roqnewsevent_startdate">Start Date</label>
+                       <label index="tx_roqnewsevent_starttime">Start Time</label>
+                       <label index="tx_roqnewsevent_enddate">End Date</label>
+                       <label index="tx_roqnewsevent_endtime">End Time</label>
+                       <label index="tx_roqnewsevent_location">Location</label>
+                       <label index="tx_news_domain_model_news.tx_extbase_type.Tx_RoqNewsevent_Event">Event</label>
+               </languageKey>
+
+        <languageKey index="nl" type="array">
+            <label index="tx_roqnewsevent_domain_model_event">Evenement</label>
+            <label index="tx_roqnewsevent_startdate">Startdatum</label>
+            <label index="tx_roqnewsevent_starttime">Starttijd</label>
+            <label index="tx_roqnewsevent_enddate">Einddatum</label>
+            <label index="tx_roqnewsevent_endtime">Eindtijd</label>
+            <label index="tx_roqnewsevent_location">Locatie</label>
+            <label index="tx_news_domain_model_news.tx_extbase_type.Tx_RoqNewsevent_Event">Evenement</label>
+        </languageKey>
+       </data>
+</T3locallang>
\ No newline at end of file
diff --git a/Resources/Private/Layouts/Backend/Default.html b/Resources/Private/Layouts/Backend/Default.html
new file mode 100644 (file)
index 0000000..f53adea
--- /dev/null
@@ -0,0 +1,33 @@
+{namespace n=Tx_News_ViewHelpers}
+
+<f:be.container>
+       <n:includeFile path="../typo3conf/ext/news/Resources/Public/Css/administration.css" />
+       <div class="typo3-fullDoc">
+               <div id="typo3-docheader">
+                       <div id="typo3-docheader-row1">
+                               <div class="buttonsleft">
+                                       <f:render section="iconButtons" />
+                               </div>
+                               <div class="buttonsright">
+                                       <f:be.buttons.shortcut />
+                               </div>
+                       </div>
+                       <div id="typo3-docheader-row2">
+                               <div class="docheader-row2-left">
+                               </div>
+                               <div class="docheader-row2-right">
+                                       <f:be.pagePath />
+                                       <f:be.pageInfo />
+                               </div>
+                       </div>
+               </div>
+               <div id="typo3-docbody">
+                       <div id="typo3-inner-docbody">
+                               <f:flashMessages class="tx-extbase-flash-message" />
+                               <div id="news-administration">
+                                       <f:render section="content" />
+                               </div>
+                       </div>
+               </div>
+       </div>
+</f:be.container>
diff --git a/Resources/Private/Layouts/Detail.html b/Resources/Private/Layouts/Detail.html
new file mode 100644 (file)
index 0000000..f701b71
--- /dev/null
@@ -0,0 +1,11 @@
+{namespace n=Tx_News_ViewHelpers}
+
+<f:if condition="{settings.cssFile}">
+       <n:includeFile path="{settings.cssFile}" />
+</f:if>
+
+<div class="news news-single">
+       <div class="article">
+               <f:render section="content" />
+       </div>
+</div>
\ No newline at end of file
diff --git a/Resources/Private/Layouts/General.html b/Resources/Private/Layouts/General.html
new file mode 100644 (file)
index 0000000..0646dd3
--- /dev/null
@@ -0,0 +1,10 @@
+{namespace n=Tx_News_ViewHelpers}
+
+<f:if condition="{settings.cssFile}">
+       <n:includeFile path="{settings.cssFile}" />
+</f:if>
+
+<div class="news">
+       <f:flashMessages class="tx-news-flash-message" />
+       <f:render section="content" />
+</div>
diff --git a/Resources/Private/Partials/Administration/Buttons.html b/Resources/Private/Partials/Administration/Buttons.html
new file mode 100644 (file)
index 0000000..fb68a30
--- /dev/null
@@ -0,0 +1,5 @@
+{namespace n=Tx_News_ViewHelpers}
+
+<n:be.buttons.icon uri="{f:uri.action(action:'newNews')}" icon="actions-document-new" title="Create new news record" />
+<n:be.buttons.icon uri="{f:uri.action(action:'index')}" icon="tcarecords-tx_news_domain_model_news-default" title="News Listing" />
+<n:be.buttons.icon uri="{f:uri.action(action:'newsPidListing')}" icon="apps-clipboard-list" title="News Pid listing" />
\ No newline at end of file
diff --git a/Resources/Private/Partials/Administration/ListItem.html b/Resources/Private/Partials/Administration/ListItem.html
new file mode 100644 (file)
index 0000000..4f52c75
--- /dev/null
@@ -0,0 +1,28 @@
+{namespace n=Tx_News_ViewHelpers}
+
+<tr class="db_list_normal">
+       <td>
+               <n:be.clickmenu table="tx_news_domain_model_news" uid="{newsItem.uid}">
+                       <n:be.buttons.iconForRecord table="tx_news_domain_model_news" uid="{newsItem.uid}" title="" />
+               </n:be.clickmenu>
+
+               <n:be.buttons.icon uri="#" onclick="window.location.href='alt_doc.php?returnUrl='+T3_THIS_LOCATION+'&edit[tx_news_domain_model_news][{newsItem.uid}]=edit'; return false;" icon="tcarecords-tx_news_domain_model_news-default" title="Info" />
+
+               <span title="UID: {newsItem.uid}">{newsItem.title}</span>
+       </td>
+       <td><f:if condition="{newsItem.isTopNews}"><f:then>Yes</f:then><f:else>No</f:else></f:if></td>
+       <td><f:format.date>{newsItem.dateTime}</f:format.date></td>
+       <td><f:format.date>{newsItem.archive}</f:format.date></td>
+       <td><f:format.date>{newsItem.tstamp}</f:format.date></td>
+       <td>
+               <f:if condition="{newsItem.author}">
+                       <strong><f:translate key="LLL:EXT:cms/locallang_tca.xml:pages.author_formlabel" />:</strong> {newsItem.author}<br />
+               </f:if>
+               <f:if condition="{newsItem.categories}">
+                       <strong><f:translate key="LLL:EXT:news/Resources/Private/Language/locallang_db.xml:tx_news_domain_model_news.categories" />:</strong>
+                       <f:for each="{newsItem.categories}" as="category" iteration="iterator">
+                               <span title="UID: {category.uid}">{category.title}</span><f:if condition="{iterator.isLast}"><f:then></f:then><f:else>, </f:else></f:if>
+                       </f:for>
+               </f:if>
+       </td>
+</tr>
\ No newline at end of file
diff --git a/Resources/Private/Partials/Category/Items.html b/Resources/Private/Partials/Category/Items.html
new file mode 100644 (file)
index 0000000..4e3ffa0
--- /dev/null
@@ -0,0 +1,16 @@
+<!-- categories -->
+<span class="hidden">. </span>
+<span class="news-list-category">
+       <f:for each="{categories}" as="category">
+               <f:if condition="{category.shortcut}">
+                       <f:then>
+                               <f:link.page pageUid="{category.shortcut}">
+                                       {category.title}
+                               </f:link.page>
+                       </f:then>
+                       <f:else>
+                               {category.title}
+                       </f:else>
+               </f:if>
+       </f:for>
+</span>
\ No newline at end of file
diff --git a/Resources/Private/Partials/Detail/MediaContainer.html b/Resources/Private/Partials/Detail/MediaContainer.html
new file mode 100644 (file)
index 0000000..558dff7
--- /dev/null
@@ -0,0 +1,21 @@
+<f:if condition="{media}">
+       <!-- media files -->
+       <div class="news-img-wrap">
+               <f:for each="{media}" as="mediaElement">
+                       <f:if condition="{mediaElement.type} == 0">
+                               <f:render partial="Detail/MediaImage" arguments="{mediaElement: mediaElement, settings:settings}"/>
+                       </f:if>
+                       <f:if condition="{mediaElement.type} == 1">
+                               <f:render partial="Detail/MediaVideo" arguments="{mediaElement: mediaElement, settings:settings}"/>
+                       </f:if>
+                       <f:if condition="{mediaElement.type} == 2">
+                               <f:render partial="Detail/MediaHtml" arguments="{mediaElement: mediaElement, settings:settings}"/>
+                       </f:if>
+                       <f:if condition="{mediaElement.type} == 3">
+                               <f:render partial="Detail/MediaDam" arguments="{mediaElement: mediaElement, settings:settings}"/>
+                       </f:if>
+               </f:for>
+       </div>
+</f:if>
+
+
diff --git a/Resources/Private/Partials/Detail/MediaDam.html b/Resources/Private/Partials/Detail/MediaDam.html
new file mode 100644 (file)
index 0000000..39b9877
--- /dev/null
@@ -0,0 +1,16 @@
+{namespace n=Tx_News_ViewHelpers}
+
+<div class="mediaelement">
+       <n:format.dam as="dam" uid="{mediaElement.uid}">
+               <f:if condition="{settings.detail.media.image.lightbox}">
+                       <f:then>
+                               <a rel="{settings.detail.media.image.lightbox}" title="{dam.caption}" href="{f:uri.image(src:'{dam.file_path}{dam.file_name}' maxWidth:'800')}">
+                                       <f:image src="{dam.file_path}{dam.file_name}" title="{dam.title}"  alt="{dam.alt_text}" maxWidth="{settings.detail.media.image.maxWidth}" />
+                               </a>
+                       </f:then>
+                       <f:else>
+                               <f:image src="{dam.file_path}{dam.file_name}" title="{dam.title}"  alt="{dam.alt_text}" maxWidth="{settings.detail.media.image.maxWidth}" />
+                       </f:else>
+               </f:if>
+       </n:format.dam>
+</div>
\ No newline at end of file
diff --git a/Resources/Private/Partials/Detail/MediaHtml.html b/Resources/Private/Partials/Detail/MediaHtml.html
new file mode 100644 (file)
index 0000000..faa3e64
--- /dev/null
@@ -0,0 +1,8 @@
+<div>
+       <f:format.html>{mediaElement.content}</f:format.html>
+</div>
+<f:if condition="{mediaElement.title}">
+       <p class="news-img-caption">
+               {mediaElement.title}
+       </p>
+</f:if>
\ No newline at end of file
diff --git a/Resources/Private/Partials/Detail/MediaImage.html b/Resources/Private/Partials/Detail/MediaImage.html
new file mode 100644 (file)
index 0000000..5af7fb9
--- /dev/null
@@ -0,0 +1,17 @@
+<div class="mediaelement mediaelement-image">
+       <f:if condition="{settings.detail.media.image.lightbox}">
+               <f:then>
+                       <a rel="{settings.detail.media.image.lightbox}" title="{mediaElement.caption}" href="{f:uri.image(src:'uploads/tx_news/{mediaElement.content}' maxWidth:'800')}">
+                               <f:image src="uploads/tx_news/{mediaElement.content}" title="{mediaElement.title}"  alt="{mediaElement.alt}" maxWidth="{settings.detail.media.image.maxWidth}" />
+                       </a>
+               </f:then>
+               <f:else>
+                       <f:image src="uploads/tx_news/{mediaElement.content}" title="{mediaElement.title}"  alt="{mediaElement.alt}" maxWidth="{settings.detail.media.image.maxWidth}" />
+               </f:else>
+       </f:if>
+</div>
+<f:if condition="{mediaElement.caption}">
+       <p class="news-img-caption">
+               {mediaElement.caption}
+       </p>
+</f:if>
\ No newline at end of file
diff --git a/Resources/Private/Partials/Detail/MediaVideo.html b/Resources/Private/Partials/Detail/MediaVideo.html
new file mode 100644 (file)
index 0000000..88aa0b0
--- /dev/null
@@ -0,0 +1,16 @@
+{namespace n=Tx_News_ViewHelpers}
+
+<div class="mediaelement">
+       <div class="mediaelement-video">
+               <n:mediaFactory classes="{settings.interfaces.media.video}" element="{mediaElement}" width="{settings.detail.media.video.width}"  height="{settings.detail.media.video.height}"  />
+       </div>
+
+
+       <f:if condition="{mediaElement.caption}">
+               <div class="medialement-alternative-content">
+                       <p class="news-img-caption">
+                               {mediaElement.caption}
+                       </p>
+               </div>
+       </f:if>
+</div>
diff --git a/Resources/Private/Partials/Detail/Opengraph.html b/Resources/Private/Partials/Detail/Opengraph.html
new file mode 100644 (file)
index 0000000..5e4a1b7
--- /dev/null
@@ -0,0 +1,28 @@
+{namespace n=Tx_News_ViewHelpers}\r
+\r
+<f:if condition="{newsItem.alternativeTitle}">\r
+       <f:then><n:metaTag property="og:title" content="{newsItem.alternativeTitle}" /></f:then>\r
+       <f:else><n:metaTag property="og:title" content="{newsItem.title}" /></f:else>\r
+</f:if>\r
+<n:metaTag property="og:type" content="{settings.opengraph.type}" />\r
+<n:metaTag property="og:url" content="" useCurrentDomain="1" />\r
+<n:metaTag property="og:site_name" content="{settings.opengraph.site_name}" />\r
+<f:if condition="{newsItem.firstImagePreview.image}">\r
+       <n:metaTag\r
+               property="og:image"\r
+               content="{f:uri.image(src:'uploads/tx_news/{newsItem.firstImagePreview.image}' maxWidth:'100')}"\r
+               forceAbsoluteUrl="1" />\r
+</f:if>\r
+<n:metaTag property="fb:admins" content="{settings.opengraph.admins}" />\r
+<n:metaTag property="og:description" content="{newsItem.teaser}" />\r
+<n:metaTag property="fb:admins" content="{settings.opengraph.admins}" />\r
+<n:metaTag property="og:email" content="{settings.opengraph.email}" />\r
+<n:metaTag property="og:phone_number" content="{settings.opengraph.phone_number}" />\r
+<n:metaTag property="og:fax_number" content="{settings.opengraph.fax_number}" />\r
+<n:metaTag property="og:latitude" content="{settings.opengraph.latitude}" />\r
+<n:metaTag property="og:longitude" content="{settings.opengraph.longitude}" />\r
+<n:metaTag property="og:street-address" content="{settings.opengraph.street-address}" />\r
+<n:metaTag property="og:locality" content="{settings.opengraph.locality}" />\r
+<n:metaTag property="og:region" content="{settings.opengraph.region}" />\r
+<n:metaTag property="og:postal-code" content="{settings.opengraph.postal-code}" />\r
+<n:metaTag property="og:country-name" content="{settings.opengraph.country-name}" />
\ No newline at end of file
diff --git a/Resources/Private/Partials/Event/Item.html b/Resources/Private/Partials/Event/Item.html
new file mode 100644 (file)
index 0000000..49bc604
--- /dev/null
@@ -0,0 +1,56 @@
+{namespace n=Tx_News_ViewHelpers}
+{namespace e=Tx_RoqNewsevent_ViewHelpers}
+<!--
+       =====================
+               Partials/Event/Item.html
+-->
+<e:if condition="'<f:format.date>{newsItem.eventEnddate}</f:format.date>' != '' && '<f:format.date>{newsItem.eventEnddate}</f:format.date>' != '<f:format.date>{newsItem.eventStartdate}</f:format.date>'">
+    <!-- Multiple day event -->
+    <f:then>
+        <f:if condition="{newsItem.eventStarttime}">
+            <!-- Multiple day event with time -->
+            <f:then>
+                <strong><e:translate key="event_date" />:</strong> <n:format.date strftime="1" format="%d %B %Y">{newsItem.eventStartdate}</n:format.date> <e:translate key="event_till" /> <n:format.date strftime="1" format="%d %B %Y">{newsItem.eventEnddate}</n:format.date>
+
+                <f:if condition="{newsItem.eventEndtime}">
+                    <f:then>
+                        <br><strong><e:translate key="event_time" />:</strong> <e:format.time format="H:i">{newsItem.eventStarttime}</e:format.time> <e:translate key="event_till" /> <e:format.time format="H:i">{newsItem.eventEndtime}</e:format.time>
+                    </f:then>
+                    <f:else>
+                        <br><strong><e:translate key="event_time" />:</strong> <e:format.time format="H:i">{newsItem.eventStarttime}</e:format.time>
+                    </f:else>
+                </f:if>
+            </f:then>
+            <!-- Multiple day event without time -->
+            <f:else>
+                <strong><e:translate key="event_date" />:</strong> <n:format.date strftime="1" format="%d %B %Y">{newsItem.eventStartdate}</n:format.date> <e:translate key="event_till" /> <n:format.date strftime="1" format="%d %B %Y">{newsItem.eventEnddate}</n:format.date>
+            </f:else>
+        </f:if>
+    </f:then>
+    <!-- One day event -->
+    <f:else>
+        <f:if condition="{newsItem.eventStarttime}">
+            <!-- One day event with time -->
+            <f:then>
+                <strong><e:translate key="event_date" />:</strong> <n:format.date strftime="1" format="%d %B %Y">{newsItem.eventStartdate}</n:format.date>
+
+                <f:if condition="{newsItem.eventEndtime}">
+                    <f:then>
+                        <br><strong><e:translate key="event_time" />:</strong> <e:format.time format="H:i">{newsItem.eventStarttime}</e:format.time> <e:translate key="event_till" /> <e:format.time format="H:i">{newsItem.eventEndtime}</e:format.time>
+                    </f:then>
+                    <f:else>
+                        <br><strong><e:translate key="event_time" />:</strong> <e:format.time format="H:i">{newsItem.eventStarttime}</e:format.time>
+                    </f:else>
+                </f:if>
+            </f:then>
+            <!-- One day event without time -->
+            <f:else>
+                <strong><e:translate key="event_date" />:</strong> <n:format.date strftime="1" format="%d %B %Y">{newsItem.eventStartdate}</n:format.date>
+            </f:else>
+        </f:if>
+    </f:else>
+
+</e:if>
+<f:if condition="{newsItem.eventLocation}">
+    <br><strong><e:translate key="event_location" />:</strong> {newsItem.eventLocation}
+</f:if>
diff --git a/Resources/Private/Partials/Event/Item.ics b/Resources/Private/Partials/Event/Item.ics
new file mode 100644 (file)
index 0000000..683ac57
--- /dev/null
@@ -0,0 +1,73 @@
+{namespace n=Tx_News_ViewHelpers}
+{namespace e=Tx_RoqNewsevent_ViewHelpers}
+
+BEGIN:VEVENT
+SUMMARY:<n:format.striptags>{newsItem.title}</n:format.striptags>
+DESCRIPTION:<n:format.striptags>{newsItem.teaser}</n:format.striptags>
+DTSTAMP:<n:format.date format="%Y%m%dT%H%I%SZ" strftime="1">{newsItem.datetime}</n:format.date>
+
+<e:if condition="'<f:format.date>{newsItem.eventEnddate}</f:format.date>' != ''">
+    <!-- Multiple day event -->
+    <f:then>
+        <f:if condition="{newsItem.eventStarttime}">
+            <!-- Multiple day event with time -->
+            <f:then>
+
+                DTSTART:<f:format.date format="Ymd">{newsItem.eventStartdate}</f:format.date>T<e:format.time format="His">{newsItem.eventStarttime}</e:format.time>Z
+
+                <f:if condition="{newsItem.eventEndtime}">
+                    <f:then>
+
+                        DTEND:<f:format.date format="Ymd">{newsItem.eventEnddate}</f:format.date>T<e:format.time format="His">{newsItem.eventEndtime}</e:format.time>Z
+
+                    </f:then>
+                    <f:else>
+
+                        DTEND:<f:format.date format="Ymd">{newsItem.eventEnddate}</f:format.date>T000000Z
+
+                    </f:else>
+                </f:if>
+            </f:then>
+            <!-- Multiple day event without time -->
+            <f:else>
+
+                DTSTART:<f:format.date format="Ymd">{newsItem.eventStartdate}</f:format.date>T000000Z
+                DTEND:<f:format.date format="Ymd">{newsItem.eventEnddate}</f:format.date>T000000Z
+
+            </f:else>
+        </f:if>
+    </f:then>
+    <!-- One day event -->
+    <f:else>
+        <f:if condition="{newsItem.eventStarttime}">
+            <!-- One day event with time -->
+            <f:then>
+
+                DTSTART:<f:format.date format="Ymd">{newsItem.eventStartdate}</f:format.date>T<e:format.time format="His">{newsItem.eventStarttime}</e:format.time>Z
+
+                <f:if condition="{newsItem.eventEndtime}">
+                    <f:then>
+
+                        DTEND:<f:format.date format="Ymd">{newsItem.eventStartdate}</f:format.date>T<e:format.time format="His">{newsItem.eventEndtime}</e:format.time>Z
+
+                    </f:then>
+                </f:if>
+            </f:then>
+            <!-- One day event without time -->
+            <f:else>
+
+                DTSTART:<f:format.date format="Ymd">{newsItem.eventStartdate}</f:format.date>T000000Z
+
+            </f:else>
+        </f:if>
+    </f:else>
+</e:if>
+
+<f:if condition="{newsItem.eventLocation}">
+
+    LOCATION:{newsItem.eventLocation}
+
+</f:if>
+
+END:VEVENT
+END:VCALENDAR
\ No newline at end of file
diff --git a/Resources/Private/Partials/Event/Item.xml b/Resources/Private/Partials/Event/Item.xml
new file mode 100644 (file)
index 0000000..cff6edf
--- /dev/null
@@ -0,0 +1,7 @@
+<!--
+       =====================
+               Partials/Event/Item.xml
+-->
+<e:format.trim>
+    <f:render partial="Event/Item.html" arguments="{newsItem: newsItem, settings:settings}"/>
+</e:format.trim>
\ No newline at end of file
diff --git a/Resources/Private/Partials/EventList/Item.html b/Resources/Private/Partials/EventList/Item.html
new file mode 100644 (file)
index 0000000..77897cf
--- /dev/null
@@ -0,0 +1,125 @@
+{namespace n=Tx_News_ViewHelpers}
+{namespace e=Tx_RoqNewsevent_ViewHelpers}
+<!--
+       =====================
+               Partials/EventList/Item.html
+-->
+<div class="article articletype-{newsItem.type}{f:if(condition: newsItem.istopnews, then: ' topnews')}">
+       <!-- header -->
+       <div class="header">
+               <h3>
+                       <e:link newsItem="{newsItem}" settings="{settings}" action="eventDetail">
+                               {newsItem.title}
+                       </e:link>
+               </h3>
+       </div>
+
+       <f:if condition="{newsItem.media}">
+               <!-- media preview element -->
+               <f:then>
+               <div class="news-img-wrap">
+                       <e:link newsItem="{newsItem}" settings="{settings}" action="eventDetail">
+                               <f:if condition="{newsItem.mediaPreviews}">
+                                       <f:then>
+                                               <f:alias map="{mediaElement: newsItem.mediaPreviews.0}">
+                                                       <f:if condition="{mediaElement.type} == 0">
+                                                               <f:image
+                                                                       src="uploads/tx_news/{mediaElement.image}"
+                                                                       title="{mediaElement.title}"
+                                                                       alt="{mediaElement.alt}"
+                                                                       maxWidth="{settings.list.media.image.maxWidth}"
+                                                                       maxHeight="{settings.list.media.image.maxHeight}"
+                                                               />
+                                                       </f:if>
+                                                       <f:if condition="{mediaElement.type} == 1">
+                                                               <f:render partial="Detail/MediaVideo" arguments="{mediaElement: mediaElement}"/>
+                                                       </f:if>
+                                                       <f:if condition="{mediaElement.type} == 2">
+                                                               <f:render partial="Detail/MediaHtml" arguments="{mediaElement: mediaElement}"/>
+                                                       </f:if>
+                                                       <f:if condition="{mediaElement.type} == 3">
+                                                               <n:format.dam as="dam" uid="{mediaElement.uid}">
+                                                                       <f:image src="{dam.file_path}{dam.file_name}" title="{dam.title}"  alt="{dam.alt_text}" maxWidth="{settings.detail.media.image.maxWidth}" />
+                                                               </n:format.dam>
+                                                       </f:if>
+                                               </f:alias>
+                                       </f:then>
+                                       <f:else>
+                                               <f:if condition="{settings.displayDummyIfNoMedia}">
+                                                       <span class="no-media-element">
+                                                                       <f:image
+                                                                               src="typo3conf/ext/news/Resources/Public/Images/dummy-preview-image.png"
+                                                                               title=""
+                                                                               alt=""
+                                                                               maxWidth="{settings.list.media.image.maxWidth}"
+                                                                               maxHeight="{settings.list.media.image.maxHeight}"
+                                                                       />
+                                                       </span>
+                                               </f:if>
+                                       </f:else>
+                               </f:if>
+                       </e:link>
+               </div>
+               </f:then>
+               <f:else>
+                       <f:if condition="{settings.displayDummyIfNoMedia}">
+                               <f:then>
+                                       <div class="news-img-wrap">
+                                               <e:link newsItem="{newsItem}" settings="{settings}" action="eventDetail">
+                                                       <span class="no-media-element">
+                                                               <f:image
+                                                                       src="typo3conf/ext/news/Resources/Public/Images/dummy-preview-image.png"
+                                                                       title=""
+                                                                       alt=""
+                                                                       maxWidth="{settings.list.media.image.maxWidth}"
+                                                                       maxHeight="{settings.list.media.image.maxHeight}"
+                                                               />
+                                                       </span>
+                                               </e:link>
+                                       </div>
+                               </f:then>
+                       </f:if>
+               </f:else>
+       </f:if>
+
+       <!-- teaser text -->
+       <div class="teaser-text">
+               <f:if condition="{newsItem.teaser}">
+            <f:then>
+                <f:format.html>{newsItem.teaser}</f:format.html>
+            </f:then>
+            <f:else>
+                <f:format.html><f:format.crop maxCharacters="{settings.cropMaxCharacters}" respectWordBoundaries="true">{newsItem.bodytext}</f:format.crop></f:format.html>
+            </f:else>
+               </f:if>
+
+        <!-- date -->
+        <span class="news-list-date">
+            <f:render partial="Event/Item" arguments="{newsItem: newsItem, settings:settings}"/>
+        </span>
+       </div>
+
+       <!-- footer information -->
+       <div class="footer" role="contentinfo">
+               <p>
+                       <!-- date -->
+                       <span class="news-list-date">
+
+                       </span>
+
+                       <!-- first category -->
+                       <f:if condition="{newsItem.firstCategory}">
+                               <span class="hidden">. </span>
+                               <span class="news-list-category">{newsItem.firstCategory.title}</span>
+                       </f:if>
+
+                       <!-- author -->
+                       <f:if condition="{newsItem.author}">
+                               <span class="hidden">. </span>
+                               <span class="news-list-author">
+                                       <f:translate key="author" arguments="{0:newsItem.author}"/>
+                               </span>
+                       </f:if>
+               </p>
+       </div>
+</div>
diff --git a/Resources/Private/Partials/List/Item.html b/Resources/Private/Partials/List/Item.html
new file mode 100644 (file)
index 0000000..97a1b3e
--- /dev/null
@@ -0,0 +1,119 @@
+{namespace n=Tx_News_ViewHelpers}
+<!--
+       =====================
+               Partials/List/Item.html
+-->
+<div class="article articletype-{newsItem.type}{f:if(condition: newsItem.istopnews, then: ' topnews')}">
+       <!-- header -->
+       <div class="header">
+               <h3>
+                       <n:link newsItem="{newsItem}" settings="{settings}">
+                               {newsItem.title}
+                       </n:link>
+               </h3>
+       </div>
+
+       <f:if condition="{newsItem.media}">
+               <!-- media preview element -->
+               <f:then>
+               <div class="news-img-wrap">
+                       <n:link newsItem="{newsItem}" settings="{settings}">
+                               <f:if condition="{newsItem.mediaPreviews}">
+                                       <f:then>
+                                               <f:alias map="{mediaElement: newsItem.mediaPreviews.0}">
+                                                       <f:if condition="{mediaElement.type} == 0">
+                                                               <f:image
+                                                                       src="uploads/tx_news/{mediaElement.image}"
+                                                                       title="{mediaElement.title}"
+                                                                       alt="{mediaElement.alt}"
+                                                                       maxWidth="{settings.list.media.image.maxWidth}"
+                                                                       maxHeight="{settings.list.media.image.maxHeight}"
+                                                               />
+                                                       </f:if>
+                                                       <f:if condition="{mediaElement.type} == 1">
+                                                               <f:render partial="Detail/MediaVideo" arguments="{mediaElement: mediaElement}"/>
+                                                       </f:if>
+                                                       <f:if condition="{mediaElement.type} == 2">
+                                                               <f:render partial="Detail/MediaHtml" arguments="{mediaElement: mediaElement}"/>
+                                                       </f:if>
+                                                       <f:if condition="{mediaElement.type} == 3">
+                                                               <n:format.dam as="dam" uid="{mediaElement.uid}">
+                                                                       <f:image src="{dam.file_path}{dam.file_name}" title="{dam.title}"  alt="{dam.alt_text}" maxWidth="{settings.detail.media.image.maxWidth}" />
+                                                               </n:format.dam>
+                                                       </f:if>
+                                               </f:alias>
+                                       </f:then>
+                                       <f:else>
+                                               <f:if condition="{settings.displayDummyIfNoMedia}">
+                                                       <span class="no-media-element">
+                                                                       <f:image
+                                                                               src="typo3conf/ext/news/Resources/Public/Images/dummy-preview-image.png"
+                                                                               title=""
+                                                                               alt=""
+                                                                               maxWidth="{settings.list.media.image.maxWidth}"
+                                                                               maxHeight="{settings.list.media.image.maxHeight}"
+                                                                       />
+                                                       </span>
+                                               </f:if>
+                                       </f:else>
+                               </f:if>
+                       </n:link>
+               </div>
+               </f:then>
+               <f:else>
+                       <f:if condition="{settings.displayDummyIfNoMedia}">
+                               <f:then>
+                                       <div class="news-img-wrap">
+                                               <n:link newsItem="{newsItem}" settings="{settings}">
+                                                       <span class="no-media-element">
+                                                               <f:image
+                                                                       src="typo3conf/ext/news/Resources/Public/Images/dummy-preview-image.png"
+                                                                       title=""
+                                                                       alt=""
+                                                                       maxWidth="{settings.list.media.image.maxWidth}"
+                                                                       maxHeight="{settings.list.media.image.maxHeight}"
+                                                               />
+                                                       </span>
+                                               </n:link>
+                                       </div>
+                               </f:then>
+                       </f:if>
+               </f:else>
+       </f:if>
+
+       <!-- teas=ser text -->
+       <div class="teaser-text">
+               <f:if condition="{newsItem.teaser}">
+                               <f:then>
+                                       <f:format.html>{newsItem.teaser}</f:format.html>
+                               </f:then>
+                               <f:else>
+                                       <f:format.html><f:format.crop maxCharacters="{settings.cropMaxCharacters}" respectWordBoundaries="true">{newsItem.bodytext}</f:format.crop></f:format.html>
+                               </f:else>
+               </f:if>
+       </div>
+
+       <!-- footer information -->
+       <div class="footer" role="contentinfo">
+               <p>
+                       <!-- date -->
+                       <span class="news-list-date">
+                               <f:format.date format="d.m.Y">{newsItem.datetime}</f:format.date>
+                       </span>
+
+                       <!-- first category -->
+                       <f:if condition="{newsItem.firstCategory}">
+                               <span class="hidden">. </span>
+                               <span class="news-list-category">{newsItem.firstCategory.title}</span>
+                       </f:if>
+
+                       <!-- author -->
+                       <f:if condition="{newsItem.author}">
+                               <span class="hidden">. </span>
+                               <span class="news-list-author">
+                                       <f:translate key="author" arguments="{0:newsItem.author}"/>
+                               </span>
+                       </f:if>
+               </p>
+       </div>
+</div>
diff --git a/Resources/Private/Templates/News/DateMenu.html b/Resources/Private/Templates/News/DateMenu.html
new file mode 100644 (file)
index 0000000..28898b3
--- /dev/null
@@ -0,0 +1,34 @@
+{namespace n=Tx_News_ViewHelpers}\r
+<f:layout name="General" />\r
+<!--\r
+       =====================\r
+               Templates/News/DateMenu.html\r
+-->\r
+\r
+\r
+\r
+<f:section name="content">\r
+       <div class="news-menu-view">\r
+               <ul>\r
+               <f:groupedFor each="{news}" as="newsByYear" groupBy="yearOf{dateField}" groupKey="year">\r
+                       <li>{year}\r
+                               <ul>\r
+                               <f:groupedFor each="{newsByYear}" as="newsByMonth" groupBy="monthOf{dateField}" groupKey="month">\r
+                                               <f:if condition="{0:year, 1:month} == {0:overwriteDemand.year, 1:overwriteDemand.month}">\r
+                                                       <f:then>\r
+                                                               <li class="item itemactive">\r
+                                                       </f:then>\r
+                                                       <f:else>\r
+                                                               <li class="item">\r
+                                                       </f:else>\r
+                                               </f:if>\r
+                                               <f:link.action pageUid="{listPid}" arguments="{overwriteDemand:{year: year, month: month}}"><f:translate key="month.{month}" /> {year}</f:link.action>\r
+                                               (<f:count subject="{newsByMonth}" /> <f:translate key="{f:if(condition: '{f:count(subject: newsByMonth)} == 1', then: 'entry', else: 'entries')}" />)\r
+                                       </li>\r
+                               </f:groupedFor>\r
+                               </ul>\r
+                       </li>\r
+               </f:groupedFor>\r
+               </ul>\r
+       </div>\r
+</f:section>\r
diff --git a/Resources/Private/Templates/News/Detail.html b/Resources/Private/Templates/News/Detail.html
new file mode 100644 (file)
index 0000000..1f637f1
--- /dev/null
@@ -0,0 +1,154 @@
+{namespace n=Tx_News_ViewHelpers}
+
+<f:layout name="Detail.html" />
+
+<!--
+       =====================
+               News/Detail.html
+-->
+
+<f:section name="content">
+       <f:if condition="{newsItem}">
+               <f:then>
+                       <n:format.nothing>
+                               <f:if condition="{newsItem.alternativeTitle}">
+                                       <f:then><n:titleTag><n:format.htmlentitiesDecode>{newsItem.alternativeTitle}</n:format.htmlentitiesDecode></n:titleTag></f:then>
+                                       <f:else><n:titleTag><n:format.htmlentitiesDecode>{newsItem.title}</n:format.htmlentitiesDecode></n:titleTag></f:else>
+                               </f:if>
+                               <f:render partial="Detail/Opengraph" arguments="{newsItem: newsItem, settings:settings}"/>
+                       </n:format.nothing>
+                       <div class="header">
+                               <h3>{newsItem.title}</h3>
+                       </div>
+                       <div class="footer" role="contentinfo">
+                               <p>
+                                       <!-- date -->
+                                       <span class="news-list-date">
+                                               <f:format.date format="d.m.Y">{newsItem.datetime}</f:format.date>
+                                       </span>
+
+                                       <f:if condition="{newsItem.categories}">
+                                               <f:render partial="Category/Items" arguments="{categories:newsItem.categories, settings:settings}"/>
+                                       </f:if>
+
+                                       <f:if condition="{newsItem.author}">
+                                               <!-- author -->
+                                               <span class="hidden">. </span>
+                                               <span class="news-list-author">
+                                                       <f:translate key="author" arguments="{0:newsItem.author}"></f:translate>
+                                               </span>
+                                       </f:if>
+                               </p>
+                       </div>
+
+                       <f:if condition="{newsItem.teaser}">
+                               <!-- teaser -->
+                               <div class="teaser-text">
+                                       {newsItem.teaser}
+                               </div>
+                       </f:if>
+
+                       <f:if condition="{newsItem.contentElements}">
+                               <!-- content elements -->
+                               <f:cObject typoscriptObjectPath="lib.tx_news.contentElementRendering">{newsItem.contentElementIdList}</f:cObject>
+                       </f:if>
+
+                       <f:render partial="Detail/MediaContainer" arguments="{media: newsItem.media, settings:settings}"/>
+
+                       <!-- main text -->
+                       <div class="news-text-wrap">
+                               <f:format.html>{newsItem.bodytext}</f:format.html>
+                       </div>
+
+                       <f:if condition="{settings.backPid}">
+                               <!-- Link Back -->
+                               <div class="news-backlink-wrap">
+                                       <f:link.page pageUid="{settings.backPid}">
+                                               <f:translate key="back-link" />
+                                       </f:link.page>
+                               </div>
+                       </f:if>
+
+                       <div class="facebook">
+                               <div class="like">
+                                       <n:social.facebook.like></n:social.facebook.like>
+                               </div>
+                               <div class="share">
+                                       <n:social.facebook.share>Share</n:social.facebook.share>
+                               </div>
+                               <div class="twitter">
+                                       <n:social.twitter>Twitter</n:social.twitter>
+                               </div>
+                       </div>
+
+                       <!-- related things -->
+                       <div class="news-related-wrap">
+
+                               <f:if condition="{newsItem.relatedSorted}">
+                                       <!-- Related news records -->
+                                       <div class="news-related news-related-news">
+                                               <h4><f:translate key="related-news" /></h4>
+                                               <ul>
+                                                       <f:for each="{newsItem.relatedSorted}" as="related">
+                                                               <li>
+                                                                       <span class="news-related-news-date"><f:format.date format="d.m.Y">{related.datetime}</f:format.date></span>
+                                                                       <span class="hidden">. </span>
+                                                                       <n:link newsItem="{related}" settings="{settings}">
+                                                                               {related.title}
+                                                                       </n:link>
+                                                               </li>
+
+                                                       </f:for>
+                                               </ul>
+                                       </div>
+                               </f:if>
+
+                               <f:if condition="{newsItem.relatedFiles}">
+                                       <!-- Related files -->
+                                       <div class="news-related news-related-files">
+                                               <h4><f:translate key="related-files" /></h4>
+                                               <ul>
+                                                       <f:for each="{newsItem.relatedFiles}" as="relatedFile">
+                                                               <li>
+                                                                       <span class="news-related-files-link">
+                                                                               <n:format.fileDownload file="uploads/tx_news/{relatedFile.file}" configuration="{settings.relatedFiles.download}">
+                                                                                       <f:if condition="{relatedFile.title}">
+                                                                                               <f:then>
+                                                                                                       {relatedFile.title}
+                                                                                               </f:then>
+                                                                                               <f:else>
+                                                                                                       {relatedFile.file}
+                                                                                               </f:else>
+                                                                                       </f:if>
+                                                                               </n:format.fileDownload>
+                                                                       </span>
+                                                                       <span class="hidden">. </span>
+                                                                       <span class="news-related-files-size">
+                                                                               <n:format.fileSize file="uploads/tx_news/{relatedFile.file}" format="{settings.relatedFiles.fileSizeLabels}" />
+                                                                       </span>
+                                                               </li>
+                                                       </f:for>
+                                               </ul>
+                                       </div>
+                               </f:if>
+
+                               <f:if condition="{newsItem.relatedLinks}">
+                                       <!-- Related links -->
+                                       <div class="news-related news-related-links">
+                                               <h4><f:translate key="related-links" /></h4>
+                                               <ul>
+                                                       <f:for each="{newsItem.relatedLinks}" as="relatedLink">
+                                                               <li>
+                                                                       <f:link.page pageUid="{relatedLink.uri}">{relatedLink.title}</f:link.page>
+                                                               </li>
+                                                       </f:for>
+                                               </ul>
+                                       </div>
+                               </f:if>
+                       </div>
+               </f:then>
+               <f:else>
+
+               </f:else>
+       </f:if>
+</f:section>
\ No newline at end of file
diff --git a/Resources/Private/Templates/News/EventDateMenu.html b/Resources/Private/Templates/News/EventDateMenu.html
new file mode 100644 (file)
index 0000000..3b265ee
--- /dev/null
@@ -0,0 +1,32 @@
+{namespace n=Tx_News_ViewHelpers}\r
+<f:layout name="General" />\r
+<!--\r
+       =====================\r
+               Templates/News/EventDateMenu.html\r
+-->\r
+\r
+<f:section name="content">\r
+       <div class="news-menu-view">\r
+               <ul>\r
+               <f:groupedFor each="{events}" as="newsByYear" groupBy="yearOf{dateField}" groupKey="year">\r
+                       <li>{year}\r
+                               <ul>\r
+                               <f:groupedFor each="{newsByYear}" as="newsByMonth" groupBy="monthOf{dateField}" groupKey="month">\r
+                                               <f:if condition="{0:year, 1:month} == {0:overwriteDemand.year, 1:overwriteDemand.month}">\r
+                                                       <f:then>\r
+                                                               <li class="item itemactive">\r
+                                                       </f:then>\r
+                                                       <f:else>\r
+                                                               <li class="item">\r
+                                                       </f:else>\r
+                                               </f:if>\r
+                                               <f:link.action pageUid="{listPid}" arguments="{overwriteDemand:{year: year, month: month}}" controller="Event"><f:translate key="month.{month}" /> {year}</f:link.action>\r
+                                               (<f:count subject="{newsByMonth}" /> <f:translate key="{f:if(condition: '{f:count(subject: newsByMonth)} == 1', then: 'entry', else: 'entries')}" />)\r
+                                       </li>\r
+                               </f:groupedFor>\r
+                               </ul>\r
+                       </li>\r
+               </f:groupedFor>\r
+               </ul>\r
+       </div>\r
+</f:section>\r
diff --git a/Resources/Private/Templates/News/EventDetail.html b/Resources/Private/Templates/News/EventDetail.html
new file mode 100644 (file)
index 0000000..dba388d
--- /dev/null
@@ -0,0 +1,152 @@
+{namespace n=Tx_News_ViewHelpers}
+{namespace e=Tx_RoqNewsevent_ViewHelpers}
+
+<f:layout name="Detail.html" />
+
+<!--
+       =====================
+               Templates/News/EventDetail.html
+-->
+
+<f:section name="content">
+       <f:if condition="{newsItem}">
+               <f:then>
+                       <n:format.nothing>
+                               <f:if condition="{newsItem.alternativeTitle}">
+                                       <f:then><n:titleTag><n:format.htmlentitiesDecode>{newsItem.alternativeTitle}</n:format.htmlentitiesDecode></n:titleTag></f:then>
+                                       <f:else><n:titleTag><n:format.htmlentitiesDecode>{newsItem.title}</n:format.htmlentitiesDecode></n:titleTag></f:else>
+                               </f:if>
+                               <f:render partial="Detail/Opengraph" arguments="{newsItem: newsItem, settings:settings}"/>
+                       </n:format.nothing>
+                       <div class="header">
+                               <h3>{newsItem.title}</h3>
+                       </div>
+                       <div class="footer" role="contentinfo">
+                               <p>
+                                       <!-- date -->
+                                       <span class="news-list-date">
+                        <f:render partial="Event/Item" arguments="{newsItem: newsItem, settings:settings}"/>
+                                       </span>
+
+                                       <f:if condition="{newsItem.categories}">
+                                               <f:render partial="Category/Items" arguments="{categories:newsItem.categories, settings:settings}"/>
+                                       </f:if>
+
+                                       <f:if condition="{newsItem.author}">
+                                               <!-- author -->
+                                               <span class="hidden">. </span>
+                                               <span class="news-list-author">
+                                                       <f:translate key="author" arguments="{0:newsItem.author}"></f:translate>
+                                               </span>
+                                       </f:if>
+                               </p>
+                       </div>
+
+                       <f:if condition="{newsItem.teaser}">
+                               <!-- teaser -->
+                               <div class="teaser-text">
+                                       {newsItem.teaser}
+                               </div>
+                       </f:if>
+
+                       <f:if condition="{newsItem.contentElements}">
+                               <!-- content elements -->
+                               <f:cObject typoscriptObjectPath="lib.tx_news.contentElementRendering">{newsItem.contentElementIdList}</f:cObject>
+                       </f:if>
+
+                       <f:render partial="Detail/MediaContainer" arguments="{media: newsItem.media, settings:settings}"/>
+
+                       <!-- main text -->
+                       <div class="news-text-wrap">
+                               <f:format.html>{newsItem.bodytext}</f:format.html>
+                       </div>
+
+                       <f:if condition="{settings.backPid}">
+                               <!-- Link Back -->
+                               <div class="news-backlink-wrap">
+                                       <f:link.page pageUid="{settings.backPid}">
+                                               <f:translate key="back-link" />
+                                       </f:link.page>
+                               </div>
+                       </f:if>
+
+                       <div class="facebook">
+                               <div class="like">
+                                       <n:social.facebook.like></n:social.facebook.like>
+                               </div>
+                               <div class="share">
+                                       <n:social.facebook.share>Share</n:social.facebook.share>
+                               </div>
+                               <div class="twitter">
+                                       <n:social.twitter>Twitter</n:social.twitter>
+                               </div>
+                       </div>
+
+                       <!-- related things -->
+                       <div class="news-related-wrap">
+
+                               <f:if condition="{newsItem.relatedSorted}">
+                                       <!-- Related news records -->
+                                       <div class="news-related news-related-news">
+                                               <h4><f:translate key="related-news" /></h4>
+                                               <ul>
+                                                       <f:for each="{newsItem.relatedSorted}" as="related">
+                                                               <li>
+                                                                       <span class="news-related-news-date"><f:format.date format="d.m.Y">{related.datetime}</f:format.date></span>
+                                                                       <span class="hidden">. </span>
+                                                                       <e:link newsItem="{related}" settings="{settings}" action="eventDetail">
+                                                                               {related.title}
+                                                                       </e:link>
+                                                               </li>
+
+                                                       </f:for>
+                                               </ul>
+                                       </div>
+                               </f:if>
+
+                               <f:if condition="{newsItem.relatedFiles}">
+                                       <!-- Related files -->
+                                       <div class="news-related news-related-files">
+                                               <h4><f:translate key="related-files" /></h4>
+                                               <ul>
+                                                       <f:for each="{newsItem.relatedFiles}" as="relatedFile">
+                                                               <li>
+                                                                       <span class="news-related-files-link">
+                                                                               <n:format.fileDownload file="uploads/tx_news/{relatedFile.file}" configuration="{settings.relatedFiles.download}">
+                                                                                       <f:if condition="{relatedFile.title}">
+                                                                                               <f:then>
+                                                                                                       {relatedFile.title}
+                                                                                               </f:then>
+                                                                                               <f:else>
+                                                                                                       {relatedFile.file}
+                                                                                               </f:else>
+                                                                                       </f:if>
+                                                                               </n:format.fileDownload>
+                                                                       </span>
+                                                                       <span class="hidden">. </span>
+                                                                       <span class="news-related-files-size">
+                                                                               <n:format.fileSize file="uploads/tx_news/{relatedFile.file}" format="{settings.relatedFiles.fileSizeLabels}" />
+                                                                       </span>
+                                                               </li>
+                                                       </f:for>
+                                               </ul>
+                                       </div>
+                               </f:if>
+
+                               <f:if condition="{newsItem.relatedLinks}">
+                                       <!-- Related links -->
+                                       <div class="news-related news-related-links">
+                                               <h4><f:translate key="related-links" /></h4>
+                                               <ul>
+                                                       <f:for each="{newsItem.relatedLinks}" as="relatedLink">
+                                                               <li>
+                                                                       <f:link.page pageUid="{relatedLink.uri}">{relatedLink.title}</f:link.page>
+                                                               </li>
+                                                       </f:for>
+                                               </ul>
+                                       </div>
+                               </f:if>
+                       </div>
+               </f:then>
+       </f:if>
+</f:section>
\ No newline at end of file
diff --git a/Resources/Private/Templates/News/EventDetail.ics b/Resources/Private/Templates/News/EventDetail.ics
new file mode 100644 (file)
index 0000000..1cc8795
--- /dev/null
@@ -0,0 +1,11 @@
+BEGIN:VCALENDAR<e:format.trim replaceDoubleSpaces="FALSE">
+
+    {namespace n=Tx_News_ViewHelpers}
+    {namespace e=Tx_RoqNewsevent_ViewHelpers}
+
+    VERSION:2.0
+    PRODID:-//XYZ Corp//My Product//EN
+
+    <f:render partial="Event/Item" arguments="{newsItem: newsItem, settings: settings}"/>
+
+</e:format.trim>
\ No newline at end of file
diff --git a/Resources/Private/Templates/News/EventList.html b/Resources/Private/Templates/News/EventList.html
new file mode 100644 (file)
index 0000000..77fef4b
--- /dev/null
@@ -0,0 +1,32 @@
+{namespace n=Tx_News_ViewHelpers}
+<f:layout name="General" />
+<!--
+       =====================
+               Templates/News/EventList.html
+-->
+
+<f:section name="content">
+<f:if condition="{news}">
+       <f:then>
+               <div class="news-list-view">
+                       <f:if condition="{settings.hidePagination}">
+                               <f:then>
+                                       <f:for each="{news}" as="newsItem">
+                                               <f:render partial="EventList/Item" arguments="{newsItem: newsItem, settings:settings}"/>
+                                       </f:for>
+                               </f:then>
+                               <f:else>
+                                       <n:widget.paginate objects="{news}" as="paginatedNews" configuration="{settings.list.paginate}">
+                                               <f:for each="{paginatedNews}" as="newsItem">
+                                                       <f:render partial="EventList/Item" arguments="{newsItem: newsItem, settings:settings}"/>
+                                               </f:for>
+                                       </n:widget.paginate>
+                               </f:else>
+                       </f:if>
+               </div>
+       </f:then>
+       <f:else>
+               <div class="no-news-found"><f:translate key="list_nonewsfound" /></div>
+       </f:else>
+</f:if>
+</f:section>
diff --git a/Resources/Private/Templates/News/EventList.ics b/Resources/Private/Templates/News/EventList.ics
new file mode 100644 (file)
index 0000000..b7aee50
--- /dev/null
@@ -0,0 +1,16 @@
+BEGIN:VCALENDAR<e:format.trim replaceDoubleSpaces="FALSE">
+
+    {namespace n=Tx_News_ViewHelpers}
+    {namespace e=Tx_RoqNewsevent_ViewHelpers}
+
+    VERSION:2.0
+    PRODID:-//XYZ Corp//My Product//EN
+
+    <f:if condition="{news}">
+        <f:for each="{news}" as="newsItem">
+
+           <f:render partial="Event/Item" arguments="{newsItem: newsItem, settings: settings}"/>
+
+        </f:for>
+    </f:if>
+</e:format.trim>
\ No newline at end of file
diff --git a/Resources/Private/Templates/News/EventList.xml b/Resources/Private/Templates/News/EventList.xml
new file mode 100644 (file)
index 0000000..9fde633
--- /dev/null
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+{namespace n=Tx_News_ViewHelpers}
+{namespace e=Tx_RoqNewsevent_ViewHelpers}
+
+<rss version="2.0">
+       <channel>
+               <title>{settings.list.rss.channel.title}</title>
+               <link>{settings.list.rss.channel.link}</link>
+               <description>{settings.list.rss.channel.description}</description>
+               <language>{settings.list.rss.channel.language}</language>
+               <f:if condition="{settings.list.rss.channel.copyright}">
+                       <copyright>{settings.list.rss.channel.copyright}</copyright>
+               </f:if>
+               <pubDate><n:format.date format="%a, %d %b %Y %T %z" currentDate="1" strftime="1" /></pubDate>
+               <lastBuildDate><n:format.date format="%a, %d %b %Y %T %z" currentDate="1" strftime="1" /></lastBuildDate>
+               <f:if condition="{settings.list.rss.channel.category}">
+                       <category>{settings.list.rss.channel.category}</category>
+               </f:if>
+               <generator>{settings.list.rss.channel.generator}</generator>
+                       <f:if condition="{news}">
+                               <f:for each="{news}" as="newsItem">
+                                       <item>
+                                               <guid>news-{newsItem.uid}</guid>
+                                               <pubDate><n:format.date format="%a, %d %b %Y %T %z" currentDate="1" strftime="1">{newsItem.datetime}</n:format.date></pubDate>
+                                               <title><n:format.hsc>{newsItem.title}</n:format.hsc></title>
+                                               <link><n:link newsItem="{newsItem}" settings="{settings}" configuration="{returnLast:'url'}" hsc="TRUE"></n:link></link>
+                                               <description>
+                            <e:format.trim trimTabs="FALSE">
+                                <n:format.striptags><f:render partial="Event/Item.html" arguments="{newsItem: newsItem, settings:settings}"/></n:format.striptags>
+                                <n:format.hsc><n:format.striptags>{newsItem.teaser}</n:format.striptags></n:format.hsc>
+                            </e:format.trim>
+                        </description>
+                                       </item>
+                               </f:for>
+                       </f:if>
+       </channel>
+</rss>
\ No newline at end of file
diff --git a/Resources/Private/Templates/News/List.html b/Resources/Private/Templates/News/List.html
new file mode 100644 (file)
index 0000000..bf71f94
--- /dev/null
@@ -0,0 +1,32 @@
+{namespace n=Tx_News_ViewHelpers}
+<f:layout name="General" />
+<!--
+       =====================
+               Templates/News/List.html
+-->
+
+<f:section name="content">
+<f:if condition="{news}">
+       <f:then>
+               <div class="news-list-view">
+                       <f:if condition="{settings.hidePagination}">
+                               <f:then>
+                                       <f:for each="{news}" as="newsItem">
+                                               <f:render partial="List/Item" arguments="{newsItem: newsItem, settings:settings}"/>
+                                       </f:for>
+                               </f:then>
+                               <f:else>
+                                       <n:widget.paginate objects="{news}" as="paginatedNews" configuration="{settings.list.paginate}">
+                                               <f:for each="{paginatedNews}" as="newsItem">
+                                                       <f:render partial="List/Item" arguments="{newsItem: newsItem, settings:settings}"/>
+                                               </f:for>
+                                       </n:widget.paginate>
+                               </f:else>
+                       </f:if>
+               </div>
+       </f:then>
+       <f:else>
+               <div class="no-news-found"><f:translate key="list_nonewsfound" /></div>
+       </f:else>
+</f:if>
+</f:section>
diff --git a/Resources/Private/Templates/News/List.xml b/Resources/Private/Templates/News/List.xml
new file mode 100644 (file)
index 0000000..3454b17
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+{namespace n=Tx_News_ViewHelpers}
+<rss version="2.0">
+       <channel>
+               <title>{settings.list.rss.channel.title}</title>
+               <link>{settings.list.rss.channel.link}</link>
+               <description>{settings.list.rss.channel.description}</description>
+               <language>{settings.list.rss.channel.language}</language>
+               <f:if condition="{settings.list.rss.channel.copyright}">
+                       <copyright>{settings.list.rss.channel.copyright}</copyright>
+               </f:if>
+               <pubDate><n:format.date format="%a, %d %b %Y %T %z" currentDate="1" strftime="1" /></pubDate>
+               <lastBuildDate><n:format.date format="%a, %d %b %Y %T %z" currentDate="1" strftime="1" /></lastBuildDate>
+               <f:if condition="{settings.list.rss.channel.category}">
+                       <category>{settings.list.rss.channel.category}</category>
+               </f:if>
+               <generator>{settings.list.rss.channel.generator}</generator>
+                       <f:if condition="{news}">
+                               <f:for each="{news}" as="newsItem">
+                                       <item>
+                                               <guid>news-{newsItem.uid}</guid>
+                                               <pubDate><n:format.date format="%a, %d %b %Y %T %z" currentDate="1" strftime="1">{newsItem.datetime}</n:format.date></pubDate>
+                                               <title><n:format.hsc>{newsItem.title}</n:format.hsc></title>
+                                               <link><n:link newsItem="{newsItem}" settings="{settings}" configuration="{returnLast:'url'}" hsc="TRUE"></n:link></link>
+                                               <description><n:format.hsc><n:format.striptags>{newsItem.teaser}</n:format.striptags></n:format.hsc></description>
+                                       </item>
+                               </f:for>
+                       </f:if>
+       </channel>
+</rss>
\ No newline at end of file
diff --git a/Resources/Private/Templates/News/SearchForm.html b/Resources/Private/Templates/News/SearchForm.html
new file mode 100644 (file)
index 0000000..5298887
--- /dev/null
@@ -0,0 +1,17 @@
+{namespace n=Tx_News_ViewHelpers}
+<f:layout name="General" />
+<!--
+       =====================
+               Templates/News/SearchForm.html
+-->
+
+<f:section name="content">
+       <div class="news-search-form">
+               <f:form object="{search}" name="search">
+                       <fieldset>
+                               <f:form.textfield property="subject" />
+                               <f:form.submit value="{f:translate(key:'search-start')}"/>
+                       </fieldset>
+               </f:form>
+       </div>
+</f:section>
\ No newline at end of file
diff --git a/Resources/Private/Templates/News/SearchResult.html b/Resources/Private/Templates/News/SearchResult.html
new file mode 100644 (file)
index 0000000..85aa857
--- /dev/null
@@ -0,0 +1,28 @@
+{namespace n=Tx_News_ViewHelpers}
+<f:layout name="General" />
+<!--
+       =====================
+               Templates/News/SearchResult.html
+-->
+
+<f:section name="content">
+       <div class="news-search-result">
+               <f:if condition="{search}">
+                       <f:if condition="{news}">
+                               <f:then>
+                                       <div class="count-msg">
+                                               <f:translate key="search-text" arguments="{0:'{f:count(subject:news)}',1:search.subject}" />
+                                       </div>
+                                       <f:for each="{news}" as="newsItem">
+                                               <f:render partial="List/Item" arguments="{newsItem: newsItem, settings:settings, className:className, view:'list'}"/>
+                                       </f:for>
+                               </f:then>
+                               <f:else>
+                                       <div class="no-news-found">
+                                               <f:translate key="search-noresult" />
+                                       </div>
+                               </f:else>
+                       </f:if>
+               </f:if>
+       </div>
+</f:section>
\ No newline at end of file
diff --git a/Resources/Public/Icons/relation.gif b/Resources/Public/Icons/relation.gif
new file mode 100644 (file)
index 0000000..db61d7e
Binary files /dev/null and b/Resources/Public/Icons/relation.gif differ
diff --git a/Resources/Public/Icons/tx_news_domain_model_news.gif b/Resources/Public/Icons/tx_news_domain_model_news.gif
new file mode 100644 (file)
index 0000000..6cc5f16
Binary files /dev/null and b/Resources/Public/Icons/tx_news_domain_model_news.gif differ
diff --git a/Tests/Unit/Controller/EventControllerTest.php b/Tests/Unit/Controller/EventControllerTest.php
new file mode 100644 (file)
index 0000000..cb93899
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Test case for class Tx_Roq_newsevent_Controller_EventController.
+ *
+ * @version $Id$
+ * @copyright Copyright belongs to the respective authors
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
+ *
+ * @package TYPO3
+ * @subpackage News event
+ *
+ */
+class Tx_Roq_newsevent_Controller_EventControllerTest extends Tx_Extbase_Tests_Unit_BaseTestCase {
+       /**
+        * @var Tx_RoqNewsevent_Domain_Model_Event
+        */
+       protected $fixture;
+
+       public function setUp() {
+               $this->fixture = new Tx_RoqNewsevent_Domain_Model_Event();
+       }
+
+       public function tearDown() {
+               unset($this->fixture);
+       }
+
+       /**
+        * @test
+        */
+       public function dummyMethod() {
+               $this->markTestIncomplete();
+       }
+
+}
+?>
\ No newline at end of file
diff --git a/Tests/Unit/Domain/Model/EventTest.php b/Tests/Unit/Domain/Model/EventTest.php
new file mode 100644 (file)
index 0000000..916ad41
--- /dev/null
@@ -0,0 +1,109 @@
+<?php
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Test case for class Tx_RoqNewsevent_Domain_Model_Event.
+ *
+ * @version $Id$
+ * @copyright Copyright belongs to the respective authors
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
+ *
+ * @package TYPO3
+ * @subpackage News event
+ *
+ */
+class Tx_RoqNewsevent_Domain_Model_EventTest extends Tx_Extbase_Tests_Unit_BaseTestCase {
+       /**
+        * @var Tx_RoqNewsevent_Domain_Model_Event
+        */
+       protected $fixture;
+
+       public function setUp() {
+               $this->fixture = new Tx_RoqNewsevent_Domain_Model_Event();
+       }
+
+       public function tearDown() {
+               unset($this->fixture);
+       }
+
+       /**
+        * @test
+        */
+       public function getEventStartdateReturnsInitialValueForDate() { }
+
+       /**
+        * @test
+        */
+       public function setEventStartdateForDateSetsEventStartdate() { }
+       
+       /**
+        * @test
+        */
+       public function getEventStarttimeReturnsInitialValueForInt() { }
+
+       /**
+        * @test
+        */
+       public function setEventStarttimeForIntSetsEventStarttime() { }
+       
+       /**
+        * @test
+        */
+       public function getEventEnddateReturnsInitialValueForDate() { }
+
+       /**
+        * @test
+        */
+       public function setEventEnddateForDateSetsEventEnddate() { }
+       
+       /**
+        * @test
+        */
+       public function getEventEndtimeReturnsInitialValueForInt() { }
+
+       /**
+        * @test
+        */
+       public function setEventEndtimeForIntSetsEventEndtime() { }
+       
+       /**
+        * @test
+        */
+       public function getEventLocationReturnsInitialValueForString() { }
+
+       /**
+        * @test
+        */
+       public function setEventLocationForStringSetsEventLocation() { 
+               $this->fixture->setEventLocation('Conceived at T3CON10');
+
+               $this->assertSame(
+                       'Conceived at T3CON10',
+                       $this->fixture->getEventLocation()
+               );
+       }
+       
+}
+?>
\ No newline at end of file
diff --git a/doc/manual.sxw b/doc/manual.sxw
new file mode 100644 (file)
index 0000000..49c32b5
Binary files /dev/null and b/doc/manual.sxw differ
diff --git a/ext_emconf.php b/ext_emconf.php
new file mode 100644 (file)
index 0000000..1845d28
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+
+########################################################################
+# Extension Manager/Repository config file for ext "roq_newsevent".
+#
+# Auto generated 16-08-2012 16:49
+#
+# Manual updates:
+# Only the data in the array - everything else is removed by next
+# writing. "version" and "dependencies" must not be touched!
+########################################################################
+
+$EM_CONF[$_EXTKEY] = array(
+       'title' => 'News event',
+       'description' => 'Event extension based on the versatile news system extension and Extbase & Fluid. Supplies additional event functionality to news records.',
+       'category' => 'plugin',
+       'author' => 'Jochem de Groot',
+       'author_email' => 'jochem@roquin.nl',
+       'author_company' => 'ROQUIN B.V.',
+       'shy' => '',
+       'priority' => '',
+       'module' => '',
+       'state' => 'stable',
+       'internal' => '',
+       'uploadfolder' => 0,
+       'createDirs' => '',
+       'modify_tables' => '',
+       'clearCacheOnLoad' => 0,
+       'lockType' => '',
+       'version' => '2.0.0',
+       'constraints' => array(
+               'depends' => array(
+                       'extbase' => '1.3',
+                       'fluid' => '1.3',
+                       'typo3' => '4.5-0.0.0',
+                       'news' => '1.4',
+               ),
+               'conflicts' => array(
+               ),
+               'suggests' => array(
+               ),
+       ),
+       '_md5_values_when_last_written' => 'a:55:{s:9:"Changelog";s:4:"cf98";s:21:"ExtensionBuilder.json";s:4:"9fe9";s:12:"ext_icon.gif";s:4:"1c9b";s:17:"ext_localconf.php";s:4:"5fea";s:14:"ext_tables.php";s:4:"1ff1";s:14:"ext_tables.sql";s:4:"f920";s:38:"Classes/Controller/EventController.php";s:4:"810f";s:30:"Classes/Domain/Model/Event.php";s:4:"c888";s:45:"Classes/Domain/Repository/EventRepository.php";s:4:"1535";s:36:"Classes/ViewHelpers/IfViewHelper.php";s:4:"0625";s:38:"Classes/ViewHelpers/LinkViewHelper.php";s:4:"39e8";s:43:"Classes/ViewHelpers/TranslateViewHelper.php";s:4:"0a4e";s:45:"Classes/ViewHelpers/Format/TimeViewHelper.php";s:4:"586d";s:45:"Classes/ViewHelpers/Format/TrimViewHelper.php";s:4:"b1fc";s:44:"Configuration/ExtensionBuilder/settings.yaml";s:4:"406d";s:27:"Configuration/TCA/Event.php";s:4:"a0fd";s:38:"Configuration/TypoScript/constants.txt";s:4:"c80e";s:34:"Configuration/TypoScript/setup.txt";s:4:"2bf2";s:40:"Resources/Private/Language/locallang.xml";s:4:"9ac8";s:70:"Resources/Private/Language/locallang_csh_tx_news_domain_model_news.xml";s:4:"cd7c";s:43:"Resources/Private/Language/locallang_db.xml";s:4:"cec7";s:37:"Resources/Private/Layouts/Detail.html";s:4:"759f";s:38:"Resources/Private/Layouts/General.html";s:4:"4776";s:46:"Resources/Private/Layouts/Backend/Default.html";s:4:"fe83";s:54:"Resources/Private/Partials/Administration/Buttons.html";s:4:"1a84";s:55:"Resources/Private/Partials/Administration/ListItem.html";s:4:"2eaf";s:46:"Resources/Private/Partials/Category/Items.html";s:4:"bee7";s:53:"Resources/Private/Partials/Detail/MediaContainer.html";s:4:"29ed";s:47:"Resources/Private/Partials/Detail/MediaDam.html";s:4:"df99";s:48:"Resources/Private/Partials/Detail/MediaHtml.html";s:4:"14e2";s:49:"Resources/Private/Partials/Detail/MediaImage.html";s:4:"4fdd";s:49:"Resources/Private/Partials/Detail/MediaVideo.html";s:4:"2993";s:48:"Resources/Private/Partials/Detail/Opengraph.html";s:4:"3410";s:42:"Resources/Private/Partials/Event/Item.html";s:4:"7995";s:41:"Resources/Private/Partials/Event/Item.ics";s:4:"8e8e";s:41:"Resources/Private/Partials/Event/Item.xml";s:4:"a115";s:46:"Resources/Private/Partials/EventList/Item.html";s:4:"c6d5";s:41:"Resources/Private/Partials/List/Item.html";s:4:"03b5";s:46:"Resources/Private/Templates/News/DateMenu.html";s:4:"d916";s:44:"Resources/Private/Templates/News/Detail.html";s:4:"1b07";s:51:"Resources/Private/Templates/News/EventDateMenu.html";s:4:"d404";s:49:"Resources/Private/Templates/News/EventDetail.html";s:4:"0eac";s:48:"Resources/Private/Templates/News/EventDetail.ics";s:4:"ebd0";s:47:"Resources/Private/Templates/News/EventList.html";s:4:"4a1a";s:46:"Resources/Private/Templates/News/EventList.ics";s:4:"8638";s:46:"Resources/Private/Templates/News/EventList.xml";s:4:"f91c";s:42:"Resources/Private/Templates/News/List.html";s:4:"69ec";s:41:"Resources/Private/Templates/News/List.xml";s:4:"ebf6";s:48:"Resources/Private/Templates/News/SearchForm.html";s:4:"4cc4";s:50:"Resources/Private/Templates/News/SearchResult.html";s:4:"07cf";s:35:"Resources/Public/Icons/relation.gif";s:4:"e615";s:52:"Resources/Public/Icons/tx_news_domain_model_news.gif";s:4:"905a";s:45:"Tests/Unit/Controller/EventControllerTest.php";s:4:"33b1";s:37:"Tests/Unit/Domain/Model/EventTest.php";s:4:"a8e5";s:14:"doc/manual.sxw";s:4:"07dd";}',
+);
+
+?>
\ No newline at end of file
diff --git a/ext_icon.gif b/ext_icon.gif
new file mode 100644 (file)
index 0000000..9c220e1
Binary files /dev/null and b/ext_icon.gif differ
diff --git a/ext_localconf.php b/ext_localconf.php
new file mode 100644 (file)
index 0000000..8c5a9a5
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+
+if (!defined ('TYPO3_MODE')) {
+       die ('Access denied.');
+}
+
+$GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['switchableControllerActions']['newItems']['--div--'] = 'Events';
+$GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['switchableControllerActions']['newItems']['News->eventList;News->eventDetail'] = 'List view';
+$GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['switchableControllerActions']['newItems']['News->eventDetail'] = 'Detail view';
+$GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['switchableControllerActions']['newItems']['News->eventDateMenu'] = 'Date menu';
+
+?>
\ No newline at end of file
diff --git a/ext_tables.php b/ext_tables.php
new file mode 100644 (file)
index 0000000..9969708
--- /dev/null
@@ -0,0 +1,69 @@
+<?php
+if (!defined('TYPO3_MODE')) {
+       die ('Access denied.');
+}
+
+t3lib_extMgm::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'News event');
+
+$tmp_roq_newsevent_columns = array(
+
+       'tx_roqnewsevent_startdate' => array(
+               'exclude' => 0,
+               'label' => 'LLL:EXT:roq_newsevent/Resources/Private/Language/locallang_db.xml:tx_roqnewsevent_startdate',
+               'config' => array(
+                       'type' => 'input',
+                       'size' => 7,
+                       'eval' => 'date,required',
+                       'checkbox' => 1,
+               ),
+       ),
+       'tx_roqnewsevent_starttime' => array(
+               'exclude' => 0,
+               'label' => 'LLL:EXT:roq_newsevent/Resources/Private/Language/locallang_db.xml:tx_roqnewsevent_starttime',
+               'config' => array(
+                       'type' => 'input',
+                       'size' => 4,
+                       'eval' => 'time',
+                       'checkbox' => 1,
+               ),
+       ),
+       'tx_roqnewsevent_enddate' => array(
+               'exclude' => 0,
+               'label' => 'LLL:EXT:roq_newsevent/Resources/Private/Language/locallang_db.xml:tx_roqnewsevent_enddate',
+               'config' => array(
+                       'type' => 'input',
+                       'size' => 7,
+                       'eval' => 'date',
+                       'checkbox' => 1,
+               ),
+       ),
+       'tx_roqnewsevent_endtime' => array(
+               'exclude' => 0,
+               'label' => 'LLL:EXT:roq_newsevent/Resources/Private/Language/locallang_db.xml:tx_roqnewsevent_endtime',
+               'config' => array(
+                       'type' => 'input',
+                       'size' => 4,
+                       'eval' => 'time',
+                       'checkbox' => 1,
+               ),
+       ),
+       'tx_roqnewsevent_location' => array(
+               'exclude' => 0,
+               'label' => 'LLL:EXT:roq_newsevent/Resources/Private/Language/locallang_db.xml:tx_roqnewsevent_location',
+               'config' => array(
+                       'type' => 'input',
+                       'size' => 30,
+                       'eval' => 'trim'
+               ),
+       ),
+);
+
+t3lib_extMgm::addTCAcolumns('tx_news_domain_model_news',$tmp_roq_newsevent_columns);
+
+$TCA['tx_news_domain_model_news']['columns'][$TCA['tx_news_domain_model_news']['ctrl']['type']]['config']['items'][] = array('LLL:EXT:roq_newsevent/Resources/Private/Language/locallang_db.xml:tx_news_domain_model_news.tx_extbase_type.Tx_RoqNewsevent_Event','Tx_RoqNewsevent_Event');
+
+$TCA['tx_news_domain_model_news']['types']['Tx_RoqNewsevent_Event']['showitem'] = $TCA['tx_news_domain_model_news']['types']['0']['showitem'];
+$TCA['tx_news_domain_model_news']['types']['Tx_RoqNewsevent_Event']['showitem'] .= ',--div--;LLL:EXT:roq_newsevent/Resources/Private/Language/locallang_db.xml:tx_roqnewsevent_domain_model_event,';
+$TCA['tx_news_domain_model_news']['types']['Tx_RoqNewsevent_Event']['showitem'] .= 'tx_roqnewsevent_startdate, tx_roqnewsevent_starttime, tx_roqnewsevent_enddate, tx_roqnewsevent_endtime, tx_roqnewsevent_location';
+
+?>
\ No newline at end of file
diff --git a/ext_tables.sql b/ext_tables.sql
new file mode 100644 (file)
index 0000000..3a9222f
--- /dev/null
@@ -0,0 +1,12 @@
+#
+# Table structure for table 'tx_news_domain_model_news'
+#
+CREATE TABLE tx_news_domain_model_news (
+
+       tx_roqnewsevent_startdate int(11) DEFAULT '0' NOT NULL,
+       tx_roqnewsevent_starttime int(11) DEFAULT '0' NOT NULL,
+       tx_roqnewsevent_enddate int(11) DEFAULT '0' NOT NULL,
+       tx_roqnewsevent_endtime int(11) DEFAULT '0' NOT NULL,
+       tx_roqnewsevent_location varchar(255) DEFAULT '' NOT NULL,
+
+);
\ No newline at end of file