[FEATURE] Add "Show lists from username" 92/23192/2
authorNicole Cordes <cordes@cps-it.de>
Sat, 17 Aug 2013 23:36:12 +0000 (01:36 +0200)
committerNicole Cordes <typo3@cordes.co>
Mon, 19 Aug 2013 22:52:58 +0000 (00:52 +0200)
Add a new plugin function to show all lists from an user. Extend
template to support different output formats.

Releases: 1.0
Change-Id: I2a886525c6657ebc09fabc123ed418a106d910cb
Reviewed-on: https://review.typo3.org/23192
Reviewed-by: Nicole Cordes
Tested-by: Nicole Cordes
Classes/Controller/TwitterController.php
Classes/Domain/Repository/TweetRepository.php
Classes/Twitter/Api.php
Configuration/Flexforms/flexform.xml
Resources/Private/Language/locallang.xml [new file with mode: 0644]
Resources/Private/Language/locallang_db.xml
Resources/Private/Partials/Lists/Show.html [new file with mode: 0644]
Resources/Private/Partials/Tweets/Show.html [new file with mode: 0644]
Resources/Private/Templates/Twitter/List.html

index ae80566..687fdbf 100644 (file)
@@ -84,6 +84,9 @@ class Tx_WtTwitter_Controller_TwitterController extends Tx_Extbase_MVC_Controlle
                        case 'showFromSearch':
                                $tweets = $this->tweetRepository->getTweetsFromSearch($this->settings, $response);
                                break;
+                       case 'showListsFrom':
+                               $tweets = $this->tweetRepository->getListsFromUser($this->settings, $response);
+                               break;
                }
                // Look up for any errors
                if ($response !== '') {
index 6d7ba77..4efda0d 100644 (file)
@@ -95,7 +95,7 @@ class Tx_WtTwitter_Domain_Repository_TweetRepository {
                        $tweets = $this->callApi(Tx_WtTwitter_Twitter_Api::getStatusesUserTimelineUrl(), 'GET', $parameter, $response);
                }
 
-               return $this->addOldUserInformation($this->sliceTweets($tweets, $settings['limit']));
+               return $this->addOldUserInformation($this->sliceArray($tweets, $settings['limit']));
        }
 
        /**
@@ -115,7 +115,54 @@ class Tx_WtTwitter_Domain_Repository_TweetRepository {
                        $tweets = $result->statuses;
                }
 
-               return $this->addOldUserInformation($this->sliceTweets($tweets, $settings['limit']));
+               return $this->addOldUserInformation($this->sliceArray($tweets, $settings['limit']));
+       }
+
+       public function getListsFromUser($settings, &$response = NULL) {
+               $lists = array();
+
+               if ($this->isTwitterSigned()&& $this->isCurlActivated()) {
+                       $parameter = array(
+                               'count' => ((int) $settings['limit'] > 0 ? $settings['limit'] : '1000'),
+                               'cursor' => '-1'
+                       );
+
+                       // Get screen name
+                       if (Tx_WtTwitter_Utility_Compatibility::testInt($settings['account'])) {
+                               $parameter['user_id'] = $settings['account'];
+                       } else {
+                               $parameter['screen_name'] = $settings['account'];
+                       }
+
+                       $result = $this->callApi(Tx_WtTwitter_Twitter_Api::getListsOwnershipsUrl(), 'GET', $parameter, $response);
+                       $lists = $result->lists;
+
+                       usort($lists, function($a, $b) use ($settings) {
+                               switch ($settings['orderby']) {
+                                       case 'subscriberCount':
+                                               $valueA = (int) $a->subscriber_count;
+                                               $valueB = (int) $b->subscriber_count;
+                                               break;
+                                       case 'memberCount':
+                                               $valueA = (int) $a->member_count;
+                                               $valueB = (int) $b->member_count;
+                                               break;
+                                       default:
+                                               $dateA = new DateTime($a->created_at);
+                                               $valueA = $dateA->getTimestamp();
+                                               $dateB = new DateTime($b->created_at);
+                                               $valueB = $dateB->getTimestamp();
+                               }
+
+                               if ($valueA === $valueB) {
+                                       return 0;
+                               }
+
+                               return ($valueA > $valueB) ? -1 : 1;
+                       });
+               }
+
+               return $lists;
        }
 
        /**
@@ -171,16 +218,16 @@ class Tx_WtTwitter_Domain_Repository_TweetRepository {
        }
 
        /**
-        * @param array $tweets
+        * @param array $array
         * @param integer $count
         * @return array
         */
-       protected function sliceTweets(array $tweets, $count) {
-               if (count($tweets) <= $count) {
-                       return $tweets;
+       protected function sliceArray(array $array, $count) {
+               if (empty($count) || count($array) <= $count) {
+                       return $array;
                }
 
-               return array_slice($tweets, 0, $count);
+               return array_slice($array, 0, $count);
        }
 
        /**
index 4cbef79..3fd10ec 100644 (file)
@@ -57,6 +57,13 @@ final class Tx_WtTwitter_Twitter_Api {
        /**
         * @return string
         */
+       public static function getListsOwnershipsUrl() {
+               return 'https://api.twitter.com/1.1/lists/ownerships.json';
+       }
+
+       /**
+        * @return string
+        */
        public static function getSearchTweetsUrl() {
                return 'https://api.twitter.com/1.1/search/tweets.json';
        }
index f2ce76a..206fd9e 100644 (file)
-<T3DataStructure>\r
-       <meta>\r
-               <langDisable>1</langDisable>\r
-       </meta>\r
-       <sheets>\r
-               <main>\r
-                       <ROOT>\r
-                               <TCEforms>\r
-                                       <sheetTitle>LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.sheet_main</sheetTitle>\r
-                               </TCEforms>\r
-                               <type>array</type>\r
-                               <el>\r
-                                       <settings.flexform.mode>\r
-                                               <TCEforms>\r
-                                                       <label>LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.mode</label>\r
-                                                       <onChange>reload</onChange>\r
-                                                       <config>\r
-                                                               <type>select</type>\r
-                                                               <items type="array">\r
-                                                                       <numIndex index="0" type="array">\r
-                                                                               <numIndex index="0">LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.mode.0</numIndex>\r
-                                                                               <numIndex index="1">showOwn</numIndex>\r
-                                                                       </numIndex>\r
-                                                                       <!--\r
-                                                                       <numIndex index="1" type="array">\r
-                                                                               <numIndex index="0">LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.mode.1</numIndex>\r
-                                                                               <numIndex index="1">showHome</numIndex>\r
-                                                                       </numIndex>\r
-                                                                       <numIndex index="2" type="array">\r
-                                                                               <numIndex index="0">LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.mode.2</numIndex>\r
-                                                                               <numIndex index="1">showFriends</numIndex>\r
-                                                                       </numIndex>\r
-                                                                       -->\r
-                                                                       <numIndex index="3" type="array">\r
-                                                                               <numIndex index="0">LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.mode.3</numIndex>\r
-                                                                               <numIndex index="1">showFromSearch</numIndex>\r
-                                                                       </numIndex>\r
-                                                               </items>\r
-                                                               <maxitems>1</maxitems>\r
-                                                               <size>1</size>\r
-                                                       </config>\r
-                                               </TCEforms>\r
-                                       </settings.flexform.mode>\r
-                                       <settings.flexform.account>\r
-                                               <TCEforms>\r
-                                                       <exclude>1</exclude>\r
-                                                       <label>LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.account</label>\r
-                                                       <displayCond>FIELD:settings.flexform.mode:=:showOwn</displayCond>\r
-                                                       <config>\r
-                                                               <type>input</type>\r
-                                                               <size>20</size>\r
-                                                       </config>\r
-                                               </TCEforms>\r
-                                       </settings.flexform.account>\r
-                                       <settings.flexform.hashtag>\r
-                                               <TCEforms>\r
-                                                       <exclude>1</exclude>\r
-                                                       <label>LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.hashtag</label>\r
-                                                       <displayCond>FIELD:settings.flexform.mode:=:showFromSearch</displayCond>\r
-                                                       <config>\r
-                                                               <type>input</type>\r
-                                                               <size>20</size>\r
-                                                       </config>\r
-                                               </TCEforms>\r
-                                       </settings.flexform.hashtag>\r
-                                       <settings.flexform.limit>\r
-                                               <TCEforms>\r
-                                                       <exclude>1</exclude>\r
-                                                       <label>LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.limit</label>\r
-                                                       <config>\r
-                                                               <type>input</type>\r
-                                                               <size>4</size>\r
-                                                       </config>\r
-                                               </TCEforms>\r
-                                       </settings.flexform.limit>\r
-                               </el>\r
-                       </ROOT>\r
-               </main>\r
-       </sheets>\r
+<T3DataStructure>
+       <meta>
+               <langDisable>1</langDisable>
+       </meta>
+       <sheets>
+               <main>
+                       <ROOT>
+                               <TCEforms>
+                                       <sheetTitle>LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.sheet_main</sheetTitle>
+                               </TCEforms>
+                               <type>array</type>
+                               <el>
+                                       <settings.flexform.mode>
+                                               <TCEforms>
+                                                       <label>LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.mode</label>
+                                                       <onChange>reload</onChange>
+                                                       <config>
+                                                               <type>select</type>
+                                                               <items type="array">
+                                                                       <numIndex index="0" type="array">
+                                                                               <numIndex index="0">LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.mode.0</numIndex>
+                                                                               <numIndex index="1">showOwn</numIndex>
+                                                                       </numIndex>
+                                                                       <!--
+                                                                       <numIndex index="1" type="array">
+                                                                               <numIndex index="0">LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.mode.1</numIndex>
+                                                                               <numIndex index="1">showHome</numIndex>
+                                                                       </numIndex>
+                                                                       <numIndex index="2" type="array">
+                                                                               <numIndex index="0">LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.mode.2</numIndex>
+                                                                               <numIndex index="1">showFriends</numIndex>
+                                                                       </numIndex>
+                                                                       -->
+                                                                       <numIndex index="3" type="array">
+                                                                               <numIndex index="0">LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.mode.3</numIndex>
+                                                                               <numIndex index="1">showFromSearch</numIndex>
+                                                                       </numIndex>
+                                                                       <numIndex index="4" type="array">
+                                                                               <numIndex index="0">LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.mode.4</numIndex>
+                                                                               <numIndex index="1">showListsFrom</numIndex>
+                                                                       </numIndex>
+                                                               </items>
+                                                               <maxitems>1</maxitems>
+                                                               <size>1</size>
+                                                       </config>
+                                               </TCEforms>
+                                       </settings.flexform.mode>
+                                       <settings.flexform.account>
+                                               <TCEforms>
+                                                       <exclude>1</exclude>
+                                                       <label>LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.account</label>
+                                                       <displayCond>FIELD:settings.flexform.mode:IN:showOwn,showListsFrom</displayCond>
+                                                       <config>
+                                                               <type>input</type>
+                                                               <size>20</size>
+                                                       </config>
+                                               </TCEforms>
+                                       </settings.flexform.account>
+                                       <settings.flexform.hashtag>
+                                               <TCEforms>
+                                                       <exclude>1</exclude>
+                                                       <label>LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.hashtag</label>
+                                                       <displayCond>FIELD:settings.flexform.mode:=:showFromSearch</displayCond>
+                                                       <config>
+                                                               <type>input</type>
+                                                               <size>20</size>
+                                                       </config>
+                                               </TCEforms>
+                                       </settings.flexform.hashtag>
+                                       <settings.flexform.orderby>
+                                               <TCEforms>
+                                                       <exclude>1</exclude>
+                                                       <label>LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.orderby</label>
+                                                       <displayCond>FIELD:settings.flexform.mode:IN:showListsFrom</displayCond>
+                                                       <config>
+                                                               <type>select</type>
+                                                               <items type="array">
+                                                                       <numIndex index="0" type="array">
+                                                                               <numIndex index="0">LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.orderby.0</numIndex>
+                                                                               <numIndex index="1">createdAt</numIndex>
+                                                                       </numIndex>
+                                                                       <numIndex index="1" type="array">
+                                                                               <numIndex index="0">LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.orderby.1</numIndex>
+                                                                               <numIndex index="1">subscriberCount</numIndex>
+                                                                       </numIndex>
+                                                                       <numIndex index="2" type="array">
+                                                                               <numIndex index="0">LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.orderby.2</numIndex>
+                                                                               <numIndex index="1">memberCount</numIndex>
+                                                                       </numIndex>
+                                                               </items>
+                                                               <maxitems>1</maxitems>
+                                                               <size>1</size>
+                                                       </config>
+                                               </TCEforms>
+                                       </settings.flexform.orderby>
+                                       <settings.flexform.limit>
+                                               <TCEforms>
+                                                       <exclude>1</exclude>
+                                                       <label>LLL:EXT:wt_twitter/Resources/Private/Language/locallang_db.xml:pi_flexform.limit</label>
+                                                       <config>
+                                                               <type>input</type>
+                                                               <size>4</size>
+                                                       </config>
+                                               </TCEforms>
+                                       </settings.flexform.limit>
+                               </el>
+                       </ROOT>
+               </main>
+       </sheets>
 </T3DataStructure>
\ 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..1067314
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>\r
+<T3locallang>\r
+       <meta type="array">\r
+               <type>database</type>\r
+               <description>Language labels for database tables/fields belonging to extension 'wt_twitter'</description>\r
+       </meta>\r
+       <data type="array">\r
+               <languageKey index="default" type="array">\r
+                       <label index="members">members</label>\r
+                       <label index="subscribers">subscribers</label>\r
+               </languageKey>\r
+               <languageKey index="de" type="array">\r
+                       <label index="members">Mitglieder</label>\r
+                       <label index="subscribers">Abonnenten</label>\r
+               </languageKey>\r
+       </data>\r
+</T3locallang>
\ No newline at end of file
index 2b3d5cf..d39f8fa 100644 (file)
@@ -1,37 +1,47 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>\r
-<T3locallang>\r
-       <meta type="array">\r
-               <type>database</type>\r
-               <description>Language labels for database tables/fields belonging to extension 'wt_twitter'</description>\r
-       </meta>\r
-       <data type="array">\r
-               <languageKey index="default" type="array">\r
-                       <label index="tt_content.list_type_pi1">Show Twitter Feeds</label>\r
-                       <label index="pi_flexform.sheet_main">Main Settings</label>\r
-                       <label index="pi_flexform.account">Username</label>\r
-                       <label index="pi_flexform.password">Twitter Password</label>\r
-                       <label index="pi_flexform.mode">Mode</label>\r
-                       <label index="pi_flexform.mode.0">Show tweets by username</label>\r
-                       <label index="pi_flexform.mode.1">Show Own and Friend Tweets</label>\r
-                       <label index="pi_flexform.mode.2">Show Friends Tweets</label>\r
-                       <label index="pi_flexform.mode.3">Show Tweets from search term</label>\r
-                       <label index="pi_flexform.template">Path to HTML template (optional)</label>\r
-                       <label index="pi_flexform.limit">Limit (optional)</label>\r
-                       <label index="pi_flexform.hashtag">Enter a hashtag</label>\r
-               </languageKey>\r
-               <languageKey index="de" type="array">\r
-                       <label index="tt_content.list_type_pi1">Zeige Twitter Eintr├Ąge</label>\r
-                       <label index="pi_flexform.sheet_main">Einstellungen</label>\r
-                       <label index="pi_flexform.account">Twitter Account</label>\r
-                       <label index="pi_flexform.password">Twitter Passwort</label>\r
-                       <label index="pi_flexform.mode">Modus</label>\r
-                       <label index="pi_flexform.mode.0">Zeige Tweets von einem Benutzer</label>\r
-                       <label index="pi_flexform.mode.1">Zeige eigene und befreundete Tweets</label>\r
-                       <label index="pi_flexform.mode.2">Zeige befreundete Tweets</label>\r
-                       <label index="pi_flexform.mode.3">Zeige Tweets anhand von Suchbegriff</label>\r
-                       <label index="pi_flexform.template">HTML Template Pfad (optional)</label>\r
-                       <label index="pi_flexform.limit">Limit (optional)</label>\r
-                       <label index="pi_flexform.hashtag">Suche nach Hashtag</label>\r
-               </languageKey>\r
-       </data>\r
+<?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 'wt_twitter'</description>
+       </meta>
+       <data type="array">
+               <languageKey index="default" type="array">
+                       <label index="tt_content.list_type_pi1">Show Twitter Feeds</label>
+                       <label index="pi_flexform.sheet_main">Main Settings</label>
+                       <label index="pi_flexform.template">Path to HTML template (optional)</label>
+                       <label index="pi_flexform.account">Username</label>
+                       <label index="pi_flexform.password">Twitter Password</label>
+                       <label index="pi_flexform.mode">Mode</label>
+                       <label index="pi_flexform.mode.0">Show tweets by username</label>
+                       <label index="pi_flexform.mode.1">Show Own and Friend Tweets</label>
+                       <label index="pi_flexform.mode.2">Show Friends Tweets</label>
+                       <label index="pi_flexform.mode.3">Show Tweets from search term</label>
+                       <label index="pi_flexform.mode.4">Show lists from username</label>
+                       <label index="pi_flexform.hashtag">Enter a hashtag</label>
+                       <label index="pi_flexform.orderby">Order by</label>
+                       <label index="pi_flexform.orderby.0">Creation date</label>
+                       <label index="pi_flexform.orderby.1">Subscriber count</label>
+                       <label index="pi_flexform.orderby.2">Member count</label>
+                       <label index="pi_flexform.limit">Limit (optional)</label>
+               </languageKey>
+               <languageKey index="de" type="array">
+                       <label index="tt_content.list_type_pi1">Zeige Twitter Eintr├Ąge</label>
+                       <label index="pi_flexform.sheet_main">Einstellungen</label>
+                       <label index="pi_flexform.template">HTML Template Pfad (optional)</label>
+                       <label index="pi_flexform.account">Twitter Account</label>
+                       <label index="pi_flexform.password">Twitter Passwort</label>
+                       <label index="pi_flexform.mode">Modus</label>
+                       <label index="pi_flexform.mode.0">Zeige Tweets von einem Benutzer</label>
+                       <label index="pi_flexform.mode.1">Zeige eigene und befreundete Tweets</label>
+                       <label index="pi_flexform.mode.2">Zeige befreundete Tweets</label>
+                       <label index="pi_flexform.mode.3">Zeige Tweets anhand von Suchbegriff</label>
+                       <label index="pi_flexform.mode.4">Zeige Listen von einem Benutzer</label>
+                       <label index="pi_flexform.hashtag">Suche nach Hashtag</label>
+                       <label index="pi_flexform.orderby">Sortieren nach</label>
+                       <label index="pi_flexform.orderby.0">Erstellungsdatum</label>
+                       <label index="pi_flexform.orderby.1">Anzahl der Abonnenten</label>
+                       <label index="pi_flexform.orderby.2">Anzahle der Mitglieder</label>
+                       <label index="pi_flexform.limit">Limit (optional)</label>
+               </languageKey>
+       </data>
 </T3locallang>
\ No newline at end of file
diff --git a/Resources/Private/Partials/Lists/Show.html b/Resources/Private/Partials/Lists/Show.html
new file mode 100644 (file)
index 0000000..b516ced
--- /dev/null
@@ -0,0 +1,16 @@
+<f:for each="{lists}" as="list">
+       <li style="padding: 10px; min-height: 40px;">
+               <f:link.external uri="https://www.twitter.com{list.uri}" target="_blank" >{list.name}</f:link.external>
+               <f:if condition="{list.description}">
+                       <f:then>
+                               <br />
+                               {list.description}
+                       </f:then>
+               </f:if>
+               <br />
+               {list.member_count} <f:translate key="members" />
+               <br />
+               {list.subscriber_count} <f:translate key="subscribers" />
+               <div style="clear: both"></div>
+       </li>
+</f:for>
\ No newline at end of file
diff --git a/Resources/Private/Partials/Tweets/Show.html b/Resources/Private/Partials/Tweets/Show.html
new file mode 100644 (file)
index 0000000..6983767
--- /dev/null
@@ -0,0 +1,16 @@
+<f:for each="{tweets}" as="tweet">
+       <li style="padding: 10px; min-height: 40px;">
+               <f:if condition="{tweet.from_user}">
+                       <f:link.external uri="http://twitter.com/{tweet.from_user}" target="_blank">
+                               <img src="{tweet.profile_image_url}" alt="{tweet.from_user}" class="wt_twitter_profile_image" style="float: left; margin-right: 10px; border: 0;" />
+                       </f:link.external>
+                       <f:link.external uri="http://twitter.com/{tweet.from_user}" target="_blank">{tweet.from_user}</f:link.external>
+               </f:if>
+
+               {tweet -> f:cObject(typoscriptObjectPath: 'plugin.tx_wttwitter.settings.setup.tweets.created_at', currentValueKey: 'created_at')}<br />
+
+               {tweet -> f:cObject(typoscriptObjectPath: 'plugin.tx_wttwitter.settings.setup.tweets.text', currentValueKey: 'text')}
+
+               <div style="clear: both"></div>
+       </li>
+</f:for>
\ No newline at end of file
index 5ac3d1b..802d44e 100644 (file)
@@ -1,21 +1,20 @@
 <div id="wt_twitter_newsticker">\r
        <f:flashMessages class="wt_twitter_errors" style="background-color: #FBB19B; padding: 5px 30px; font-weight: bold; border: 1px solid #DC4C42; margin-bottom: 20px; font-family: arial, verdana; color: #444; font-size: 12px;" />\r
        <ul class="wttwitter_feed" style="list-style-type: none;">\r
-               <f:for each="{tweets}" as="tweet">\r
-                       <li style="padding: 10px; min-height: 40px;">\r
-                               <f:if condition="{tweet.from_user}">\r
-                                       <f:link.external uri="http://twitter.com/{tweet.from_user}" target="_blank">\r
-                                               <img src="{tweet.profile_image_url}" alt="{tweet.from_user}" class="wt_twitter_profile_image" style="float: left; margin-right: 10px; border: 0;" />\r
-                                       </f:link.external>\r
-                                       <f:link.external uri="http://twitter.com/{tweet.from_user}" target="_blank">{tweet.from_user}</f:link.external>\r
-                               </f:if>\r
-\r
-                               {tweet -> f:cObject(typoscriptObjectPath: 'plugin.tx_wttwitter.settings.setup.tweets.created_at', currentValueKey: 'created_at')}<br />\r
-\r
-                               {tweet -> f:cObject(typoscriptObjectPath: 'plugin.tx_wttwitter.settings.setup.tweets.text', currentValueKey: 'text')}\r
-\r
-                               <div style="clear: both"></div>\r
-                       </li>\r
-               </f:for>\r
+               <f:if condition="{0: settings.mode} == {0: 'showOwn'}">\r
+                       <f:then>\r
+                               <f:render partial="Tweets/Show" arguments="{tweets: tweets}" />\r
+                       </f:then>\r
+               </f:if>\r
+               <f:if condition="{0: settings.mode} == {0: 'showFromSearch'}">\r
+                       <f:then>\r
+                               <f:render partial="Tweets/Show" arguments="{tweets: tweets}" />\r
+                       </f:then>\r
+               </f:if>\r
+               <f:if condition="{0: settings.mode} == {0: 'showListsFrom'}">\r
+                       <f:then>\r
+                               <f:render partial="Lists/Show" arguments="{lists: tweets}" />\r
+                       </f:then>\r
+               </f:if>\r
        </ul>\r
 </div>
\ No newline at end of file