Lowered the News dependency to 1.3.2. Also modified templates to use the event DateVi...
authorjdegroot <jdegroot@735d13b6-9817-0410-8766-e36946ffe9aa>
Fri, 5 Oct 2012 10:53:19 +0000 (10:53 +0000)
committerjdegroot <jdegroot@735d13b6-9817-0410-8766-e36946ffe9aa>
Fri, 5 Oct 2012 10:53:19 +0000 (10:53 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/roq_newsevent/trunk@66646 735d13b6-9817-0410-8766-e36946ffe9aa

Classes/ViewHelpers/Format/DateViewHelper.php [new file with mode: 0644]
Resources/Private/Partials/Event/Item.html
Resources/Private/Partials/Event/Item.ics
Resources/Private/Templates/News/EventList.xml
ext_emconf.php

diff --git a/Classes/ViewHelpers/Format/DateViewHelper.php b/Classes/ViewHelpers/Format/DateViewHelper.php
new file mode 100644 (file)
index 0000000..94b67a0
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2011 Georg Ringer <typo3@ringerge.org>
+*  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!
+***************************************************************/
+
+/**
+ * ViewHelper to format a date, using strftime
+ *
+ * @package TYPO3
+ * @subpackage tx_news
+ */
+class Tx_RoqNewsevent_ViewHelpers_Format_DateViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractViewHelper {
+
+       /**
+        * Render the supplied DateTime object as a formatted date.
+        *
+        * @param mixed $date 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
+        * @param bool $currentDate if true, the current date is used
+        * @param bool $strftime if true, the strftime is used instead of date()
+        * @return string Formatted date
+        */
+       public function render($date = NULL, $format = '%Y-%m-%d', $currentDate = FALSE, $strftime = TRUE) {
+               if ($currentDate) {
+                       if ($strftime) {
+                               return strftime($format, $GLOBALS['EXEC_TIME']);
+                       } else {
+                               return date($format, $GLOBALS['EXEC_TIME']);
+                       }
+               }
+
+               if ($date === NULL) {
+                       $date = $this->renderChildren();
+                       if ($date === NULL) {
+                               return '';
+                       }
+               }
+               if (!$date instanceof DateTime) {
+                       try {
+                               $date = new DateTime($date);
+                       } catch (Exception $exception) {
+                               throw new Tx_Fluid_Core_ViewHelper_Exception('"' . $date . '" could not be parsed by DateTime constructor.', 1241722579);
+                       }
+               }
+
+               if ($strftime) {
+                       return strftime($format, $date->format('U'));
+               } else {
+                       return date($format, $date->format('U'));
+               }
+       }
+}
+?>
\ No newline at end of file
index 49bc604..e6665b9 100644 (file)
@@ -10,7 +10,7 @@
         <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>
+                <strong><e:translate key="event_date" />:</strong> <e:format.date strftime="1" format="%d %B %Y">{newsItem.eventStartdate}</e:format.date> <e:translate key="event_till" /> <e:format.date strftime="1" format="%d %B %Y">{newsItem.eventEnddate}</e:format.date>
 
                 <f:if condition="{newsItem.eventEndtime}">
                     <f:then>
@@ -23,7 +23,7 @@
             </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>
+                <strong><e:translate key="event_date" />:</strong> <e:format.date strftime="1" format="%d %B %Y">{newsItem.eventStartdate}</e:format.date> <e:translate key="event_till" /> <e:format.date strftime="1" format="%d %B %Y">{newsItem.eventEnddate}</e:format.date>
             </f:else>
         </f:if>
     </f:then>
@@ -32,7 +32,7 @@
         <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>
+                <strong><e:translate key="event_date" />:</strong> <e:format.date strftime="1" format="%d %B %Y">{newsItem.eventStartdate}</e:format.date>
 
                 <f:if condition="{newsItem.eventEndtime}">
                     <f:then>
@@ -45,7 +45,7 @@
             </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>
+                <strong><e:translate key="event_date" />:</strong> <e:format.date strftime="1" format="%d %B %Y">{newsItem.eventStartdate}</e:format.date>
             </f:else>
         </f:if>
     </f:else>
index 683ac57..9137d1b 100644 (file)
@@ -4,7 +4,7 @@
 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>
+DTSTAMP:<e:format.date format="%Y%m%dT%H%I%SZ" strftime="1">{newsItem.datetime}</e:format.date>
 
 <e:if condition="'<f:format.date>{newsItem.eventEnddate}</f:format.date>' != ''">
     <!-- Multiple day event -->
index 9fde633..cd80d83 100644 (file)
@@ -11,8 +11,8 @@
                <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>
+               <pubDate><e:format.date format="%a, %d %b %Y %T %z" currentDate="1" strftime="1" /></pubDate>
+               <lastBuildDate><e: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>
@@ -21,7 +21,7 @@
                                <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>
+                                               <pubDate><e:format.date format="%a, %d %b %Y %T %z" currentDate="1" strftime="1">{newsItem.datetime}</e: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>
index 783e1fe..f8ddf33 100644 (file)
@@ -3,7 +3,7 @@
 ########################################################################
 # Extension Manager/Repository config file for ext "roq_newsevent".
 #
-# Auto generated 19-09-2012 14:31
+# Auto generated 28-09-2012 12:31
 #
 # Manual updates:
 # Only the data in the array - everything else is removed by next
@@ -24,8 +24,8 @@ $EM_CONF[$_EXTKEY] = array(
        'internal' => '',
        'uploadfolder' => 0,
        'createDirs' => '',
-       'modify_tables' => '',
-       'clearCacheOnLoad' => 0,
+       'modify_tables' => 'tx_news_domain_model_news',
+       'clearCacheOnLoad' => 1,
        'lockType' => '',
        'version' => '2.0.2',
        'constraints' => array(
@@ -33,14 +33,14 @@ $EM_CONF[$_EXTKEY] = array(
                        'extbase' => '1.3',
                        'fluid' => '1.3',
                        'typo3' => '4.5-0.0.0',
-                       'news' => '1.4',
+                       'news' => '1.3.2',
                ),
                'conflicts' => array(
                ),
                'suggests' => array(
                ),
        ),
-       '_md5_values_when_last_written' => 'a:57:{s:9:"Changelog";s:4:"cf98";s:21:"ExtensionBuilder.json";s:4:"9fe9";s:12:"ext_icon.gif";s:4:"d6cc";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:"b8f8";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:"4813";s:70:"Resources/Private/Language/locallang_csh_tx_news_domain_model_news.xml";s:4:"818b";s:43:"Resources/Private/Language/locallang_db.xml";s:4:"44d7";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.pdf";s:4:"92af";s:14:"doc/manual.sxw";s:4:"c9d1";s:14:"doc/manual.txt";s:4:"27bc";}',
+       '_md5_values_when_last_written' => 'a:59:{s:9:"Changelog";s:4:"cf98";s:21:"ExtensionBuilder.json";s:4:"c6aa";s:20:"class.ext_update.php";s:4:"77b8";s:12:"ext_icon.gif";s:4:"d6cc";s:17:"ext_localconf.php";s:4:"5fea";s:14:"ext_tables.php";s:4:"9c2f";s:14:"ext_tables.sql";s:4:"9803";s:38:"Classes/Controller/EventController.php";s:4:"b8f8";s:30:"Classes/Domain/Model/Event.php";s:4:"cd86";s:45:"Classes/Domain/Repository/EventRepository.php";s:4:"cffe";s:36:"Classes/ViewHelpers/IfViewHelper.php";s:4:"0625";s:38:"Classes/ViewHelpers/LinkViewHelper.php";s:4:"0155";s:43:"Classes/ViewHelpers/TranslateViewHelper.php";s:4:"0a4e";s:45:"Classes/ViewHelpers/Format/DateViewHelper.php";s:4:"f7f1";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:"e6c0";s:40:"Resources/Private/Language/locallang.xml";s:4:"eb43";s:70:"Resources/Private/Language/locallang_csh_tx_news_domain_model_news.xml";s:4:"9c21";s:43:"Resources/Private/Language/locallang_db.xml";s:4:"5fff";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:"ab77";s:41:"Resources/Private/Partials/Event/Item.ics";s:4:"26ac";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:"6808";s:42:"Resources/Private/Templates/News/List.html";s:4:"69ec";s:41:"Resources/Private/Templates/News/List.xml";s:4:"6339";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:"0bbc";s:14:"doc/manual.pdf";s:4:"02d4";s:14:"doc/manual.sxw";s:4:"e9bd";s:14:"doc/manual.txt";s:4:"b5d0";}',
 );
 
 ?>
\ No newline at end of file