Fine tune sample code
authorfab1en <fab1en@735d13b6-9817-0410-8766-e36946ffe9aa>
Thu, 10 Nov 2011 02:54:18 +0000 (02:54 +0000)
committerfab1en <fab1en@735d13b6-9817-0410-8766-e36946ffe9aa>
Thu, 10 Nov 2011 02:54:18 +0000 (02:54 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/phpdisplay/trunk@53977 735d13b6-9817-0410-8766-e36946ffe9aa

samples/dummy.php

index d354592..6b4f62d 100644 (file)
@@ -1 +1 @@
-<!-- Looping around $records -->\r<b>It works!</b> See content of FILE:EXT:phpdisplay/samples/dummy.php to have more examples.\r<br />\r\r<!-- PHP TEMPLATE SYNTAX FOR HTML -->\r<?php if (! empty($datastructure['page']['records'])): ?>\r <?php foreach($datastructure['page']['records'] as $record): ?>\r                <?php print $record['title'] ?>\r        <?php endforeach ?>\r<?php endif ?>\r\r<?php\r      // debug\r       #t3lib_div::debug($datastructure,'debug');\r     #t3lib_div::debug($filter,'debug');\r    \r       // CObj\r        $localCObj = t3lib_div::makeInstance('tslib_cObj');\r    $localCObj->start(array(), '');\r        \r       // Parameters\r  $parameters = t3lib_div::_GP('tx_displaycontroller');\r  \r       // FE USER\r     $feUser = $GLOBALS['TSFE']->fe_user->user;\r     $feUserUid = $GLOBALS['TSFE']->fe_user->user['uid']; \r\r // link\r        $localCObj->start($record);\r    $config = array();\r     $config['returnLast'] = 'url';\r $config['parameter.']['data'] = 'TSFE:tmpl|setup|plugin.|tx_speciality.|courses_detail_pid';\r   $config['additionalParams'] = '&tx_displaycontroller[table]=courses&tx_displaycontroller[showUid]={field:uid}';\r        $config['additionalParams.']['insertData'] = 1;\r        $link = $localCObj->typolink('',$config);\r\r     // Generating thumbnails\r       $configThumbnail = array();\r    $configThumbnail['file'] = $record['file'];\r    $configThumbnail['altText'] = $record['title'];\r        $configThumbnail['file.']['height'] = 70; \r     $configThumbnail['file.']['width'] = 50; \r      $configThumbnail['file.']['minW'] = 70; \r       $configThumbnail['file.']['minH'] = 50; \r       $htmlThumbnail = $localCObj->IMAGE($configThumbnail);\r\r\r        // Generating thumbnails from PDF\r      $configThumbnail = array();\r    $configThumbnail['file'] = $record['file'];\r    $configThumbnail['altText'] = $record['title'];\r        $configThumbnail['file.']['height'] = 70; \r     $configThumbnail['file.']['width'] = 50; \r      $configThumbnail['file.']['minW'] = 70; \r       $configThumbnail['file.']['minH'] = 50; \r       $configThumbnail['file.']['import.']['cObject'] = 'IMG_RESOURCE';\r      $configThumbnail['file.']['import.']['cObject.']['ext'] = 'jpg';\r       $configThumbnail['file.']['import.']['cObject.']['quality'] = '100';\r   $configThumbnail['file.']['import.']['cObject.']['file.']['params'] = '-trim';\r $configThumbnail['file.']['import.']['cObject.']['file'] = $configThumbnail['file'];\r   $configThumbnail['file.']['import.']['cObject.']['file.']['width'] = '1080';\r   $htmlThumbnail = $localCObj->IMAGE($configThumbnail);\r  \r       // TypoScript configuration\r    $configuration = $TSFE->tmpl->setup['config.'];\r        \r       // Language support\r    $LANG = t3lib_div::makeInstance('Language');\r   $LANG->lang = $configuration['language'];\r      $LANG->charSet = 'utf-8';\r      $LANG->includeLLFile('EXT:speciality/Resources/Private/locallang.xml');\r        \r       print $LANG->getLL('cat');\r     print $LANG->sL('LLL:EXT:speciality/Resources/Private/locallang.xml');\r \r       // RTE\r $config['parseFunc.'] = $GLOBALS['TSFE']->tmpl->setup['lib.']['parseFunc_RTE.'];\r       $config['value'] = $record['bodytext'];\r        $value = $localCObj->TEXT($config);\r    \r       // PAGEBROWSE\r  $conf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_pagebrowse_pi1.'];\r        $conf['pageParameterName'] = 'tx_displaycontroller|page';\r      \r       \r       // Adds limit to the query and calculates the number of pages.\r if ($filter['limit']['max'] != '' && $filter['limit']['max'] != '0') {\r         //$conf['extraQueryString'] .= '&' . $this->pObj->getPrefixId() . '[max]=' . $filter['limit']['max'];\r          $conf['numberOfPages'] = ceil($datastructure['news']['totalCount'] / $filter['limit']['max']);\r         $conf['items_per_page'] = $filter['limit']['max'];\r             $conf['total_items'] = $datastructure['news']['totalCount'];\r           $conf['total_pages'] = $conf['numberOfPages']; // duplicated, because $conf['numberOfPages'] is protected\r      }\r      else {\r         $conf['numberOfPages'] = 1;\r    }\r      \r       // Defines other possible pagebrowse configuration options\r     #$conf['enableMorePages'] = '';\r        #$conf['enableLessPages'] = '';\r        #$conf['pagesBefore'] = '';\r    #$conf['pagesAfter'] = '';\r     \r       /* @var $cObj tslib_cObj */\r    print $localCObj->cObjGetSingle('USER', $conf);\r?>\r
\ No newline at end of file
+<!-- Looping around $records -->\r<b>It works!</b> See content of FILE:EXT:phpdisplay/samples/dummy.php to have more examples.\r<br />\r\r<!-- PHP TEMPLATE SYNTAX FOR HTML -->\r<?php if (! empty($datastructure['page']['records'])): ?>\r <?php foreach($datastructure['page']['records'] as $record): ?>\r                <?php print $record['title'] ?>\r        <?php endforeach ?>\r<?php endif ?>\r\r<?php\r      // debug\r       #t3lib_div::debug($datastructure,'debug');\r     #t3lib_div::debug($filter,'debug');\r    \r       // CObj\r        $localCObj = t3lib_div::makeInstance('tslib_cObj');\r    $localCObj->start(array(), '');\r        \r       // Parameters\r  $parameters = t3lib_div::_GP('tx_displaycontroller');\r  \r       // FE USER\r     $feUser = $GLOBALS['TSFE']->fe_user->user;\r     $feUserUid = $GLOBALS['TSFE']->fe_user->user['uid']; \r\r // link\r        $localCObj->start($record);\r    $config = array();\r     $config['returnLast'] = 'url';\r $config['parameter.']['data'] = 'TSFE:tmpl|setup|plugin.|tx_speciality.|courses_detail_pid';\r   $config['additionalParams'] = '&tx_displaycontroller[table]=courses&tx_displaycontroller[showUid]={field:uid}';\r        $config['additionalParams.']['insertData'] = 1;\r        $link = $localCObj->typolink('',$config);\r\r     // Generating thumbnails\r       $configThumbnail = array();\r    $configThumbnail['file'] = $record['file'];\r    $configThumbnail['altText'] = $record['title'];\r        $configThumbnail['file.']['height'] = 70; \r     $configThumbnail['file.']['width'] = 50; \r      $configThumbnail['file.']['minW'] = 70; \r       $configThumbnail['file.']['minH'] = 50; \r       $htmlThumbnail = $localCObj->IMAGE($configThumbnail);\r\r\r        // Generating thumbnails from PDF\r      $configThumbnail = array();\r    $configThumbnail['file'] = $record['file'];\r    $configThumbnail['altText'] = $record['title'];\r        #$configThumbnail['file.']['height'] = 70; \r    $configThumbnail['file.']['width'] = 50; \r      #$configThumbnail['file.']['minW'] = 70; \r      #$configThumbnail['file.']['minH'] = 50; \r      $configThumbnail['file.']['import.']['cObject'] = 'IMG_RESOURCE';\r      $configThumbnail['file.']['import.']['cObject.']['ext'] = 'jpg';\r       $configThumbnail['file.']['import.']['cObject.']['quality'] = '100';\r   $configThumbnail['file.']['import.']['cObject.']['file.']['params'] = '-trim';\r $configThumbnail['file.']['import.']['cObject.']['file'] = $configThumbnail['file'];\r   #$configThumbnail['file.']['import.']['cObject.']['file.']['width'] = '1080';\r  $htmlThumbnail = $localCObj->IMAGE($configThumbnail);\r  \r       // TypoScript configuration\r    $configuration = $TSFE->tmpl->setup['config.'];\r        \r       // Language support\r    $LANG = t3lib_div::makeInstance('Language');\r   $LANG->lang = $configuration['language'];\r      $LANG->charSet = 'utf-8';\r      $LANG->includeLLFile('EXT:speciality/Resources/Private/locallang.xml');\r        \r       print $LANG->getLL('cat');\r     print $LANG->sL('LLL:EXT:speciality/Resources/Private/locallang.xml');\r \r       // RTE\r $config['parseFunc.'] = $GLOBALS['TSFE']->tmpl->setup['lib.']['parseFunc_RTE.'];\r       $config['value'] = $record['bodytext'];\r        $value = $localCObj->TEXT($config);\r    \r       // PAGEBROWSE\r  $conf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_pagebrowse_pi1.'];\r        $conf['pageParameterName'] = 'tx_displaycontroller|page';\r      \r       \r       // Adds limit to the query and calculates the number of pages.\r if ($filter['limit']['max'] != '' && $filter['limit']['max'] != '0') {\r         //$conf['extraQueryString'] .= '&' . $this->pObj->getPrefixId() . '[max]=' . $filter['limit']['max'];\r          $conf['numberOfPages'] = ceil($datastructure['news']['totalCount'] / $filter['limit']['max']);\r         $conf['items_per_page'] = $filter['limit']['max'];\r             $conf['total_items'] = $datastructure['news']['totalCount'];\r           $conf['total_pages'] = $conf['numberOfPages']; // duplicated, because $conf['numberOfPages'] is protected\r      }\r      else {\r         $conf['numberOfPages'] = 1;\r    }\r      \r       // Defines other possible pagebrowse configuration options\r     #$conf['enableMorePages'] = '';\r        #$conf['enableLessPages'] = '';\r        #$conf['pagesBefore'] = '';\r    #$conf['pagesAfter'] = '';\r     \r       /* @var $cObj tslib_cObj */\r    print $localCObj->cObjGetSingle('USER', $conf);\r?>\r
\ No newline at end of file