@@ -43,21 +43,21 @@ discard block |
||
43 | 43 | * @var array |
44 | 44 | * @access protected |
45 | 45 | */ |
46 | - protected $formats = array ( |
|
47 | - 'oai_dc' => array ( |
|
46 | + protected $formats = array( |
|
47 | + 'oai_dc' => array( |
|
48 | 48 | 'schema' => 'http://www.openarchives.org/OAI/2.0/oai_dc.xsd', |
49 | 49 | 'namespace' => 'http://www.openarchives.org/OAI/2.0/oai_dc/', |
50 | - 'requiredFields' => array ('record_id'), |
|
50 | + 'requiredFields' => array('record_id'), |
|
51 | 51 | ), |
52 | - 'epicur' => array ( |
|
52 | + 'epicur' => array( |
|
53 | 53 | 'schema' => 'http://www.persistent-identifier.de/xepicur/version1.0/xepicur.xsd', |
54 | 54 | 'namespace' => 'urn:nbn:de:1111-2004033116', |
55 | - 'requiredFields' => array ('purl', 'urn'), |
|
55 | + 'requiredFields' => array('purl', 'urn'), |
|
56 | 56 | ), |
57 | - 'mets' => array ( |
|
57 | + 'mets' => array( |
|
58 | 58 | 'schema' => 'http://www.loc.gov/standards/mets/version17/mets.v1-7.xsd', |
59 | 59 | 'namespace' => 'http://www.loc.gov/METS/', |
60 | - 'requiredFields' => array ('location'), |
|
60 | + 'requiredFields' => array('location'), |
|
61 | 61 | ) |
62 | 62 | ); |
63 | 63 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | if ($GLOBALS['TYPO3_DB']->sql_affected_rows() === -1) { |
80 | 80 | // Deletion failed. |
81 | - $this->devLog('[tx_dlf_oai->deleteExpiredTokens()] Could not delete expired resumption tokens',SYSLOG_SEVERITY_WARNING); |
|
81 | + $this->devLog('[tx_dlf_oai->deleteExpiredTokens()] Could not delete expired resumption tokens', SYSLOG_SEVERITY_WARNING); |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | protected function getUrlParams() { |
111 | 111 | |
112 | - $allowedParams = array ( |
|
112 | + $allowedParams = array( |
|
113 | 113 | 'verb', |
114 | 114 | 'identifier', |
115 | 115 | 'metadataPrefix', |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | ); |
121 | 121 | |
122 | 122 | // Clear plugin variables. |
123 | - $this->piVars = array (); |
|
123 | + $this->piVars = array(); |
|
124 | 124 | |
125 | 125 | // Set only allowed parameters. |
126 | 126 | foreach ($allowedParams as $param) { |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | } |
423 | 423 | |
424 | 424 | // Add request. |
425 | - $linkConf = array ( |
|
425 | + $linkConf = array( |
|
426 | 426 | 'parameter' => $GLOBALS['TSFE']->id, |
427 | 427 | 'forceAbsoluteUrl' => 1 |
428 | 428 | ); |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
632 | 632 | 'tx_dlf_documents.tstamp AS tstamp', |
633 | 633 | 'tx_dlf_documents', |
634 | - 'tx_dlf_documents.pid=' . intval($this->conf['pages']), |
|
634 | + 'tx_dlf_documents.pid='.intval($this->conf['pages']), |
|
635 | 635 | '', |
636 | 636 | 'tx_dlf_documents.tstamp ASC', |
637 | 637 | '1' |
@@ -641,10 +641,10 @@ discard block |
||
641 | 641 | list ($timestamp) = $GLOBALS['TYPO3_DB']->sql_fetch_row($result); |
642 | 642 | $earliestDatestamp = gmdate('Y-m-d\TH:i:s\Z', $timestamp); |
643 | 643 | } else { |
644 | - $this->devLog('[tx_dlf_oai->verbIdentify()] No records found with PID "' . $this->conf['pages'] . '"',SYSLOG_SEVERITY_NOTICE); |
|
644 | + $this->devLog('[tx_dlf_oai->verbIdentify()] No records found with PID "'.$this->conf['pages'].'"', SYSLOG_SEVERITY_NOTICE); |
|
645 | 645 | } |
646 | 646 | |
647 | - $linkConf = array ( |
|
647 | + $linkConf = array( |
|
648 | 648 | 'parameter' => $GLOBALS['TSFE']->id, |
649 | 649 | 'forceAbsoluteUrl' => 1 |
650 | 650 | ); |
@@ -653,12 +653,12 @@ discard block |
||
653 | 653 | // Add identification node. |
654 | 654 | $Identify = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'Identify'); |
655 | 655 | $Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'repositoryName', $repositoryName)); |
656 | - $Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/','baseURL', $baseURL)); |
|
657 | - $Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/','protocolVersion', '2.0')); |
|
658 | - $Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/','adminEmail', $adminEmail)); |
|
659 | - $Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/','earliestDatestamp', $earliestDatestamp)); |
|
660 | - $Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/','deletedRecord', 'transient')); |
|
661 | - $Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/','granularity', 'YYYY-MM-DDThh:mm:ssZ')); |
|
656 | + $Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'baseURL', $baseURL)); |
|
657 | + $Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'protocolVersion', '2.0')); |
|
658 | + $Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'adminEmail', $adminEmail)); |
|
659 | + $Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'earliestDatestamp', $earliestDatestamp)); |
|
660 | + $Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'deletedRecord', 'transient')); |
|
661 | + $Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'granularity', 'YYYY-MM-DDThh:mm:ssZ')); |
|
662 | 662 | |
663 | 663 | return $Identify; |
664 | 664 | } |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | |
702 | 702 | $resultSet->reset(); |
703 | 703 | $resultSet->add($documentSet); |
704 | - $resultSet->metadata = array ( |
|
704 | + $resultSet->metadata = array( |
|
705 | 705 | 'completeListSize' => count($documentSet), |
706 | 706 | 'metadataPrefix' => $this->piVars['metadataPrefix'], |
707 | 707 | ); |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | */ |
720 | 720 | protected function verbListMetadataFormats() { |
721 | 721 | |
722 | - $resArray = array (); |
|
722 | + $resArray = array(); |
|
723 | 723 | |
724 | 724 | // Check for invalid arguments. |
725 | 725 | if (count($this->piVars) > 1) { |
@@ -810,7 +810,7 @@ discard block |
||
810 | 810 | |
811 | 811 | $resultSet->reset(); |
812 | 812 | $resultSet->add($documentSet); |
813 | - $resultSet->metadata = array ( |
|
813 | + $resultSet->metadata = array( |
|
814 | 814 | 'completeListSize' => count($documentSet), |
815 | 815 | 'metadataPrefix' => $this->piVars['metadataPrefix'], |
816 | 816 | ); |
@@ -892,8 +892,8 @@ discard block |
||
892 | 892 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
893 | 893 | 'tx_dlf_collections.index_name AS index_name, tx_dlf_collections.uid AS uid, tx_dlf_collections.index_search as index_query ', |
894 | 894 | 'tx_dlf_collections', |
895 | - 'tx_dlf_collections.pid=' . intval($this->conf['pages']) . ' AND tx_dlf_collections.oai_name=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->piVars['set'], |
|
896 | - 'tx_dlf_collections') . $where . tx_dlf_helper::whereClause('tx_dlf_collections'), |
|
895 | + 'tx_dlf_collections.pid='.intval($this->conf['pages']).' AND tx_dlf_collections.oai_name='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->piVars['set'], |
|
896 | + 'tx_dlf_collections').$where.tx_dlf_helper::whereClause('tx_dlf_collections'), |
|
897 | 897 | '', |
898 | 898 | '', |
899 | 899 | '1' |
@@ -905,10 +905,10 @@ discard block |
||
905 | 905 | |
906 | 906 | $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result); |
907 | 907 | |
908 | - if($resArray['index_query'] != "") { |
|
909 | - $solr_query .= '(' . $resArray['index_query'] . ')'; |
|
908 | + if ($resArray['index_query'] != "") { |
|
909 | + $solr_query .= '('.$resArray['index_query'].')'; |
|
910 | 910 | } else { |
911 | - $solr_query .= 'collection:' . '"' . $resArray['index_name'] . '"'; |
|
911 | + $solr_query .= 'collection:'.'"'.$resArray['index_name'].'"'; |
|
912 | 912 | } |
913 | 913 | |
914 | 914 | } else { |
@@ -919,7 +919,7 @@ discard block |
||
919 | 919 | |
920 | 920 | // Check for required fields. |
921 | 921 | foreach ($this->formats[$this->piVars['metadataPrefix']]['requiredFields'] as $required) { |
922 | - $solr_query .= ' NOT ' . $required . ':""'; |
|
922 | + $solr_query .= ' NOT '.$required.':""'; |
|
923 | 923 | } |
924 | 924 | |
925 | 925 | $from = "*"; |
@@ -933,7 +933,7 @@ discard block |
||
933 | 933 | $timestamp = gmmktime($date_array['tm_hour'], $date_array['tm_min'], $date_array['tm_sec'], $date_array['tm_mon'] + 1, |
934 | 934 | $date_array['tm_mday'], $date_array['tm_year'] + 1900); |
935 | 935 | |
936 | - $from = date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) .'.000Z'; |
|
936 | + $from = date("Y-m-d", $timestamp).'T'.date("H:i:s", $timestamp).'.000Z'; |
|
937 | 937 | |
938 | 938 | } else { |
939 | 939 | throw new Exception('badArgument'); |
@@ -951,7 +951,7 @@ discard block |
||
951 | 951 | $timestamp = gmmktime($date_array['tm_hour'], $date_array['tm_min'], $date_array['tm_sec'], $date_array['tm_mon'] + 1, |
952 | 952 | $date_array['tm_mday'], $date_array['tm_year'] + 1900); |
953 | 953 | |
954 | - $until = date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) . '.999Z'; |
|
954 | + $until = date("Y-m-d", $timestamp).'T'.date("H:i:s", $timestamp).'.999Z'; |
|
955 | 955 | |
956 | 956 | if ($from != "*" && $from > $until) { |
957 | 957 | throw new Exception('badArgument'); |
@@ -969,7 +969,7 @@ discard block |
||
969 | 969 | } |
970 | 970 | } |
971 | 971 | |
972 | - $solr_query .= ' AND timestamp:[' . $from . ' TO ' . $until .']'; |
|
972 | + $solr_query .= ' AND timestamp:['.$from.' TO '.$until.']'; |
|
973 | 973 | |
974 | 974 | $documentSet = array(); |
975 | 975 | |
@@ -1005,7 +1005,7 @@ discard block |
||
1005 | 1005 | 'tx_dlf_documents', |
1006 | 1006 | 'tx_dlf_relations', |
1007 | 1007 | 'tx_dlf_collections', |
1008 | - 'AND tx_dlf_documents.uid IN (' . implode(',', $GLOBALS['TYPO3_DB']->cleanIntArray($documentsToProcess)) . ') AND tx_dlf_documents.pid=' . intval($this->conf['pages']) . ' AND tx_dlf_collections.pid=' . intval($this->conf['pages']) . ' AND tx_dlf_relations.ident=' . $GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations') . tx_dlf_helper::whereClause('tx_dlf_collections'), |
|
1008 | + 'AND tx_dlf_documents.uid IN ('.implode(',', $GLOBALS['TYPO3_DB']->cleanIntArray($documentsToProcess)).') AND tx_dlf_documents.pid='.intval($this->conf['pages']).' AND tx_dlf_collections.pid='.intval($this->conf['pages']).' AND tx_dlf_relations.ident='.$GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations').tx_dlf_helper::whereClause('tx_dlf_collections'), |
|
1009 | 1009 | 'tx_dlf_documents.uid', |
1010 | 1010 | 'tx_dlf_documents.tstamp', |
1011 | 1011 | $this->conf['limit'] |
@@ -1053,7 +1053,7 @@ discard block |
||
1053 | 1053 | $metadata = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'metadata'); |
1054 | 1054 | |
1055 | 1055 | $metadataPrefix = $this->piVars['metadataPrefix']; |
1056 | - if(!$metadataPrefix) { |
|
1056 | + if (!$metadataPrefix) { |
|
1057 | 1057 | // If we resume an action the metadataPrefix is stored with the documentSet |
1058 | 1058 | $metadataPrefix = $documentListSet->metadata['metadataPrefix']; |
1059 | 1059 | } |
@@ -1108,15 +1108,15 @@ discard block |
||
1108 | 1108 | ) |
1109 | 1109 | ); |
1110 | 1110 | |
1111 | - if($GLOBALS['TYPO3_DB']->sql_affected_rows() == 1) { |
|
1111 | + if ($GLOBALS['TYPO3_DB']->sql_affected_rows() == 1) { |
|
1112 | 1112 | $resumptionToken->setAttribute('resumptionToken', htmlspecialchars($token, ENT_NOQUOTES, 'UTF-8')); |
1113 | 1113 | } else { |
1114 | - $this->devLog('[tx_dlf_oai->verb'. $this->piVars['verb'] .'()] Could not create resumption token', SYSLOG_SEVERITY_ERROR); |
|
1114 | + $this->devLog('[tx_dlf_oai->verb'.$this->piVars['verb'].'()] Could not create resumption token', SYSLOG_SEVERITY_ERROR); |
|
1115 | 1115 | } |
1116 | 1116 | } |
1117 | 1117 | |
1118 | 1118 | $resumptionToken->setAttribute('cursor', intval($documentListSet->metadata['completeListSize']) - count($documentListSet)); |
1119 | - $resumptionToken->setAttribute('completeListSize', $documentListSet->metadata['completeListSize']); |
|
1119 | + $resumptionToken->setAttribute('completeListSize', $documentListSet->metadata['completeListSize']); |
|
1120 | 1120 | $resumptionToken->setAttribute('expirationDate', gmdate('Y-m-d\TH:i:s\Z', $GLOBALS['EXEC_TIME'] + $this->conf['expired'])); |
1121 | 1121 | |
1122 | 1122 | return $resumptionToken; |
@@ -1130,7 +1130,7 @@ discard block |
||
1130 | 1130 | |
1131 | 1131 | } |
1132 | 1132 | |
1133 | -if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/plugins/oai/class.tx_dlf_oai.php']) { |
|
1133 | +if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/plugins/oai/class.tx_dlf_oai.php']) { |
|
1134 | 1134 | include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/plugins/oai/class.tx_dlf_oai.php']); |
1135 | 1135 | |
1136 | 1136 | } |
@@ -19,220 +19,220 @@ discard block |
||
19 | 19 | */ |
20 | 20 | class tx_dlf_basket extends tx_dlf_plugin { |
21 | 21 | |
22 | - public $scriptRelPath = 'plugins/basket/class.tx_dlf_basket.php'; |
|
22 | + public $scriptRelPath = 'plugins/basket/class.tx_dlf_basket.php'; |
|
23 | 23 | |
24 | - /** |
|
25 | - * The main method of the PlugIn |
|
26 | - * |
|
27 | - * @access public |
|
28 | - * |
|
29 | - * @param string $content: The PlugIn content |
|
30 | - * @param array $conf: The PlugIn configuration |
|
31 | - * |
|
32 | - * @return string The content that is displayed on the website |
|
33 | - */ |
|
34 | - public function main($content, $conf) { |
|
24 | + /** |
|
25 | + * The main method of the PlugIn |
|
26 | + * |
|
27 | + * @access public |
|
28 | + * |
|
29 | + * @param string $content: The PlugIn content |
|
30 | + * @param array $conf: The PlugIn configuration |
|
31 | + * |
|
32 | + * @return string The content that is displayed on the website |
|
33 | + */ |
|
34 | + public function main($content, $conf) { |
|
35 | 35 | |
36 | - $this->init($conf); |
|
36 | + $this->init($conf); |
|
37 | 37 | |
38 | - // Don't cache the output. |
|
39 | - $this->setCache(FALSE); |
|
38 | + // Don't cache the output. |
|
39 | + $this->setCache(FALSE); |
|
40 | 40 | |
41 | - // Load template file. |
|
42 | - if (!empty($this->conf['templateFile'])) { |
|
41 | + // Load template file. |
|
42 | + if (!empty($this->conf['templateFile'])) { |
|
43 | 43 | |
44 | - $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###'); |
|
44 | + $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###'); |
|
45 | 45 | |
46 | - } else { |
|
46 | + } else { |
|
47 | 47 | |
48 | - $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/basket/template.tmpl'), '###TEMPLATE###'); |
|
48 | + $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/basket/template.tmpl'), '###TEMPLATE###'); |
|
49 | 49 | |
50 | - } |
|
50 | + } |
|
51 | 51 | |
52 | - $subpartArray['entry'] = $this->cObj->getSubpart($this->template, '###ENTRY###'); |
|
52 | + $subpartArray['entry'] = $this->cObj->getSubpart($this->template, '###ENTRY###'); |
|
53 | 53 | |
54 | - $markerArray['###JS###'] = ''; |
|
54 | + $markerArray['###JS###'] = ''; |
|
55 | 55 | |
56 | - // get user session |
|
57 | - $sessionId = $GLOBALS['TSFE']->fe_user->id; |
|
56 | + // get user session |
|
57 | + $sessionId = $GLOBALS['TSFE']->fe_user->id; |
|
58 | 58 | |
59 | - if ($GLOBALS['TSFE']->loginUser) { |
|
59 | + if ($GLOBALS['TSFE']->loginUser) { |
|
60 | 60 | |
61 | - $insertArray['fe_user_id'] = $GLOBALS['TSFE']->fe_user->user['uid']; |
|
61 | + $insertArray['fe_user_id'] = $GLOBALS['TSFE']->fe_user->user['uid']; |
|
62 | 62 | |
63 | - $query = $GLOBALS['TYPO3_DB']->SELECTquery( |
|
64 | - '*', |
|
65 | - 'tx_dlf_basket', |
|
66 | - 'tx_dlf_basket.fe_user_id='.intval($insertArray['fe_user_id']).tx_dlf_helper::whereClause('tx_dlf_basket'), |
|
67 | - '', |
|
68 | - '', |
|
69 | - '1' |
|
70 | - ); |
|
63 | + $query = $GLOBALS['TYPO3_DB']->SELECTquery( |
|
64 | + '*', |
|
65 | + 'tx_dlf_basket', |
|
66 | + 'tx_dlf_basket.fe_user_id='.intval($insertArray['fe_user_id']).tx_dlf_helper::whereClause('tx_dlf_basket'), |
|
67 | + '', |
|
68 | + '', |
|
69 | + '1' |
|
70 | + ); |
|
71 | 71 | |
72 | - } else { |
|
72 | + } else { |
|
73 | 73 | |
74 | - $GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_dlf_basket', ''); |
|
74 | + $GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_dlf_basket', ''); |
|
75 | 75 | |
76 | - $GLOBALS['TSFE']->fe_user->sesData_change = TRUE; |
|
76 | + $GLOBALS['TSFE']->fe_user->sesData_change = TRUE; |
|
77 | 77 | |
78 | - $GLOBALS['TSFE']->fe_user->storeSessionData(); |
|
78 | + $GLOBALS['TSFE']->fe_user->storeSessionData(); |
|
79 | 79 | |
80 | - $query = $GLOBALS['TYPO3_DB']->SELECTquery( |
|
81 | - '*', |
|
82 | - 'tx_dlf_basket', |
|
83 | - 'tx_dlf_basket.session_id='.$GLOBALS['TYPO3_DB']->fullQuoteStr($sessionId, 'tx_dlf_basket').tx_dlf_helper::whereClause('tx_dlf_basket'), |
|
84 | - '', |
|
85 | - '', |
|
86 | - '1' |
|
87 | - ); |
|
80 | + $query = $GLOBALS['TYPO3_DB']->SELECTquery( |
|
81 | + '*', |
|
82 | + 'tx_dlf_basket', |
|
83 | + 'tx_dlf_basket.session_id='.$GLOBALS['TYPO3_DB']->fullQuoteStr($sessionId, 'tx_dlf_basket').tx_dlf_helper::whereClause('tx_dlf_basket'), |
|
84 | + '', |
|
85 | + '', |
|
86 | + '1' |
|
87 | + ); |
|
88 | 88 | |
89 | - } |
|
89 | + } |
|
90 | 90 | |
91 | - $result = $GLOBALS['TYPO3_DB']->sql_query($query); |
|
91 | + $result = $GLOBALS['TYPO3_DB']->sql_query($query); |
|
92 | 92 | |
93 | - // session already exists |
|
94 | - if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) == 0) { |
|
93 | + // session already exists |
|
94 | + if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) == 0) { |
|
95 | 95 | |
96 | - // create new basket in db |
|
97 | - $insertArray['session_id'] = $sessionId; |
|
98 | - $insertArray['doc_ids'] = ''; |
|
99 | - $insertArray['label'] = ''; |
|
100 | - $insertArray['l18n_diffsource'] = ''; |
|
96 | + // create new basket in db |
|
97 | + $insertArray['session_id'] = $sessionId; |
|
98 | + $insertArray['doc_ids'] = ''; |
|
99 | + $insertArray['label'] = ''; |
|
100 | + $insertArray['l18n_diffsource'] = ''; |
|
101 | 101 | |
102 | - $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_dlf_basket', $insertArray); |
|
102 | + $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_dlf_basket', $insertArray); |
|
103 | 103 | |
104 | - $result = $GLOBALS['TYPO3_DB']->sql_query($query); |
|
104 | + $result = $GLOBALS['TYPO3_DB']->sql_query($query); |
|
105 | 105 | |
106 | - } |
|
106 | + } |
|
107 | 107 | |
108 | - $basketData = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result); |
|
108 | + $basketData = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result); |
|
109 | 109 | |
110 | - $piVars = $this->piVars; |
|
110 | + $piVars = $this->piVars; |
|
111 | 111 | |
112 | - // action add to basket |
|
113 | - if (!empty($this->piVars['id']) && $this->piVars['addToBasket']) { |
|
112 | + // action add to basket |
|
113 | + if (!empty($this->piVars['id']) && $this->piVars['addToBasket']) { |
|
114 | 114 | |
115 | - $returnData = $this->addToBasket($this->piVars, $basketData); |
|
115 | + $returnData = $this->addToBasket($this->piVars, $basketData); |
|
116 | 116 | |
117 | - $basketData = $returnData['basketData']; |
|
117 | + $basketData = $returnData['basketData']; |
|
118 | 118 | |
119 | - $markerArray['###JS###'] = $returnData['jsOutput']; |
|
119 | + $markerArray['###JS###'] = $returnData['jsOutput']; |
|
120 | 120 | |
121 | - } else { |
|
121 | + } else { |
|
122 | 122 | |
123 | - $basketData['doc_ids'] = json_decode($basketData['doc_ids']); |
|
123 | + $basketData['doc_ids'] = json_decode($basketData['doc_ids']); |
|
124 | 124 | |
125 | - } |
|
125 | + } |
|
126 | 126 | |
127 | - // action remove from basket |
|
128 | - if ($this->piVars['basket_action'] == 'remove') { |
|
127 | + // action remove from basket |
|
128 | + if ($this->piVars['basket_action'] == 'remove') { |
|
129 | 129 | |
130 | - // remove entry from list |
|
131 | - unset($piVars['basket_action']); |
|
130 | + // remove entry from list |
|
131 | + unset($piVars['basket_action']); |
|
132 | 132 | |
133 | - if (isset($this->piVars['selected'])) { |
|
133 | + if (isset($this->piVars['selected'])) { |
|
134 | 134 | |
135 | - $basketData = $this->removeFromBasket($piVars, $basketData); |
|
135 | + $basketData = $this->removeFromBasket($piVars, $basketData); |
|
136 | 136 | |
137 | - } |
|
137 | + } |
|
138 | 138 | |
139 | - } |
|
139 | + } |
|
140 | 140 | |
141 | - // action remove from basket |
|
142 | - if ($this->piVars['basket_action'] == 'open') { |
|
141 | + // action remove from basket |
|
142 | + if ($this->piVars['basket_action'] == 'open') { |
|
143 | 143 | |
144 | - // open selected documents |
|
145 | - unset($piVars['basket_action']); |
|
144 | + // open selected documents |
|
145 | + unset($piVars['basket_action']); |
|
146 | 146 | |
147 | - if (isset($this->piVars['selected'])) { |
|
147 | + if (isset($this->piVars['selected'])) { |
|
148 | 148 | |
149 | - $basketData = $this->openFromBasket($piVars, $basketData); |
|
149 | + $basketData = $this->openFromBasket($piVars, $basketData); |
|
150 | 150 | |
151 | - } |
|
151 | + } |
|
152 | 152 | |
153 | - } |
|
153 | + } |
|
154 | 154 | |
155 | - // action print from basket |
|
156 | - if ($this->piVars['print_action']) { |
|
155 | + // action print from basket |
|
156 | + if ($this->piVars['print_action']) { |
|
157 | 157 | |
158 | - // open selected documents |
|
159 | - unset($piVars['print_action']); |
|
158 | + // open selected documents |
|
159 | + unset($piVars['print_action']); |
|
160 | 160 | |
161 | - if (isset($this->piVars['selected'])) { |
|
161 | + if (isset($this->piVars['selected'])) { |
|
162 | 162 | |
163 | - $basketData = $this->printDocument($piVars, $basketData); |
|
163 | + $basketData = $this->printDocument($piVars, $basketData); |
|
164 | 164 | |
165 | - } |
|
165 | + } |
|
166 | 166 | |
167 | - } |
|
167 | + } |
|
168 | 168 | |
169 | - // action send mail |
|
170 | - if ($this->piVars['mail_action']) { |
|
169 | + // action send mail |
|
170 | + if ($this->piVars['mail_action']) { |
|
171 | 171 | |
172 | - if (isset($this->piVars['selected'])) { |
|
172 | + if (isset($this->piVars['selected'])) { |
|
173 | 173 | |
174 | - $this->sendMail($this->piVars); |
|
174 | + $this->sendMail($this->piVars); |
|
175 | 175 | |
176 | - } |
|
176 | + } |
|
177 | 177 | |
178 | - } |
|
178 | + } |
|
179 | 179 | |
180 | - // set marker |
|
181 | - $markerArray['###ACTION###'] = $this->pi_getPageLink($GLOBALS['TSFE']->id); |
|
180 | + // set marker |
|
181 | + $markerArray['###ACTION###'] = $this->pi_getPageLink($GLOBALS['TSFE']->id); |
|
182 | 182 | |
183 | - $markerArray['###LISTTITLE###'] = $this->pi_getLL('basket', '', TRUE); |
|
183 | + $markerArray['###LISTTITLE###'] = $this->pi_getLL('basket', '', TRUE); |
|
184 | 184 | |
185 | - if ($basketData['doc_ids']) { |
|
185 | + if ($basketData['doc_ids']) { |
|
186 | 186 | |
187 | - if (is_object($basketData['doc_ids'])) { |
|
187 | + if (is_object($basketData['doc_ids'])) { |
|
188 | 188 | |
189 | - $basketData['doc_ids'] = get_object_vars($basketData['doc_ids']); |
|
189 | + $basketData['doc_ids'] = get_object_vars($basketData['doc_ids']); |
|
190 | 190 | |
191 | - } |
|
191 | + } |
|
192 | 192 | |
193 | - $markerArray['###COUNT###'] = sprintf($this->pi_getLL('count'), count($basketData['doc_ids'])); |
|
193 | + $markerArray['###COUNT###'] = sprintf($this->pi_getLL('count'), count($basketData['doc_ids'])); |
|
194 | 194 | |
195 | - } else { |
|
195 | + } else { |
|
196 | 196 | |
197 | - $markerArray['###COUNT###'] = sprintf($this->pi_getLL('count'), 0); |
|
197 | + $markerArray['###COUNT###'] = sprintf($this->pi_getLL('count'), 0); |
|
198 | 198 | |
199 | - } |
|
199 | + } |
|
200 | 200 | |
201 | - // get mail addresses |
|
202 | - $resultMail = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
203 | - '*', |
|
204 | - 'tx_dlf_mail', |
|
205 | - '1'.tx_dlf_helper::whereClause('tx_dlf_mail'), |
|
206 | - '', |
|
207 | - 'tx_dlf_mail.sorting', |
|
208 | - '' |
|
209 | - ); |
|
201 | + // get mail addresses |
|
202 | + $resultMail = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
203 | + '*', |
|
204 | + 'tx_dlf_mail', |
|
205 | + '1'.tx_dlf_helper::whereClause('tx_dlf_mail'), |
|
206 | + '', |
|
207 | + 'tx_dlf_mail.sorting', |
|
208 | + '' |
|
209 | + ); |
|
210 | 210 | |
211 | - if ($GLOBALS['TYPO3_DB']->sql_num_rows($resultMail) > 0) { |
|
211 | + if ($GLOBALS['TYPO3_DB']->sql_num_rows($resultMail) > 0) { |
|
212 | 212 | |
213 | - $mails = array (); |
|
213 | + $mails = array (); |
|
214 | 214 | |
215 | - $mailForm = '<select name="tx_dlf[mail_action]">'; |
|
215 | + $mailForm = '<select name="tx_dlf[mail_action]">'; |
|
216 | 216 | |
217 | - $mailForm .= '<option value="">'.$this->pi_getLL('chooseMail', '', TRUE).'</option>'; |
|
217 | + $mailForm .= '<option value="">'.$this->pi_getLL('chooseMail', '', TRUE).'</option>'; |
|
218 | 218 | |
219 | - while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resultMail)) { |
|
219 | + while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resultMail)) { |
|
220 | 220 | |
221 | - $mails[] = $row; |
|
221 | + $mails[] = $row; |
|
222 | 222 | |
223 | - $mailForm .= '<option value="'.$row['uid'].'">'.$row['name'].' ('.$row['mail'].')</option>'; |
|
223 | + $mailForm .= '<option value="'.$row['uid'].'">'.$row['name'].' ('.$row['mail'].')</option>'; |
|
224 | 224 | |
225 | - } |
|
225 | + } |
|
226 | 226 | |
227 | - $mailForm .= '</select><input type="submit">'; |
|
227 | + $mailForm .= '</select><input type="submit">'; |
|
228 | 228 | |
229 | - } |
|
229 | + } |
|
230 | 230 | |
231 | - // mail action form |
|
232 | - $markerArray['###MAILACTION###'] = $mailForm; |
|
231 | + // mail action form |
|
232 | + $markerArray['###MAILACTION###'] = $mailForm; |
|
233 | 233 | |
234 | - // remove action form |
|
235 | - $markerArray['###REMOVEACTION###'] = ' |
|
234 | + // remove action form |
|
235 | + $markerArray['###REMOVEACTION###'] = ' |
|
236 | 236 | <select name="tx_dlf[basket_action]"> |
237 | 237 | <option value="">'.$this->pi_getLL('chooseAction', '', TRUE).'</option> |
238 | 238 | <option value="open">'.$this->pi_getLL('download', '', TRUE).'</option> |
@@ -241,275 +241,275 @@ discard block |
||
241 | 241 | <input type="submit"> |
242 | 242 | '; |
243 | 243 | |
244 | - // get mail addresses |
|
245 | - $resultPrinter = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
246 | - '*', |
|
247 | - 'tx_dlf_printer', |
|
248 | - '1'.tx_dlf_helper::whereClause('tx_dlf_printer'), |
|
249 | - '', |
|
250 | - '', |
|
251 | - '' |
|
252 | - ); |
|
244 | + // get mail addresses |
|
245 | + $resultPrinter = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
246 | + '*', |
|
247 | + 'tx_dlf_printer', |
|
248 | + '1'.tx_dlf_helper::whereClause('tx_dlf_printer'), |
|
249 | + '', |
|
250 | + '', |
|
251 | + '' |
|
252 | + ); |
|
253 | 253 | |
254 | - $printForm = ''; |
|
254 | + $printForm = ''; |
|
255 | 255 | |
256 | - if ($GLOBALS['TYPO3_DB']->sql_num_rows($resultPrinter) > 0) { |
|
256 | + if ($GLOBALS['TYPO3_DB']->sql_num_rows($resultPrinter) > 0) { |
|
257 | 257 | |
258 | - $printers = array (); |
|
258 | + $printers = array (); |
|
259 | 259 | |
260 | - $printForm = '<select name="tx_dlf[print_action]">'; |
|
260 | + $printForm = '<select name="tx_dlf[print_action]">'; |
|
261 | 261 | |
262 | - $printForm .= '<option value="">'.$this->pi_getLL('choosePrinter', '', TRUE).'</option>'; |
|
262 | + $printForm .= '<option value="">'.$this->pi_getLL('choosePrinter', '', TRUE).'</option>'; |
|
263 | 263 | |
264 | - while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resultPrinter)) { |
|
264 | + while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resultPrinter)) { |
|
265 | 265 | |
266 | - $printers[] = $row; |
|
266 | + $printers[] = $row; |
|
267 | 267 | |
268 | - $printForm .= '<option value="'.$row['uid'].'">'.$row['label'].'</option>'; |
|
268 | + $printForm .= '<option value="'.$row['uid'].'">'.$row['label'].'</option>'; |
|
269 | 269 | |
270 | - } |
|
270 | + } |
|
271 | 271 | |
272 | - $printForm .= '</select><input type="submit" />'; |
|
272 | + $printForm .= '</select><input type="submit" />'; |
|
273 | 273 | |
274 | - } |
|
274 | + } |
|
275 | 275 | |
276 | - // print action form |
|
277 | - $markerArray['###PRINTACTION###'] = $printForm; |
|
276 | + // print action form |
|
277 | + $markerArray['###PRINTACTION###'] = $printForm; |
|
278 | 278 | |
279 | - $entries = ''; |
|
279 | + $entries = ''; |
|
280 | 280 | |
281 | - if (isset($basketData['doc_ids'])) { |
|
281 | + if (isset($basketData['doc_ids'])) { |
|
282 | 282 | |
283 | - // get each entry |
|
284 | - foreach ($basketData['doc_ids'] as $key => $value) { |
|
283 | + // get each entry |
|
284 | + foreach ($basketData['doc_ids'] as $key => $value) { |
|
285 | 285 | |
286 | - $entries .= $this->getEntry($value, $subpartArray); |
|
286 | + $entries .= $this->getEntry($value, $subpartArray); |
|
287 | 287 | |
288 | - } |
|
288 | + } |
|
289 | 289 | |
290 | - } else { |
|
290 | + } else { |
|
291 | 291 | |
292 | - $entries = ''; |
|
292 | + $entries = ''; |
|
293 | 293 | |
294 | - } |
|
294 | + } |
|
295 | 295 | |
296 | - // basket go to |
|
297 | - if ($this->conf['targetBasket'] && $this->conf['basketGoToButton'] && $this->piVars['id']) { |
|
296 | + // basket go to |
|
297 | + if ($this->conf['targetBasket'] && $this->conf['basketGoToButton'] && $this->piVars['id']) { |
|
298 | 298 | |
299 | - $label = $this->pi_getLL('goBasket', '', TRUE); |
|
299 | + $label = $this->pi_getLL('goBasket', '', TRUE); |
|
300 | 300 | |
301 | - $basketConf = array ( |
|
302 | - 'parameter' => $this->conf['targetBasket'], |
|
303 | - 'title' => $label |
|
304 | - ); |
|
301 | + $basketConf = array ( |
|
302 | + 'parameter' => $this->conf['targetBasket'], |
|
303 | + 'title' => $label |
|
304 | + ); |
|
305 | 305 | |
306 | - $markerArray['###BASKET###'] = $this->cObj->typoLink($label, $basketConf); |
|
306 | + $markerArray['###BASKET###'] = $this->cObj->typoLink($label, $basketConf); |
|
307 | 307 | |
308 | - } else { |
|
308 | + } else { |
|
309 | 309 | |
310 | - $markerArray['###BASKET###'] = ''; |
|
310 | + $markerArray['###BASKET###'] = ''; |
|
311 | 311 | |
312 | - } |
|
312 | + } |
|
313 | 313 | |
314 | - $content = $this->cObj->substituteMarkerArray($this->cObj->substituteSubpart($this->template, '###ENTRY###', $entries, TRUE), $markerArray); |
|
314 | + $content = $this->cObj->substituteMarkerArray($this->cObj->substituteSubpart($this->template, '###ENTRY###', $entries, TRUE), $markerArray); |
|
315 | 315 | |
316 | - return $this->pi_wrapInBaseClass($content); |
|
316 | + return $this->pi_wrapInBaseClass($content); |
|
317 | 317 | |
318 | - } |
|
318 | + } |
|
319 | 319 | |
320 | - /** |
|
321 | - * Return one basket entry |
|
322 | - * @param array $data DocumentData |
|
323 | - * @param array $template Template information |
|
324 | - * @return Template |
|
325 | - */ |
|
326 | - public function getEntry($data, $template) { |
|
320 | + /** |
|
321 | + * Return one basket entry |
|
322 | + * @param array $data DocumentData |
|
323 | + * @param array $template Template information |
|
324 | + * @return Template |
|
325 | + */ |
|
326 | + public function getEntry($data, $template) { |
|
327 | 327 | |
328 | - if (is_object($data)) { |
|
328 | + if (is_object($data)) { |
|
329 | 329 | |
330 | - $data = get_object_vars($data); |
|
330 | + $data = get_object_vars($data); |
|
331 | 331 | |
332 | - } |
|
332 | + } |
|
333 | 333 | |
334 | - $id = $data['id']; |
|
334 | + $id = $data['id']; |
|
335 | 335 | |
336 | - $startpage = $data['startpage']; |
|
336 | + $startpage = $data['startpage']; |
|
337 | 337 | |
338 | - $endpage = $data['endpage']; |
|
338 | + $endpage = $data['endpage']; |
|
339 | 339 | |
340 | - $startX = $data['startX']; |
|
340 | + $startX = $data['startX']; |
|
341 | 341 | |
342 | - $startY = $data['startY']; |
|
342 | + $startY = $data['startY']; |
|
343 | 343 | |
344 | - $endX = $data['endX']; |
|
344 | + $endX = $data['endX']; |
|
345 | 345 | |
346 | - $endY = $data['endY']; |
|
346 | + $endY = $data['endY']; |
|
347 | 347 | |
348 | - $rotation = $data['rotation']; |
|
348 | + $rotation = $data['rotation']; |
|
349 | 349 | |
350 | - $docData = $this->getDocumentData($id, $data); |
|
350 | + $docData = $this->getDocumentData($id, $data); |
|
351 | 351 | |
352 | - $markerArray['###BASKETDATA###'] = $docData['downloadLink']; |
|
352 | + $markerArray['###BASKETDATA###'] = $docData['downloadLink']; |
|
353 | 353 | |
354 | - $arrayKey = $id.'_'.$startpage; |
|
354 | + $arrayKey = $id.'_'.$startpage; |
|
355 | 355 | |
356 | - if (isset($startX)) { |
|
356 | + if (isset($startX)) { |
|
357 | 357 | |
358 | - $arrayKey .= '_'.$startX; |
|
358 | + $arrayKey .= '_'.$startX; |
|
359 | 359 | |
360 | - } |
|
360 | + } |
|
361 | 361 | |
362 | - if (isset($endX)) { |
|
362 | + if (isset($endX)) { |
|
363 | 363 | |
364 | - $arrayKey .= '_'.$endX; |
|
364 | + $arrayKey .= '_'.$endX; |
|
365 | 365 | |
366 | - } |
|
366 | + } |
|
367 | 367 | |
368 | - $controlMark = '<input value="'.$id.'" name="tx_dlf[selected]['.$arrayKey.'][id]" type="checkbox">'; |
|
368 | + $controlMark = '<input value="'.$id.'" name="tx_dlf[selected]['.$arrayKey.'][id]" type="checkbox">'; |
|
369 | 369 | |
370 | - $controlMark .= '<input value="'.$startpage.'" name="tx_dlf[selected]['.$arrayKey.'][startpage]" type="hidden">'; |
|
370 | + $controlMark .= '<input value="'.$startpage.'" name="tx_dlf[selected]['.$arrayKey.'][startpage]" type="hidden">'; |
|
371 | 371 | |
372 | - $controlMark .= '<input value="'.$endpage.'" name="tx_dlf[selected]['.$arrayKey.'][endpage]" type="hidden">'; |
|
372 | + $controlMark .= '<input value="'.$endpage.'" name="tx_dlf[selected]['.$arrayKey.'][endpage]" type="hidden">'; |
|
373 | 373 | |
374 | - // add hidden fields for detail information |
|
375 | - if ($startX) { |
|
374 | + // add hidden fields for detail information |
|
375 | + if ($startX) { |
|
376 | 376 | |
377 | - $controlMark .= '<input type="hidden" name="tx_dlf[selected]['.$arrayKey.'][startX]" value="'.$startX.'">'; |
|
377 | + $controlMark .= '<input type="hidden" name="tx_dlf[selected]['.$arrayKey.'][startX]" value="'.$startX.'">'; |
|
378 | 378 | |
379 | - $controlMark .= '<input type="hidden" name="tx_dlf[selected]['.$arrayKey.'][startY]" value="'.$startY.'">'; |
|
379 | + $controlMark .= '<input type="hidden" name="tx_dlf[selected]['.$arrayKey.'][startY]" value="'.$startY.'">'; |
|
380 | 380 | |
381 | - $controlMark .= '<input type="hidden" name="tx_dlf[selected]['.$arrayKey.'][endX]" value="'.$endX.'">'; |
|
381 | + $controlMark .= '<input type="hidden" name="tx_dlf[selected]['.$arrayKey.'][endX]" value="'.$endX.'">'; |
|
382 | 382 | |
383 | - $controlMark .= '<input type="hidden" name="tx_dlf[selected]['.$arrayKey.'][endY]" value="'.$endY.'">'; |
|
383 | + $controlMark .= '<input type="hidden" name="tx_dlf[selected]['.$arrayKey.'][endY]" value="'.$endY.'">'; |
|
384 | 384 | |
385 | - $controlMark .= '<input type="hidden" name="tx_dlf[selected]['.$arrayKey.'][rotation]" value="'.$rotation.'">'; |
|
385 | + $controlMark .= '<input type="hidden" name="tx_dlf[selected]['.$arrayKey.'][rotation]" value="'.$rotation.'">'; |
|
386 | 386 | |
387 | - } |
|
387 | + } |
|
388 | 388 | |
389 | - // return one entry |
|
390 | - $markerArray['###CONTROLS###'] = $controlMark; |
|
389 | + // return one entry |
|
390 | + $markerArray['###CONTROLS###'] = $controlMark; |
|
391 | 391 | |
392 | - $markerArray['###NUMBER###'] = $docData['record_id']; |
|
392 | + $markerArray['###NUMBER###'] = $docData['record_id']; |
|
393 | 393 | |
394 | - return $this->cObj->substituteMarkerArray($this->cObj->substituteSubpart($template['entry'], '###ENTRY###', $subpart, TRUE), $markerArray); |
|
394 | + return $this->cObj->substituteMarkerArray($this->cObj->substituteSubpart($template['entry'], '###ENTRY###', $subpart, TRUE), $markerArray); |
|
395 | 395 | |
396 | - } |
|
396 | + } |
|
397 | 397 | |
398 | - /** |
|
399 | - * Adds documents to the basket |
|
400 | - * @param array $_piVars piVars |
|
401 | - * @param array $basketData basket data |
|
402 | - */ |
|
403 | - public function addToBasket($_piVars, $basketData) { |
|
398 | + /** |
|
399 | + * Adds documents to the basket |
|
400 | + * @param array $_piVars piVars |
|
401 | + * @param array $basketData basket data |
|
402 | + */ |
|
403 | + public function addToBasket($_piVars, $basketData) { |
|
404 | 404 | |
405 | - if (!$_piVars['startpage']) { |
|
405 | + if (!$_piVars['startpage']) { |
|
406 | 406 | |
407 | - $page = 0; |
|
407 | + $page = 0; |
|
408 | 408 | |
409 | - } else { |
|
409 | + } else { |
|
410 | 410 | |
411 | - $page = intval($_piVars['startpage']); |
|
411 | + $page = intval($_piVars['startpage']); |
|
412 | 412 | |
413 | - } |
|
413 | + } |
|
414 | 414 | |
415 | - if ($page != NULL || $_piVars['addToBasket'] == 'list') { |
|
415 | + if ($page != NULL || $_piVars['addToBasket'] == 'list') { |
|
416 | 416 | |
417 | - $documentItem = array ( |
|
418 | - 'id' => intval($_piVars['id']), |
|
419 | - 'startpage' => intval($_piVars['startpage']), |
|
420 | - 'endpage' => intval($_piVars['endpage']), |
|
421 | - 'startX' => intval($_piVars['startX']), |
|
422 | - 'startY' => intval($_piVars['startY']), |
|
423 | - 'endX' => intval($_piVars['endX']), |
|
424 | - 'endY' => intval($_piVars['endY']), |
|
425 | - 'rotation' => intval($_piVars['rotation']) |
|
426 | - ); |
|
417 | + $documentItem = array ( |
|
418 | + 'id' => intval($_piVars['id']), |
|
419 | + 'startpage' => intval($_piVars['startpage']), |
|
420 | + 'endpage' => intval($_piVars['endpage']), |
|
421 | + 'startX' => intval($_piVars['startX']), |
|
422 | + 'startY' => intval($_piVars['startY']), |
|
423 | + 'endX' => intval($_piVars['endX']), |
|
424 | + 'endY' => intval($_piVars['endY']), |
|
425 | + 'rotation' => intval($_piVars['rotation']) |
|
426 | + ); |
|
427 | 427 | |
428 | - // update basket |
|
429 | - if (!empty($basketData['doc_ids'])) { |
|
428 | + // update basket |
|
429 | + if (!empty($basketData['doc_ids'])) { |
|
430 | 430 | |
431 | - $items = json_decode($basketData['doc_ids']); |
|
431 | + $items = json_decode($basketData['doc_ids']); |
|
432 | 432 | |
433 | - $items = get_object_vars($items); |
|
433 | + $items = get_object_vars($items); |
|
434 | 434 | |
435 | - } else { |
|
435 | + } else { |
|
436 | 436 | |
437 | - $items = array (); |
|
437 | + $items = array (); |
|
438 | 438 | |
439 | - } |
|
439 | + } |
|
440 | 440 | |
441 | - // get document instance to load further information |
|
442 | - $document = tx_dlf_document::getInstance($documentItem['id'], 0); |
|
441 | + // get document instance to load further information |
|
442 | + $document = tx_dlf_document::getInstance($documentItem['id'], 0); |
|
443 | 443 | |
444 | - // set endpage for toc and subentry based on logid |
|
445 | - if (($_piVars['addToBasket'] == 'subentry') or ($_piVars['addToBasket'] == 'toc')) { |
|
444 | + // set endpage for toc and subentry based on logid |
|
445 | + if (($_piVars['addToBasket'] == 'subentry') or ($_piVars['addToBasket'] == 'toc')) { |
|
446 | 446 | |
447 | - $smLinks = $document->smLinks; |
|
447 | + $smLinks = $document->smLinks; |
|
448 | 448 | |
449 | - $pageCounter = sizeof($smLinks['l2p'][$_piVars['logId']]); |
|
449 | + $pageCounter = sizeof($smLinks['l2p'][$_piVars['logId']]); |
|
450 | 450 | |
451 | - $documentItem['endpage'] = ($documentItem['startpage'] + $pageCounter) - 1; |
|
451 | + $documentItem['endpage'] = ($documentItem['startpage'] + $pageCounter) - 1; |
|
452 | 452 | |
453 | - } |
|
453 | + } |
|
454 | 454 | |
455 | - // add whole document |
|
456 | - if ($_piVars['addToBasket'] == 'list') { |
|
455 | + // add whole document |
|
456 | + if ($_piVars['addToBasket'] == 'list') { |
|
457 | 457 | |
458 | - $documentItem['endpage'] = $document->numPages; |
|
458 | + $documentItem['endpage'] = $document->numPages; |
|
459 | 459 | |
460 | - } |
|
460 | + } |
|
461 | 461 | |
462 | - $arrayKey = $documentItem['id'].'_'.$page; |
|
462 | + $arrayKey = $documentItem['id'].'_'.$page; |
|
463 | 463 | |
464 | - if (!empty($documentItem['startX'])) { |
|
464 | + if (!empty($documentItem['startX'])) { |
|
465 | 465 | |
466 | - $arrayKey .= '_'.$documentItem['startX']; |
|
466 | + $arrayKey .= '_'.$documentItem['startX']; |
|
467 | 467 | |
468 | - } |
|
468 | + } |
|
469 | 469 | |
470 | - if (!empty($documentItem['endX'])) { |
|
470 | + if (!empty($documentItem['endX'])) { |
|
471 | 471 | |
472 | - $arrayKey .= '_'.$documentItem['endX']; |
|
472 | + $arrayKey .= '_'.$documentItem['endX']; |
|
473 | 473 | |
474 | - } |
|
474 | + } |
|
475 | 475 | |
476 | - // do not add more than one identical object |
|
477 | - if (!in_array($arrayKey, $items)) { |
|
476 | + // do not add more than one identical object |
|
477 | + if (!in_array($arrayKey, $items)) { |
|
478 | 478 | |
479 | - $items[$arrayKey] = $documentItem; |
|
479 | + $items[$arrayKey] = $documentItem; |
|
480 | 480 | |
481 | - // replace url param placeholder |
|
482 | - $pdfParams = str_replace("##startpage##", $documentItem['startpage'], $this->conf['pdfparams']); |
|
481 | + // replace url param placeholder |
|
482 | + $pdfParams = str_replace("##startpage##", $documentItem['startpage'], $this->conf['pdfparams']); |
|
483 | 483 | |
484 | - $pdfParams = str_replace("##docId##", $document->recordId, $pdfParams); |
|
484 | + $pdfParams = str_replace("##docId##", $document->recordId, $pdfParams); |
|
485 | 485 | |
486 | - $pdfParams = str_replace("##startx##", $documentItem['startX'], $pdfParams); |
|
486 | + $pdfParams = str_replace("##startx##", $documentItem['startX'], $pdfParams); |
|
487 | 487 | |
488 | - $pdfParams = str_replace("##starty##", $documentItem['startY'], $pdfParams); |
|
488 | + $pdfParams = str_replace("##starty##", $documentItem['startY'], $pdfParams); |
|
489 | 489 | |
490 | - $pdfParams = str_replace("##endx##", $documentItem['endX'], $pdfParams); |
|
490 | + $pdfParams = str_replace("##endx##", $documentItem['endX'], $pdfParams); |
|
491 | 491 | |
492 | - $pdfParams = str_replace("##endy##", $documentItem['endY'], $pdfParams); |
|
492 | + $pdfParams = str_replace("##endy##", $documentItem['endY'], $pdfParams); |
|
493 | 493 | |
494 | - $pdfParams = str_replace("##rotation##", $documentItem['rotation'], $pdfParams); |
|
494 | + $pdfParams = str_replace("##rotation##", $documentItem['rotation'], $pdfParams); |
|
495 | 495 | |
496 | - if ($documentItem['startpage'] != $documentItem['endpage']) { |
|
496 | + if ($documentItem['startpage'] != $documentItem['endpage']) { |
|
497 | 497 | |
498 | - $pdfParams = str_replace("##endpage##", $documentItem['endpage'], $pdfParams); |
|
498 | + $pdfParams = str_replace("##endpage##", $documentItem['endpage'], $pdfParams); |
|
499 | 499 | |
500 | - } else { |
|
500 | + } else { |
|
501 | 501 | |
502 | - // remove parameter endpage |
|
503 | - $pdfParams = str_replace(",##endpage##", '', $pdfParams); |
|
502 | + // remove parameter endpage |
|
503 | + $pdfParams = str_replace(",##endpage##", '', $pdfParams); |
|
504 | 504 | |
505 | - } |
|
505 | + } |
|
506 | 506 | |
507 | - $pdfGenerateUrl = $this->conf['pdfgenerate'].$pdfParams; |
|
507 | + $pdfGenerateUrl = $this->conf['pdfgenerate'].$pdfParams; |
|
508 | 508 | |
509 | - if ($this->conf['pregeneration']) { |
|
509 | + if ($this->conf['pregeneration']) { |
|
510 | 510 | |
511 | - // send ajax request to webapp |
|
512 | - $output .= ' |
|
511 | + // send ajax request to webapp |
|
512 | + $output .= ' |
|
513 | 513 | <script> |
514 | 514 | $(document).ready(function(){ |
515 | 515 | $.ajax({ |
@@ -519,431 +519,431 @@ discard block |
||
519 | 519 | }); |
520 | 520 | </script>'; |
521 | 521 | |
522 | - } |
|
522 | + } |
|
523 | 523 | |
524 | - } |
|
524 | + } |
|
525 | 525 | |
526 | - $update = array ('doc_ids' => json_encode($items)); |
|
526 | + $update = array ('doc_ids' => json_encode($items)); |
|
527 | 527 | |
528 | - $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_dlf_basket', 'uid='.intval($basketData['uid']), $update); |
|
528 | + $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_dlf_basket', 'uid='.intval($basketData['uid']), $update); |
|
529 | 529 | |
530 | - $basketData['doc_ids'] = $items; |
|
530 | + $basketData['doc_ids'] = $items; |
|
531 | 531 | |
532 | - } |
|
532 | + } |
|
533 | 533 | |
534 | - return array ('basketData' => $basketData, 'jsOutput' => $output); |
|
534 | + return array ('basketData' => $basketData, 'jsOutput' => $output); |
|
535 | 535 | |
536 | - } |
|
536 | + } |
|
537 | 537 | |
538 | - /** |
|
539 | - * Removes selected documents from basket |
|
540 | - * @param array $_piVars plugin variables |
|
541 | - * @param array $basketData array with document information |
|
542 | - * @return array basket data |
|
543 | - */ |
|
544 | - public function removeFromBasket($_piVars, $basketData) { |
|
538 | + /** |
|
539 | + * Removes selected documents from basket |
|
540 | + * @param array $_piVars plugin variables |
|
541 | + * @param array $basketData array with document information |
|
542 | + * @return array basket data |
|
543 | + */ |
|
544 | + public function removeFromBasket($_piVars, $basketData) { |
|
545 | 545 | |
546 | - if (!empty($basketData['doc_ids'])) { |
|
546 | + if (!empty($basketData['doc_ids'])) { |
|
547 | 547 | |
548 | - $items = $basketData['doc_ids']; |
|
548 | + $items = $basketData['doc_ids']; |
|
549 | 549 | |
550 | - $items = get_object_vars($items); |
|
550 | + $items = get_object_vars($items); |
|
551 | 551 | |
552 | - } |
|
552 | + } |
|
553 | 553 | |
554 | - foreach ($_piVars['selected'] as $key => $value) { |
|
554 | + foreach ($_piVars['selected'] as $key => $value) { |
|
555 | 555 | |
556 | - if (isset($value['id'])) { |
|
556 | + if (isset($value['id'])) { |
|
557 | 557 | |
558 | - $arrayKey = $value['id'].'_'.$value['startpage']; |
|
558 | + $arrayKey = $value['id'].'_'.$value['startpage']; |
|
559 | 559 | |
560 | - if (isset($value['startX'])) { |
|
560 | + if (isset($value['startX'])) { |
|
561 | 561 | |
562 | - $arrayKey .= '_'.$value['startX']; |
|
562 | + $arrayKey .= '_'.$value['startX']; |
|
563 | 563 | |
564 | - } |
|
564 | + } |
|
565 | 565 | |
566 | - if (isset($value['endX'])) { |
|
566 | + if (isset($value['endX'])) { |
|
567 | 567 | |
568 | - $arrayKey .= '_'.$value['endX']; |
|
568 | + $arrayKey .= '_'.$value['endX']; |
|
569 | 569 | |
570 | - } |
|
570 | + } |
|
571 | 571 | |
572 | - if (isset($items[$arrayKey])) { |
|
572 | + if (isset($items[$arrayKey])) { |
|
573 | 573 | |
574 | - unset($items[$arrayKey]); |
|
574 | + unset($items[$arrayKey]); |
|
575 | 575 | |
576 | - } |
|
576 | + } |
|
577 | 577 | |
578 | - } |
|
578 | + } |
|
579 | 579 | |
580 | - } |
|
580 | + } |
|
581 | 581 | |
582 | - if (empty($items)) { |
|
582 | + if (empty($items)) { |
|
583 | 583 | |
584 | - $update = array ('doc_ids' => ''); |
|
584 | + $update = array ('doc_ids' => ''); |
|
585 | 585 | |
586 | - } else { |
|
586 | + } else { |
|
587 | 587 | |
588 | - $update = array ('doc_ids' => json_encode($items)); |
|
588 | + $update = array ('doc_ids' => json_encode($items)); |
|
589 | 589 | |
590 | - } |
|
590 | + } |
|
591 | 591 | |
592 | - $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_dlf_basket', 'uid='.intval($basketData['uid']), $update); |
|
592 | + $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_dlf_basket', 'uid='.intval($basketData['uid']), $update); |
|
593 | 593 | |
594 | - $basketData['doc_ids'] = $items; |
|
594 | + $basketData['doc_ids'] = $items; |
|
595 | 595 | |
596 | - return $basketData; |
|
596 | + return $basketData; |
|
597 | 597 | |
598 | - } |
|
598 | + } |
|
599 | 599 | |
600 | - /** |
|
601 | - * Open selected documents from basket |
|
602 | - * @param array $_piVars plugin variables |
|
603 | - * @param array $basketData array with document information |
|
604 | - * @return array basket data |
|
605 | - */ |
|
606 | - public function openFromBasket($_piVars, $basketData) { |
|
600 | + /** |
|
601 | + * Open selected documents from basket |
|
602 | + * @param array $_piVars plugin variables |
|
603 | + * @param array $basketData array with document information |
|
604 | + * @return array basket data |
|
605 | + */ |
|
606 | + public function openFromBasket($_piVars, $basketData) { |
|
607 | 607 | |
608 | - $pdfUrl = $this->conf['pdfgenerate']; |
|
608 | + $pdfUrl = $this->conf['pdfgenerate']; |
|
609 | 609 | |
610 | - foreach ($this->piVars['selected'] as $docId => $docValue) { |
|
610 | + foreach ($this->piVars['selected'] as $docId => $docValue) { |
|
611 | 611 | |
612 | - if ($docValue['id']) { |
|
612 | + if ($docValue['id']) { |
|
613 | 613 | |
614 | - $filename .= $docValue['id'].'_'; |
|
614 | + $filename .= $docValue['id'].'_'; |
|
615 | 615 | |
616 | - $docData = $this->getDocumentData($docValue['id'], $docValue); |
|
616 | + $docData = $this->getDocumentData($docValue['id'], $docValue); |
|
617 | 617 | |
618 | - $pdfUrl .= $docData['urlParams'].$this->conf['pdfparamseparator']; |
|
618 | + $pdfUrl .= $docData['urlParams'].$this->conf['pdfparamseparator']; |
|
619 | 619 | |
620 | - $numberOfPages += $docData['pageNums']; |
|
620 | + $numberOfPages += $docData['pageNums']; |
|
621 | 621 | |
622 | - } |
|
622 | + } |
|
623 | 623 | |
624 | - } |
|
624 | + } |
|
625 | 625 | |
626 | - header('Location: '.$pdfUrl); |
|
626 | + header('Location: '.$pdfUrl); |
|
627 | 627 | |
628 | - ob_end_flush(); |
|
628 | + ob_end_flush(); |
|
629 | 629 | |
630 | - exit; |
|
630 | + exit; |
|
631 | 631 | |
632 | - } |
|
632 | + } |
|
633 | 633 | |
634 | - /** |
|
635 | - * Returns the downloadurl configured in the basket |
|
636 | - * @param integer $id Document id |
|
637 | - * @return mixed download url or false |
|
638 | - */ |
|
639 | - public function getDocumentData($id, $data) { |
|
634 | + /** |
|
635 | + * Returns the downloadurl configured in the basket |
|
636 | + * @param integer $id Document id |
|
637 | + * @return mixed download url or false |
|
638 | + */ |
|
639 | + public function getDocumentData($id, $data) { |
|
640 | 640 | |
641 | - // get document instance to load further information |
|
642 | - $document = tx_dlf_document::getInstance($id, 0); |
|
641 | + // get document instance to load further information |
|
642 | + $document = tx_dlf_document::getInstance($id, 0); |
|
643 | 643 | |
644 | - if ($document) { |
|
644 | + if ($document) { |
|
645 | 645 | |
646 | - // replace url param placeholder |
|
647 | - $urlParams = str_replace("##page##", intval($data['page']), $this->conf['pdfparams']); |
|
646 | + // replace url param placeholder |
|
647 | + $urlParams = str_replace("##page##", intval($data['page']), $this->conf['pdfparams']); |
|
648 | 648 | |
649 | - $urlParams = str_replace("##docId##", $document->recordId, $urlParams); |
|
649 | + $urlParams = str_replace("##docId##", $document->recordId, $urlParams); |
|
650 | 650 | |
651 | - $urlParams = str_replace("##startpage##", intval($data['startpage']), $urlParams); |
|
651 | + $urlParams = str_replace("##startpage##", intval($data['startpage']), $urlParams); |
|
652 | 652 | |
653 | - if ($data['startpage'] != $data['endpage']) { |
|
653 | + if ($data['startpage'] != $data['endpage']) { |
|
654 | 654 | |
655 | - $urlParams = str_replace("##endpage##", intval($data['endpage']), $urlParams); |
|
655 | + $urlParams = str_replace("##endpage##", intval($data['endpage']), $urlParams); |
|
656 | 656 | |
657 | - } else { |
|
657 | + } else { |
|
658 | 658 | |
659 | - // remove parameter endpage |
|
660 | - $urlParams = str_replace(",##endpage##", '', $urlParams); |
|
659 | + // remove parameter endpage |
|
660 | + $urlParams = str_replace(",##endpage##", '', $urlParams); |
|
661 | 661 | |
662 | - } |
|
662 | + } |
|
663 | 663 | |
664 | - $urlParams = str_replace("##startx##", intval($data['startX']), $urlParams); |
|
664 | + $urlParams = str_replace("##startx##", intval($data['startX']), $urlParams); |
|
665 | 665 | |
666 | - $urlParams = str_replace("##starty##", intval($data['startY']), $urlParams); |
|
666 | + $urlParams = str_replace("##starty##", intval($data['startY']), $urlParams); |
|
667 | 667 | |
668 | - $urlParams = str_replace("##endx##", intval($data['endX']), $urlParams); |
|
668 | + $urlParams = str_replace("##endx##", intval($data['endX']), $urlParams); |
|
669 | 669 | |
670 | - $urlParams = str_replace("##endy##", intval($data['endY']), $urlParams); |
|
670 | + $urlParams = str_replace("##endy##", intval($data['endY']), $urlParams); |
|
671 | 671 | |
672 | - $urlParams = str_replace("##rotation##", intval($data['rotation']), $urlParams); |
|
672 | + $urlParams = str_replace("##rotation##", intval($data['rotation']), $urlParams); |
|
673 | 673 | |
674 | - $downloadUrl = $this->conf['pdfgenerate'].$urlParams; |
|
674 | + $downloadUrl = $this->conf['pdfgenerate'].$urlParams; |
|
675 | 675 | |
676 | - $title = $document->getTitle($id, TRUE); |
|
676 | + $title = $document->getTitle($id, TRUE); |
|
677 | 677 | |
678 | - if (empty($title)) { |
|
678 | + if (empty($title)) { |
|
679 | 679 | |
680 | - $title = $this->pi_getLL('noTitle', '', TRUE); |
|
680 | + $title = $this->pi_getLL('noTitle', '', TRUE); |
|
681 | 681 | |
682 | - } |
|
682 | + } |
|
683 | 683 | |
684 | - // Set page and cutout information |
|
685 | - $info = ''; |
|
684 | + // Set page and cutout information |
|
685 | + $info = ''; |
|
686 | 686 | |
687 | - if ($data['startX'] != '' && $data['endX'] != '') { |
|
687 | + if ($data['startX'] != '' && $data['endX'] != '') { |
|
688 | 688 | |
689 | - // cutout |
|
690 | - $info .= $this->pi_getLL('cutout', '', TRUE).' '; |
|
689 | + // cutout |
|
690 | + $info .= $this->pi_getLL('cutout', '', TRUE).' '; |
|
691 | 691 | |
692 | - } |
|
692 | + } |
|
693 | 693 | |
694 | - if ($data['startpage'] == $data['endpage']) { |
|
694 | + if ($data['startpage'] == $data['endpage']) { |
|
695 | 695 | |
696 | - // One page |
|
697 | - $info .= $this->pi_getLL('page', '', TRUE).' '.$data['startpage']; |
|
696 | + // One page |
|
697 | + $info .= $this->pi_getLL('page', '', TRUE).' '.$data['startpage']; |
|
698 | 698 | |
699 | - } else { |
|
699 | + } else { |
|
700 | 700 | |
701 | - $info .= $this->pi_getLL('page', '', TRUE).' '.$data['startpage'].'-'.$data['endpage']; |
|
701 | + $info .= $this->pi_getLL('page', '', TRUE).' '.$data['startpage'].'-'.$data['endpage']; |
|
702 | 702 | |
703 | - } |
|
703 | + } |
|
704 | 704 | |
705 | - $downloadLink = '<a href="'.$downloadUrl.'" target="_blank">'.$title.'</a> ('.$info.')'; |
|
705 | + $downloadLink = '<a href="'.$downloadUrl.'" target="_blank">'.$title.'</a> ('.$info.')'; |
|
706 | 706 | |
707 | - if ($data['startpage'] == $data['endpage']) { |
|
707 | + if ($data['startpage'] == $data['endpage']) { |
|
708 | 708 | |
709 | - $pageNums = 1; |
|
709 | + $pageNums = 1; |
|
710 | 710 | |
711 | - } else { |
|
711 | + } else { |
|
712 | 712 | |
713 | - $pageNums = $data['endpage'] - $data['startpage']; |
|
713 | + $pageNums = $data['endpage'] - $data['startpage']; |
|
714 | 714 | |
715 | - } |
|
715 | + } |
|
716 | 716 | |
717 | - return array ( |
|
718 | - 'downloadUrl' => $downloadUrl, |
|
719 | - 'downloadLink' => $downloadLink, |
|
720 | - 'pageNums' => $pageNums, |
|
721 | - 'urlParams' => $urlParams, |
|
722 | - 'record_id' => $document->recordId, |
|
723 | - ); |
|
717 | + return array ( |
|
718 | + 'downloadUrl' => $downloadUrl, |
|
719 | + 'downloadLink' => $downloadLink, |
|
720 | + 'pageNums' => $pageNums, |
|
721 | + 'urlParams' => $urlParams, |
|
722 | + 'record_id' => $document->recordId, |
|
723 | + ); |
|
724 | 724 | |
725 | - } |
|
725 | + } |
|
726 | 726 | |
727 | - return FALSE; |
|
727 | + return FALSE; |
|
728 | 728 | |
729 | - } |
|
729 | + } |
|
730 | 730 | |
731 | - /** |
|
732 | - * Send mail with pdf download url |
|
733 | - */ |
|
734 | - public function sendMail() { |
|
731 | + /** |
|
732 | + * Send mail with pdf download url |
|
733 | + */ |
|
734 | + public function sendMail() { |
|
735 | 735 | |
736 | - // send mail |
|
737 | - $mailId = $this->piVars['mail_action']; |
|
736 | + // send mail |
|
737 | + $mailId = $this->piVars['mail_action']; |
|
738 | 738 | |
739 | - // get id from db and send selected doc downloadlink |
|
740 | - $resultMail = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
741 | - '*', |
|
742 | - 'tx_dlf_mail', |
|
743 | - 'tx_dlf_mail.uid="'.intval($mailId).'"'.tx_dlf_helper::whereClause('tx_dlf_mail'), |
|
744 | - '', |
|
745 | - '', |
|
746 | - '1' |
|
747 | - ); |
|
739 | + // get id from db and send selected doc downloadlink |
|
740 | + $resultMail = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
741 | + '*', |
|
742 | + 'tx_dlf_mail', |
|
743 | + 'tx_dlf_mail.uid="'.intval($mailId).'"'.tx_dlf_helper::whereClause('tx_dlf_mail'), |
|
744 | + '', |
|
745 | + '', |
|
746 | + '1' |
|
747 | + ); |
|
748 | 748 | |
749 | - $mailData = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resultMail); |
|
749 | + $mailData = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resultMail); |
|
750 | 750 | |
751 | - $body = $this->pi_getLL('mailBody', '', TRUE)."\n"; |
|
751 | + $body = $this->pi_getLL('mailBody', '', TRUE)."\n"; |
|
752 | 752 | |
753 | - $numberOfPages = 0; |
|
753 | + $numberOfPages = 0; |
|
754 | 754 | |
755 | - $pdfUrl = $this->conf['pdfdownload']; |
|
755 | + $pdfUrl = $this->conf['pdfdownload']; |
|
756 | 756 | |
757 | - // prepare links |
|
758 | - foreach ($this->piVars['selected'] as $docId => $docValue) { |
|
757 | + // prepare links |
|
758 | + foreach ($this->piVars['selected'] as $docId => $docValue) { |
|
759 | 759 | |
760 | - if ($docValue['id']) { |
|
760 | + if ($docValue['id']) { |
|
761 | 761 | |
762 | - $explodeId = explode("_", $docValue['id']); |
|
762 | + $explodeId = explode("_", $docValue['id']); |
|
763 | 763 | |
764 | - $docData = $this->getDocumentData($explodeId[0], $docValue); |
|
764 | + $docData = $this->getDocumentData($explodeId[0], $docValue); |
|
765 | 765 | |
766 | - $pdfUrl .= $docData['urlParams'].$this->conf['pdfparamseparator']; |
|
766 | + $pdfUrl .= $docData['urlParams'].$this->conf['pdfparamseparator']; |
|
767 | 767 | |
768 | - $pages = (abs(intval($docValue['startpage']) - intval($docValue['endpage']))); |
|
768 | + $pages = (abs(intval($docValue['startpage']) - intval($docValue['endpage']))); |
|
769 | 769 | |
770 | - if ($pages === 0) { |
|
770 | + if ($pages === 0) { |
|
771 | 771 | |
772 | - $numberOfPages = $numberOfPages + 1; |
|
772 | + $numberOfPages = $numberOfPages + 1; |
|
773 | 773 | |
774 | - } else { |
|
774 | + } else { |
|
775 | 775 | |
776 | - $numberOfPages = $numberOfPages + $pages; |
|
776 | + $numberOfPages = $numberOfPages + $pages; |
|
777 | 777 | |
778 | - } |
|
778 | + } |
|
779 | 779 | |
780 | - } |
|
780 | + } |
|
781 | 781 | |
782 | - } |
|
782 | + } |
|
783 | 783 | |
784 | - // Remove leading/tailing pdfparamseperator |
|
785 | - $pdfUrl = trim($pdfUrl, $this->conf['pdfparamseparator']); |
|
784 | + // Remove leading/tailing pdfparamseperator |
|
785 | + $pdfUrl = trim($pdfUrl, $this->conf['pdfparamseparator']); |
|
786 | 786 | |
787 | - $body .= $pdfUrl; |
|
787 | + $body .= $pdfUrl; |
|
788 | 788 | |
789 | - $from = \TYPO3\CMS\Core\Utility\MailUtility::getSystemFrom(); |
|
789 | + $from = \TYPO3\CMS\Core\Utility\MailUtility::getSystemFrom(); |
|
790 | 790 | |
791 | - // send mail |
|
792 | - $mail = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Mail\\MailMessage'); |
|
791 | + // send mail |
|
792 | + $mail = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Mail\\MailMessage'); |
|
793 | 793 | |
794 | - // Prepare and send the message |
|
795 | ||
796 | - // subject |
|
797 | - ->setSubject($this->pi_getLL('mailSubject', '', TRUE)) |
|
794 | + // Prepare and send the message |
|
795 | ||
796 | + // subject |
|
797 | + ->setSubject($this->pi_getLL('mailSubject', '', TRUE)) |
|
798 | 798 | |
799 | - // Set the From address with an associative array |
|
800 | - ->setFrom($from) |
|
799 | + // Set the From address with an associative array |
|
800 | + ->setFrom($from) |
|
801 | 801 | |
802 | - // Set the To addresses with an associative array |
|
803 | - ->setTo(array ($mailData['mail'] => $mailData['name'])) |
|
802 | + // Set the To addresses with an associative array |
|
803 | + ->setTo(array ($mailData['mail'] => $mailData['name'])) |
|
804 | 804 | |
805 | - ->setBody($body, 'text/html') |
|
805 | + ->setBody($body, 'text/html') |
|
806 | 806 | |
807 | - ->send() |
|
808 | - ; |
|
807 | + ->send() |
|
808 | + ; |
|
809 | 809 | |
810 | - // protocol |
|
811 | - $insertArray = array ( |
|
812 | - 'pid' => $this->conf['pages'], |
|
813 | - 'file_name' => $pdfUrl, |
|
814 | - 'count_pages' => $numberOfPages, |
|
815 | - 'crdate' => time(), |
|
816 | - ); |
|
810 | + // protocol |
|
811 | + $insertArray = array ( |
|
812 | + 'pid' => $this->conf['pages'], |
|
813 | + 'file_name' => $pdfUrl, |
|
814 | + 'count_pages' => $numberOfPages, |
|
815 | + 'crdate' => time(), |
|
816 | + ); |
|
817 | 817 | |
818 | - if ($GLOBALS["TSFE"]->loginUser) { |
|
818 | + if ($GLOBALS["TSFE"]->loginUser) { |
|
819 | 819 | |
820 | - // internal user |
|
821 | - $insertArray['user_id'] = $GLOBALS["TSFE"]->fe_user->user['uid']; |
|
820 | + // internal user |
|
821 | + $insertArray['user_id'] = $GLOBALS["TSFE"]->fe_user->user['uid']; |
|
822 | 822 | |
823 | - $insertArray['name'] = $GLOBALS["TSFE"]->fe_user->user['username']; |
|
823 | + $insertArray['name'] = $GLOBALS["TSFE"]->fe_user->user['username']; |
|
824 | 824 | |
825 | - $insertArray['label'] = 'Mail: '.$mailData['mail']; |
|
825 | + $insertArray['label'] = 'Mail: '.$mailData['mail']; |
|
826 | 826 | |
827 | - } else { |
|
827 | + } else { |
|
828 | 828 | |
829 | - // external user |
|
830 | - $insertArray['user_id'] = 0; |
|
829 | + // external user |
|
830 | + $insertArray['user_id'] = 0; |
|
831 | 831 | |
832 | - $insertArray['name'] = 'n/a'; |
|
832 | + $insertArray['name'] = 'n/a'; |
|
833 | 833 | |
834 | - $insertArray['label'] = 'Mail: '.$mailData['mail']; |
|
834 | + $insertArray['label'] = 'Mail: '.$mailData['mail']; |
|
835 | 835 | |
836 | - } |
|
836 | + } |
|
837 | 837 | |
838 | - // add action to protocol |
|
839 | - $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_dlf_actionlog', $insertArray); |
|
838 | + // add action to protocol |
|
839 | + $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_dlf_actionlog', $insertArray); |
|
840 | 840 | |
841 | - } |
|
841 | + } |
|
842 | 842 | |
843 | - /** |
|
844 | - * Sends document information to an external printer (url) |
|
845 | - */ |
|
846 | - public function printDocument() { |
|
843 | + /** |
|
844 | + * Sends document information to an external printer (url) |
|
845 | + */ |
|
846 | + public function printDocument() { |
|
847 | 847 | |
848 | - $pdfUrl = $this->conf['pdfprint']; |
|
848 | + $pdfUrl = $this->conf['pdfprint']; |
|
849 | 849 | |
850 | - foreach ($this->piVars['selected'] as $docId => $docValue) { |
|
850 | + foreach ($this->piVars['selected'] as $docId => $docValue) { |
|
851 | 851 | |
852 | - if ($docValue['id']) { |
|
852 | + if ($docValue['id']) { |
|
853 | 853 | |
854 | - $docData = $this->getDocumentData($docValue['id'], $docValue); |
|
854 | + $docData = $this->getDocumentData($docValue['id'], $docValue); |
|
855 | 855 | |
856 | - $pdfUrl .= $docData['urlParams'].$this->conf['pdfparamseparator']; |
|
856 | + $pdfUrl .= $docData['urlParams'].$this->conf['pdfparamseparator']; |
|
857 | 857 | |
858 | - $numberOfPages += $docData['pageNums']; |
|
858 | + $numberOfPages += $docData['pageNums']; |
|
859 | 859 | |
860 | - } |
|
860 | + } |
|
861 | 861 | |
862 | - } |
|
862 | + } |
|
863 | 863 | |
864 | - // get printer data |
|
865 | - $printerId = $this->piVars['print_action']; |
|
864 | + // get printer data |
|
865 | + $printerId = $this->piVars['print_action']; |
|
866 | 866 | |
867 | - // get id from db and send selected doc downloadlink |
|
868 | - $resultPrinter = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
869 | - '*', |
|
870 | - 'tx_dlf_printer', |
|
871 | - 'tx_dlf_printer.uid="'.intval($printerId).'"'.tx_dlf_helper::whereClause('tx_dlf_basket'), |
|
872 | - '', |
|
873 | - '', |
|
874 | - '1' |
|
875 | - ); |
|
867 | + // get id from db and send selected doc downloadlink |
|
868 | + $resultPrinter = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
869 | + '*', |
|
870 | + 'tx_dlf_printer', |
|
871 | + 'tx_dlf_printer.uid="'.intval($printerId).'"'.tx_dlf_helper::whereClause('tx_dlf_basket'), |
|
872 | + '', |
|
873 | + '', |
|
874 | + '1' |
|
875 | + ); |
|
876 | 876 | |
877 | - $printerData = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resultPrinter); |
|
877 | + $printerData = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resultPrinter); |
|
878 | 878 | |
879 | - // printer is selected |
|
880 | - if ($printerData) { |
|
879 | + // printer is selected |
|
880 | + if ($printerData) { |
|
881 | 881 | |
882 | - $pdfUrl = $printerData['print']; |
|
882 | + $pdfUrl = $printerData['print']; |
|
883 | 883 | |
884 | - $filename = 'Document_'; |
|
884 | + $filename = 'Document_'; |
|
885 | 885 | |
886 | - $numberOfPages = 0; |
|
886 | + $numberOfPages = 0; |
|
887 | 887 | |
888 | - foreach ($this->piVars['selected'] as $docId => $docValue) { |
|
888 | + foreach ($this->piVars['selected'] as $docId => $docValue) { |
|
889 | 889 | |
890 | - if ($docValue['id']) { |
|
890 | + if ($docValue['id']) { |
|
891 | 891 | |
892 | - $filename .= $docValue['id'].'_'; |
|
892 | + $filename .= $docValue['id'].'_'; |
|
893 | 893 | |
894 | - $explodeId = explode("_", $docId); |
|
894 | + $explodeId = explode("_", $docId); |
|
895 | 895 | |
896 | - $docData = $this->getDocumentData($explodeId[0], $docValue); |
|
896 | + $docData = $this->getDocumentData($explodeId[0], $docValue); |
|
897 | 897 | |
898 | - $pdfUrl .= $docData['urlParams'].$this->conf['pdfparamseparator']; |
|
898 | + $pdfUrl .= $docData['urlParams'].$this->conf['pdfparamseparator']; |
|
899 | 899 | |
900 | - $numberOfPages += $docData['pageNums']; |
|
900 | + $numberOfPages += $docData['pageNums']; |
|
901 | 901 | |
902 | - } |
|
902 | + } |
|
903 | 903 | |
904 | - } |
|
904 | + } |
|
905 | 905 | |
906 | - $pdfUrl = trim($pdfUrl, $this->conf['pdfparamseparator']); |
|
906 | + $pdfUrl = trim($pdfUrl, $this->conf['pdfparamseparator']); |
|
907 | 907 | |
908 | - } |
|
908 | + } |
|
909 | 909 | |
910 | - // protocol |
|
911 | - $insertArray = array ( |
|
912 | - 'pid' => $this->conf['pages'], |
|
913 | - 'file_name' => $pdfUrl, |
|
914 | - 'count_pages' => $numberOfPages, |
|
915 | - 'crdate' => time(), |
|
916 | - ); |
|
910 | + // protocol |
|
911 | + $insertArray = array ( |
|
912 | + 'pid' => $this->conf['pages'], |
|
913 | + 'file_name' => $pdfUrl, |
|
914 | + 'count_pages' => $numberOfPages, |
|
915 | + 'crdate' => time(), |
|
916 | + ); |
|
917 | 917 | |
918 | - if ($GLOBALS["TSFE"]->loginUser) { |
|
918 | + if ($GLOBALS["TSFE"]->loginUser) { |
|
919 | 919 | |
920 | - // internal user |
|
921 | - $insertArray['user_id'] = $GLOBALS["TSFE"]->fe_user->user['uid']; |
|
920 | + // internal user |
|
921 | + $insertArray['user_id'] = $GLOBALS["TSFE"]->fe_user->user['uid']; |
|
922 | 922 | |
923 | - $insertArray['name'] = $GLOBALS["TSFE"]->fe_user->user['username']; |
|
923 | + $insertArray['name'] = $GLOBALS["TSFE"]->fe_user->user['username']; |
|
924 | 924 | |
925 | - $insertArray['label'] = 'Print: '.$printerData['label']; |
|
925 | + $insertArray['label'] = 'Print: '.$printerData['label']; |
|
926 | 926 | |
927 | - } else { |
|
927 | + } else { |
|
928 | 928 | |
929 | - // external user |
|
930 | - $insertArray['user_id'] = 0; |
|
929 | + // external user |
|
930 | + $insertArray['user_id'] = 0; |
|
931 | 931 | |
932 | - $insertArray['name'] = 'n/a'; |
|
932 | + $insertArray['name'] = 'n/a'; |
|
933 | 933 | |
934 | - $insertArray['label'] = 'Print: '.$printerData['label']; |
|
934 | + $insertArray['label'] = 'Print: '.$printerData['label']; |
|
935 | 935 | |
936 | - } |
|
936 | + } |
|
937 | 937 | |
938 | - // add action to protocol |
|
939 | - $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_dlf_actionlog', $insertArray); |
|
938 | + // add action to protocol |
|
939 | + $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_dlf_actionlog', $insertArray); |
|
940 | 940 | |
941 | - header('Location: '.$pdfUrl); |
|
941 | + header('Location: '.$pdfUrl); |
|
942 | 942 | |
943 | - ob_end_flush(); |
|
943 | + ob_end_flush(); |
|
944 | 944 | |
945 | - exit; |
|
945 | + exit; |
|
946 | 946 | |
947 | - } |
|
947 | + } |
|
948 | 948 | |
949 | 949 | } |
950 | 950 | \ No newline at end of file |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | |
211 | 211 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($resultMail) > 0) { |
212 | 212 | |
213 | - $mails = array (); |
|
213 | + $mails = array(); |
|
214 | 214 | |
215 | 215 | $mailForm = '<select name="tx_dlf[mail_action]">'; |
216 | 216 | |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | |
256 | 256 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($resultPrinter) > 0) { |
257 | 257 | |
258 | - $printers = array (); |
|
258 | + $printers = array(); |
|
259 | 259 | |
260 | 260 | $printForm = '<select name="tx_dlf[print_action]">'; |
261 | 261 | |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | |
299 | 299 | $label = $this->pi_getLL('goBasket', '', TRUE); |
300 | 300 | |
301 | - $basketConf = array ( |
|
301 | + $basketConf = array( |
|
302 | 302 | 'parameter' => $this->conf['targetBasket'], |
303 | 303 | 'title' => $label |
304 | 304 | ); |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | |
415 | 415 | if ($page != NULL || $_piVars['addToBasket'] == 'list') { |
416 | 416 | |
417 | - $documentItem = array ( |
|
417 | + $documentItem = array( |
|
418 | 418 | 'id' => intval($_piVars['id']), |
419 | 419 | 'startpage' => intval($_piVars['startpage']), |
420 | 420 | 'endpage' => intval($_piVars['endpage']), |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | |
435 | 435 | } else { |
436 | 436 | |
437 | - $items = array (); |
|
437 | + $items = array(); |
|
438 | 438 | |
439 | 439 | } |
440 | 440 | |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | |
524 | 524 | } |
525 | 525 | |
526 | - $update = array ('doc_ids' => json_encode($items)); |
|
526 | + $update = array('doc_ids' => json_encode($items)); |
|
527 | 527 | |
528 | 528 | $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_dlf_basket', 'uid='.intval($basketData['uid']), $update); |
529 | 529 | |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | |
532 | 532 | } |
533 | 533 | |
534 | - return array ('basketData' => $basketData, 'jsOutput' => $output); |
|
534 | + return array('basketData' => $basketData, 'jsOutput' => $output); |
|
535 | 535 | |
536 | 536 | } |
537 | 537 | |
@@ -581,11 +581,11 @@ discard block |
||
581 | 581 | |
582 | 582 | if (empty($items)) { |
583 | 583 | |
584 | - $update = array ('doc_ids' => ''); |
|
584 | + $update = array('doc_ids' => ''); |
|
585 | 585 | |
586 | 586 | } else { |
587 | 587 | |
588 | - $update = array ('doc_ids' => json_encode($items)); |
|
588 | + $update = array('doc_ids' => json_encode($items)); |
|
589 | 589 | |
590 | 590 | } |
591 | 591 | |
@@ -714,7 +714,7 @@ discard block |
||
714 | 714 | |
715 | 715 | } |
716 | 716 | |
717 | - return array ( |
|
717 | + return array( |
|
718 | 718 | 'downloadUrl' => $downloadUrl, |
719 | 719 | 'downloadLink' => $downloadLink, |
720 | 720 | 'pageNums' => $pageNums, |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | ->setFrom($from) |
801 | 801 | |
802 | 802 | // Set the To addresses with an associative array |
803 | - ->setTo(array ($mailData['mail'] => $mailData['name'])) |
|
803 | + ->setTo(array($mailData['mail'] => $mailData['name'])) |
|
804 | 804 | |
805 | 805 | ->setBody($body, 'text/html') |
806 | 806 | |
@@ -808,7 +808,7 @@ discard block |
||
808 | 808 | ; |
809 | 809 | |
810 | 810 | // protocol |
811 | - $insertArray = array ( |
|
811 | + $insertArray = array( |
|
812 | 812 | 'pid' => $this->conf['pages'], |
813 | 813 | 'file_name' => $pdfUrl, |
814 | 814 | 'count_pages' => $numberOfPages, |
@@ -908,7 +908,7 @@ discard block |
||
908 | 908 | } |
909 | 909 | |
910 | 910 | // protocol |
911 | - $insertArray = array ( |
|
911 | + $insertArray = array( |
|
912 | 912 | 'pid' => $this->conf['pages'], |
913 | 913 | 'file_name' => $pdfUrl, |
914 | 914 | 'count_pages' => $numberOfPages, |
@@ -19,315 +19,315 @@ |
||
19 | 19 | */ |
20 | 20 | class tx_dlf_navigation extends tx_dlf_plugin { |
21 | 21 | |
22 | - public $scriptRelPath = 'plugins/navigation/class.tx_dlf_navigation.php'; |
|
22 | + public $scriptRelPath = 'plugins/navigation/class.tx_dlf_navigation.php'; |
|
23 | 23 | |
24 | - /** |
|
25 | - * Display a link to the list view |
|
26 | - * |
|
27 | - * @access protected |
|
28 | - * |
|
29 | - * @return string Link to the list view ready to output |
|
30 | - */ |
|
31 | - protected function getLinkToListview() { |
|
24 | + /** |
|
25 | + * Display a link to the list view |
|
26 | + * |
|
27 | + * @access protected |
|
28 | + * |
|
29 | + * @return string Link to the list view ready to output |
|
30 | + */ |
|
31 | + protected function getLinkToListview() { |
|
32 | 32 | |
33 | - if (!empty($this->conf['targetPid'])) { |
|
33 | + if (!empty($this->conf['targetPid'])) { |
|
34 | 34 | |
35 | - // Load the list. |
|
36 | - $list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_dlf_list'); |
|
35 | + // Load the list. |
|
36 | + $list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_dlf_list'); |
|
37 | 37 | |
38 | - if (count($list) > 0) { |
|
38 | + if (count($list) > 0) { |
|
39 | 39 | |
40 | - // Build typolink configuration array. |
|
41 | - $conf = array ( |
|
42 | - 'useCacheHash' => 1, |
|
43 | - 'parameter' => $this->conf['targetPid'], |
|
44 | - 'title' => $this->pi_getLL('linkToList', '', TRUE) |
|
45 | - ); |
|
40 | + // Build typolink configuration array. |
|
41 | + $conf = array ( |
|
42 | + 'useCacheHash' => 1, |
|
43 | + 'parameter' => $this->conf['targetPid'], |
|
44 | + 'title' => $this->pi_getLL('linkToList', '', TRUE) |
|
45 | + ); |
|
46 | 46 | |
47 | - return $this->cObj->typoLink($this->pi_getLL('linkToList', '', TRUE), $conf); |
|
47 | + return $this->cObj->typoLink($this->pi_getLL('linkToList', '', TRUE), $conf); |
|
48 | 48 | |
49 | - } |
|
49 | + } |
|
50 | 50 | |
51 | - } |
|
51 | + } |
|
52 | 52 | |
53 | - return ''; |
|
53 | + return ''; |
|
54 | 54 | |
55 | - } |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * Display the page selector for the page view |
|
59 | - * |
|
60 | - * @access protected |
|
61 | - * |
|
62 | - * @return string Page selector ready to output |
|
63 | - */ |
|
64 | - protected function getPageSelector() { |
|
57 | + /** |
|
58 | + * Display the page selector for the page view |
|
59 | + * |
|
60 | + * @access protected |
|
61 | + * |
|
62 | + * @return string Page selector ready to output |
|
63 | + */ |
|
64 | + protected function getPageSelector() { |
|
65 | 65 | |
66 | - // Configure @action URL for form. |
|
67 | - $linkConf = array ( |
|
68 | - 'parameter' => $GLOBALS['TSFE']->id, |
|
69 | - 'forceAbsoluteUrl' => 1 |
|
70 | - ); |
|
66 | + // Configure @action URL for form. |
|
67 | + $linkConf = array ( |
|
68 | + 'parameter' => $GLOBALS['TSFE']->id, |
|
69 | + 'forceAbsoluteUrl' => 1 |
|
70 | + ); |
|
71 | 71 | |
72 | - $output = '<form action="'.$this->cObj->typoLink_URL($linkConf).'" method="get"><div><input type="hidden" name="id" value="'.$GLOBALS['TSFE']->id.'" />'; |
|
72 | + $output = '<form action="'.$this->cObj->typoLink_URL($linkConf).'" method="get"><div><input type="hidden" name="id" value="'.$GLOBALS['TSFE']->id.'" />'; |
|
73 | 73 | |
74 | - // Add plugin variables. |
|
75 | - foreach ($this->piVars as $piVar => $value) { |
|
74 | + // Add plugin variables. |
|
75 | + foreach ($this->piVars as $piVar => $value) { |
|
76 | 76 | |
77 | - if ($piVar != 'page' && $piVars != 'DATA' && !empty($value)) { |
|
77 | + if ($piVar != 'page' && $piVars != 'DATA' && !empty($value)) { |
|
78 | 78 | |
79 | - $output .= '<input type="hidden" name="'.$this->prefixId.'['.$piVar.']" value="'.$value.'" />'; |
|
79 | + $output .= '<input type="hidden" name="'.$this->prefixId.'['.$piVar.']" value="'.$value.'" />'; |
|
80 | 80 | |
81 | - } |
|
81 | + } |
|
82 | 82 | |
83 | - } |
|
83 | + } |
|
84 | 84 | |
85 | - // Add page selector. |
|
86 | - $uniqId = uniqid(str_replace('_', '-', get_class($this)).'-'); |
|
85 | + // Add page selector. |
|
86 | + $uniqId = uniqid(str_replace('_', '-', get_class($this)).'-'); |
|
87 | 87 | |
88 | - $output .= '<label for="'.$uniqId.'">'.$this->pi_getLL('selectPage', '', TRUE).'</label><select id="'.$uniqId.'" name="'.$this->prefixId.'[page]" onchange="javascript:this.form.submit();"'.($this->doc->numPages < 1 ? ' disabled="disabled"' : '').'>'; |
|
88 | + $output .= '<label for="'.$uniqId.'">'.$this->pi_getLL('selectPage', '', TRUE).'</label><select id="'.$uniqId.'" name="'.$this->prefixId.'[page]" onchange="javascript:this.form.submit();"'.($this->doc->numPages < 1 ? ' disabled="disabled"' : '').'>'; |
|
89 | 89 | |
90 | - for ($i = 1; $i <= $this->doc->numPages; $i++) { |
|
90 | + for ($i = 1; $i <= $this->doc->numPages; $i++) { |
|
91 | 91 | |
92 | - $output .= '<option value="'.$i.'"'.($this->piVars['page'] == $i ? ' selected="selected"' : '').'>['.$i.']'.($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$i]]['orderlabel'] ? ' - '.htmlspecialchars($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$i]]['orderlabel']) : '').'</option>'; |
|
92 | + $output .= '<option value="'.$i.'"'.($this->piVars['page'] == $i ? ' selected="selected"' : '').'>['.$i.']'.($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$i]]['orderlabel'] ? ' - '.htmlspecialchars($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$i]]['orderlabel']) : '').'</option>'; |
|
93 | 93 | |
94 | - } |
|
94 | + } |
|
95 | 95 | |
96 | - $output .= '</select></div></form>'; |
|
96 | + $output .= '</select></div></form>'; |
|
97 | 97 | |
98 | - return $output; |
|
98 | + return $output; |
|
99 | 99 | |
100 | - } |
|
100 | + } |
|
101 | 101 | |
102 | - /** |
|
103 | - * The main method of the PlugIn |
|
104 | - * |
|
105 | - * @access public |
|
106 | - * |
|
107 | - * @param string $content: The PlugIn content |
|
108 | - * @param array $conf: The PlugIn configuration |
|
109 | - * |
|
110 | - * @return string The content that is displayed on the website |
|
111 | - */ |
|
112 | - public function main($content, $conf) { |
|
102 | + /** |
|
103 | + * The main method of the PlugIn |
|
104 | + * |
|
105 | + * @access public |
|
106 | + * |
|
107 | + * @param string $content: The PlugIn content |
|
108 | + * @param array $conf: The PlugIn configuration |
|
109 | + * |
|
110 | + * @return string The content that is displayed on the website |
|
111 | + */ |
|
112 | + public function main($content, $conf) { |
|
113 | 113 | |
114 | - $this->init($conf); |
|
114 | + $this->init($conf); |
|
115 | 115 | |
116 | - // Turn cache on. |
|
117 | - $this->setCache(TRUE); |
|
116 | + // Turn cache on. |
|
117 | + $this->setCache(TRUE); |
|
118 | 118 | |
119 | - // Load current document. |
|
120 | - $this->loadDocument(); |
|
119 | + // Load current document. |
|
120 | + $this->loadDocument(); |
|
121 | 121 | |
122 | - if ($this->doc === NULL) { |
|
122 | + if ($this->doc === NULL) { |
|
123 | 123 | |
124 | - // Quit without doing anything if required variables are not set. |
|
125 | - return $content; |
|
124 | + // Quit without doing anything if required variables are not set. |
|
125 | + return $content; |
|
126 | 126 | |
127 | - } else { |
|
127 | + } else { |
|
128 | 128 | |
129 | - // Set default values if not set. |
|
130 | - if ($this->doc->numPages > 0) { |
|
129 | + // Set default values if not set. |
|
130 | + if ($this->doc->numPages > 0) { |
|
131 | 131 | |
132 | - if (!empty($this->piVars['logicalPage'])) { |
|
132 | + if (!empty($this->piVars['logicalPage'])) { |
|
133 | 133 | |
134 | - $this->piVars['page'] = $this->doc->getPhysicalPage($this->piVars['logicalPage']); |
|
135 | - // The logical page parameter should not appear |
|
136 | - unset($this->piVars['logicalPage']); |
|
134 | + $this->piVars['page'] = $this->doc->getPhysicalPage($this->piVars['logicalPage']); |
|
135 | + // The logical page parameter should not appear |
|
136 | + unset($this->piVars['logicalPage']); |
|
137 | 137 | |
138 | - } |
|
138 | + } |
|
139 | 139 | |
140 | - // Set default values if not set. |
|
141 | - // $this->piVars['page'] may be integer or string (physical structure @ID) |
|
142 | - if ((int) $this->piVars['page'] > 0 || empty($this->piVars['page'])) { |
|
140 | + // Set default values if not set. |
|
141 | + // $this->piVars['page'] may be integer or string (physical structure @ID) |
|
142 | + if ((int) $this->piVars['page'] > 0 || empty($this->piVars['page'])) { |
|
143 | 143 | |
144 | - $this->piVars['page'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange((int) $this->piVars['page'], 1, $this->doc->numPages, 1); |
|
144 | + $this->piVars['page'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange((int) $this->piVars['page'], 1, $this->doc->numPages, 1); |
|
145 | 145 | |
146 | - } else { |
|
146 | + } else { |
|
147 | 147 | |
148 | - $this->piVars['page'] = array_search($this->piVars['page'], $this->doc->physicalStructure); |
|
148 | + $this->piVars['page'] = array_search($this->piVars['page'], $this->doc->physicalStructure); |
|
149 | 149 | |
150 | - } |
|
150 | + } |
|
151 | 151 | |
152 | - $this->piVars['double'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->piVars['double'], 0, 1, 0); |
|
152 | + $this->piVars['double'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->piVars['double'], 0, 1, 0); |
|
153 | 153 | |
154 | - } else { |
|
154 | + } else { |
|
155 | 155 | |
156 | - $this->piVars['page'] = 0; |
|
156 | + $this->piVars['page'] = 0; |
|
157 | 157 | |
158 | - $this->piVars['double'] = 0; |
|
158 | + $this->piVars['double'] = 0; |
|
159 | 159 | |
160 | - } |
|
160 | + } |
|
161 | 161 | |
162 | - } |
|
162 | + } |
|
163 | 163 | |
164 | - // Load template file. |
|
165 | - if (!empty($this->conf['templateFile'])) { |
|
164 | + // Load template file. |
|
165 | + if (!empty($this->conf['templateFile'])) { |
|
166 | 166 | |
167 | - $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###'); |
|
167 | + $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###'); |
|
168 | 168 | |
169 | - } else { |
|
169 | + } else { |
|
170 | 170 | |
171 | - $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/navigation/template.tmpl'), '###TEMPLATE###'); |
|
171 | + $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/navigation/template.tmpl'), '###TEMPLATE###'); |
|
172 | 172 | |
173 | - } |
|
173 | + } |
|
174 | 174 | |
175 | - // Steps for X pages backward / forward. Double page view uses double steps. |
|
176 | - $pageSteps = $this->conf['pageStep'] * ($this->piVars['double'] + 1); |
|
175 | + // Steps for X pages backward / forward. Double page view uses double steps. |
|
176 | + $pageSteps = $this->conf['pageStep'] * ($this->piVars['double'] + 1); |
|
177 | 177 | |
178 | - // Link to first page. |
|
179 | - if ($this->piVars['page'] > 1) { |
|
178 | + // Link to first page. |
|
179 | + if ($this->piVars['page'] > 1) { |
|
180 | 180 | |
181 | - $markerArray['###FIRST###'] = $this->makeLink($this->pi_getLL('firstPage', '', TRUE), array ('page' => 1)); |
|
181 | + $markerArray['###FIRST###'] = $this->makeLink($this->pi_getLL('firstPage', '', TRUE), array ('page' => 1)); |
|
182 | 182 | |
183 | - } else { |
|
183 | + } else { |
|
184 | 184 | |
185 | - $markerArray['###FIRST###'] = '<span>'.$this->pi_getLL('firstPage', '', TRUE).'</span>'; |
|
185 | + $markerArray['###FIRST###'] = '<span>'.$this->pi_getLL('firstPage', '', TRUE).'</span>'; |
|
186 | 186 | |
187 | - } |
|
187 | + } |
|
188 | 188 | |
189 | - // Link back X pages. |
|
190 | - if ($this->piVars['page'] > $pageSteps) { |
|
189 | + // Link back X pages. |
|
190 | + if ($this->piVars['page'] > $pageSteps) { |
|
191 | 191 | |
192 | - $markerArray['###BACK###'] = $this->makeLink(sprintf($this->pi_getLL('backXPages', '', TRUE), $pageSteps), array ('page' => $this->piVars['page'] - $pageSteps)); |
|
192 | + $markerArray['###BACK###'] = $this->makeLink(sprintf($this->pi_getLL('backXPages', '', TRUE), $pageSteps), array ('page' => $this->piVars['page'] - $pageSteps)); |
|
193 | 193 | |
194 | - } else { |
|
194 | + } else { |
|
195 | 195 | |
196 | - $markerArray['###BACK###'] = '<span>'.sprintf($this->pi_getLL('backXPages', '', TRUE), $pageSteps).'</span>'; |
|
196 | + $markerArray['###BACK###'] = '<span>'.sprintf($this->pi_getLL('backXPages', '', TRUE), $pageSteps).'</span>'; |
|
197 | 197 | |
198 | - } |
|
198 | + } |
|
199 | 199 | |
200 | - // Link to previous page. |
|
201 | - if ($this->piVars['page'] > (1 + $this->piVars['double'])) { |
|
200 | + // Link to previous page. |
|
201 | + if ($this->piVars['page'] > (1 + $this->piVars['double'])) { |
|
202 | 202 | |
203 | - $markerArray['###PREVIOUS###'] = $this->makeLink($this->pi_getLL('prevPage', '', TRUE), array ('page' => $this->piVars['page'] - (1 + $this->piVars['double']))); |
|
203 | + $markerArray['###PREVIOUS###'] = $this->makeLink($this->pi_getLL('prevPage', '', TRUE), array ('page' => $this->piVars['page'] - (1 + $this->piVars['double']))); |
|
204 | 204 | |
205 | - } else { |
|
205 | + } else { |
|
206 | 206 | |
207 | - $markerArray['###PREVIOUS###'] = '<span>'.$this->pi_getLL('prevPage', '', TRUE).'</span>'; |
|
207 | + $markerArray['###PREVIOUS###'] = '<span>'.$this->pi_getLL('prevPage', '', TRUE).'</span>'; |
|
208 | 208 | |
209 | - } |
|
209 | + } |
|
210 | 210 | |
211 | - // Link to next page. |
|
212 | - if ($this->piVars['page'] < ($this->doc->numPages - $this->piVars['double'])) { |
|
211 | + // Link to next page. |
|
212 | + if ($this->piVars['page'] < ($this->doc->numPages - $this->piVars['double'])) { |
|
213 | 213 | |
214 | - $markerArray['###NEXT###'] = $this->makeLink($this->pi_getLL('nextPage', '', TRUE), array ('page' => $this->piVars['page'] + (1 + $this->piVars['double']))); |
|
214 | + $markerArray['###NEXT###'] = $this->makeLink($this->pi_getLL('nextPage', '', TRUE), array ('page' => $this->piVars['page'] + (1 + $this->piVars['double']))); |
|
215 | 215 | |
216 | - } else { |
|
216 | + } else { |
|
217 | 217 | |
218 | - $markerArray['###NEXT###'] = '<span>'.$this->pi_getLL('nextPage', '', TRUE).'</span>'; |
|
218 | + $markerArray['###NEXT###'] = '<span>'.$this->pi_getLL('nextPage', '', TRUE).'</span>'; |
|
219 | 219 | |
220 | - } |
|
220 | + } |
|
221 | 221 | |
222 | - // Link forward X pages. |
|
223 | - if ($this->piVars['page'] <= ($this->doc->numPages - $pageSteps)) { |
|
222 | + // Link forward X pages. |
|
223 | + if ($this->piVars['page'] <= ($this->doc->numPages - $pageSteps)) { |
|
224 | 224 | |
225 | - $markerArray['###FORWARD###'] = $this->makeLink(sprintf($this->pi_getLL('forwardXPages', '', TRUE), $pageSteps), array ('page' => $this->piVars['page'] + $pageSteps)); |
|
225 | + $markerArray['###FORWARD###'] = $this->makeLink(sprintf($this->pi_getLL('forwardXPages', '', TRUE), $pageSteps), array ('page' => $this->piVars['page'] + $pageSteps)); |
|
226 | 226 | |
227 | - } else { |
|
227 | + } else { |
|
228 | 228 | |
229 | - $markerArray['###FORWARD###'] = '<span>'.sprintf($this->pi_getLL('forwardXPages', '', TRUE), $pageSteps).'</span>'; |
|
229 | + $markerArray['###FORWARD###'] = '<span>'.sprintf($this->pi_getLL('forwardXPages', '', TRUE), $pageSteps).'</span>'; |
|
230 | 230 | |
231 | - } |
|
231 | + } |
|
232 | 232 | |
233 | - // Link to last page. |
|
234 | - if ($this->piVars['page'] < $this->doc->numPages) { |
|
233 | + // Link to last page. |
|
234 | + if ($this->piVars['page'] < $this->doc->numPages) { |
|
235 | 235 | |
236 | - $markerArray['###LAST###'] = $this->makeLink($this->pi_getLL('lastPage', '', TRUE), array ('page' => $this->doc->numPages)); |
|
236 | + $markerArray['###LAST###'] = $this->makeLink($this->pi_getLL('lastPage', '', TRUE), array ('page' => $this->doc->numPages)); |
|
237 | 237 | |
238 | - } else { |
|
238 | + } else { |
|
239 | 239 | |
240 | - $markerArray['###LAST###'] = '<span>'.$this->pi_getLL('lastPage', '', TRUE).'</span>'; |
|
240 | + $markerArray['###LAST###'] = '<span>'.$this->pi_getLL('lastPage', '', TRUE).'</span>'; |
|
241 | 241 | |
242 | - } |
|
242 | + } |
|
243 | 243 | |
244 | - // Add double page switcher. |
|
245 | - if ($this->doc->numPages > 0) { |
|
244 | + // Add double page switcher. |
|
245 | + if ($this->doc->numPages > 0) { |
|
246 | 246 | |
247 | - if (!$this->piVars['double']) { |
|
247 | + if (!$this->piVars['double']) { |
|
248 | 248 | |
249 | - $markerArray['###DOUBLEPAGE###'] = $this->makeLink($this->pi_getLL('doublePageOn', '', TRUE), array ('double' => 1), 'class="tx-dlf-navigation-doubleOn"'); |
|
249 | + $markerArray['###DOUBLEPAGE###'] = $this->makeLink($this->pi_getLL('doublePageOn', '', TRUE), array ('double' => 1), 'class="tx-dlf-navigation-doubleOn"'); |
|
250 | 250 | |
251 | - } else { |
|
251 | + } else { |
|
252 | 252 | |
253 | - $markerArray['###DOUBLEPAGE###'] = $this->makeLink($this->pi_getLL('doublePageOff', '', TRUE), array ('double' => 0), 'class="tx-dlf-navigation-doubleOff"'); |
|
253 | + $markerArray['###DOUBLEPAGE###'] = $this->makeLink($this->pi_getLL('doublePageOff', '', TRUE), array ('double' => 0), 'class="tx-dlf-navigation-doubleOff"'); |
|
254 | 254 | |
255 | - } |
|
255 | + } |
|
256 | 256 | |
257 | - if ($this->piVars['double'] && $this->piVars['page'] < $this->doc->numPages) { |
|
257 | + if ($this->piVars['double'] && $this->piVars['page'] < $this->doc->numPages) { |
|
258 | 258 | |
259 | - $markerArray['###DOUBLEPAGE+1###'] = $this->makeLink($this->pi_getLL('doublePage+1', '', TRUE), array ('page' => $this->piVars['page'] + 1)); |
|
259 | + $markerArray['###DOUBLEPAGE+1###'] = $this->makeLink($this->pi_getLL('doublePage+1', '', TRUE), array ('page' => $this->piVars['page'] + 1)); |
|
260 | 260 | |
261 | - } else { |
|
261 | + } else { |
|
262 | 262 | |
263 | - $markerArray['###DOUBLEPAGE+1###'] = '<span>'.$this->pi_getLL('doublePage+1', '', TRUE).'</span>'; |
|
263 | + $markerArray['###DOUBLEPAGE+1###'] = '<span>'.$this->pi_getLL('doublePage+1', '', TRUE).'</span>'; |
|
264 | 264 | |
265 | - } |
|
265 | + } |
|
266 | 266 | |
267 | - } else { |
|
267 | + } else { |
|
268 | 268 | |
269 | - $markerArray['###DOUBLEPAGE###'] = '<span>'.$this->pi_getLL('doublePageOn', '', TRUE).'</span>'; |
|
269 | + $markerArray['###DOUBLEPAGE###'] = '<span>'.$this->pi_getLL('doublePageOn', '', TRUE).'</span>'; |
|
270 | 270 | |
271 | - $markerArray['###DOUBLEPAGE+1###'] = '<span>'.$this->pi_getLL('doublePage+1', '', TRUE).'</span>'; |
|
271 | + $markerArray['###DOUBLEPAGE+1###'] = '<span>'.$this->pi_getLL('doublePage+1', '', TRUE).'</span>'; |
|
272 | 272 | |
273 | - } |
|
273 | + } |
|
274 | 274 | |
275 | - // Add page selector. |
|
276 | - $markerArray['###PAGESELECT###'] = $this->getPageSelector(); |
|
275 | + // Add page selector. |
|
276 | + $markerArray['###PAGESELECT###'] = $this->getPageSelector(); |
|
277 | 277 | |
278 | - // Add link to listview if applicable. |
|
279 | - $markerArray['###LINKLISTVIEW###'] = $this->getLinkToListview(); |
|
278 | + // Add link to listview if applicable. |
|
279 | + $markerArray['###LINKLISTVIEW###'] = $this->getLinkToListview(); |
|
280 | 280 | |
281 | - // fill some language labels if available |
|
282 | - $markerArray['###ZOOM_IN###'] = $this->pi_getLL('zoom-in', '', TRUE); |
|
283 | - $markerArray['###ZOOM_OUT###'] = $this->pi_getLL('zoom-out', '', TRUE); |
|
284 | - $markerArray['###ZOOM_FULLSCREEN###'] = $this->pi_getLL('zoom-fullscreen', '', TRUE); |
|
281 | + // fill some language labels if available |
|
282 | + $markerArray['###ZOOM_IN###'] = $this->pi_getLL('zoom-in', '', TRUE); |
|
283 | + $markerArray['###ZOOM_OUT###'] = $this->pi_getLL('zoom-out', '', TRUE); |
|
284 | + $markerArray['###ZOOM_FULLSCREEN###'] = $this->pi_getLL('zoom-fullscreen', '', TRUE); |
|
285 | 285 | |
286 | - $markerArray['###ROTATE_LEFT###'] = $this->pi_getLL('rotate-left', '', TRUE); |
|
287 | - $markerArray['###ROTATE_RIGHT###'] = $this->pi_getLL('rotate-right', '', TRUE); |
|
288 | - $markerArray['###ROTATE_RESET###'] = $this->pi_getLL('rotate-reset', '', TRUE); |
|
286 | + $markerArray['###ROTATE_LEFT###'] = $this->pi_getLL('rotate-left', '', TRUE); |
|
287 | + $markerArray['###ROTATE_RIGHT###'] = $this->pi_getLL('rotate-right', '', TRUE); |
|
288 | + $markerArray['###ROTATE_RESET###'] = $this->pi_getLL('rotate-reset', '', TRUE); |
|
289 | 289 | |
290 | - $content .= $this->cObj->substituteMarkerArray($this->template, $markerArray); |
|
290 | + $content .= $this->cObj->substituteMarkerArray($this->template, $markerArray); |
|
291 | 291 | |
292 | - return $this->pi_wrapInBaseClass($content); |
|
292 | + return $this->pi_wrapInBaseClass($content); |
|
293 | 293 | |
294 | - } |
|
294 | + } |
|
295 | 295 | |
296 | - /** |
|
297 | - * Generates a navigation link |
|
298 | - * |
|
299 | - * @access protected |
|
300 | - * |
|
301 | - * @param string $label: The link's text |
|
302 | - * @param array $overrulePIvars: The new set of plugin variables |
|
303 | - * @param string $aTagParams: Additional HTML attributes for link tag |
|
304 | - * |
|
305 | - * @return string Typolink ready to output |
|
306 | - */ |
|
307 | - protected function makeLink($label, array $overrulePIvars = array (), $aTagParams = '') { |
|
296 | + /** |
|
297 | + * Generates a navigation link |
|
298 | + * |
|
299 | + * @access protected |
|
300 | + * |
|
301 | + * @param string $label: The link's text |
|
302 | + * @param array $overrulePIvars: The new set of plugin variables |
|
303 | + * @param string $aTagParams: Additional HTML attributes for link tag |
|
304 | + * |
|
305 | + * @return string Typolink ready to output |
|
306 | + */ |
|
307 | + protected function makeLink($label, array $overrulePIvars = array (), $aTagParams = '') { |
|
308 | 308 | |
309 | - // Merge plugin variables with new set of values. |
|
310 | - if (is_array($this->piVars)) { |
|
309 | + // Merge plugin variables with new set of values. |
|
310 | + if (is_array($this->piVars)) { |
|
311 | 311 | |
312 | - $piVars = $this->piVars; |
|
312 | + $piVars = $this->piVars; |
|
313 | 313 | |
314 | - unset($piVars['DATA']); |
|
314 | + unset($piVars['DATA']); |
|
315 | 315 | |
316 | - $overrulePIvars = tx_dlf_helper::array_merge_recursive_overrule($piVars, $overrulePIvars); |
|
316 | + $overrulePIvars = tx_dlf_helper::array_merge_recursive_overrule($piVars, $overrulePIvars); |
|
317 | 317 | |
318 | - } |
|
318 | + } |
|
319 | 319 | |
320 | - // Build typolink configuration array. |
|
321 | - $conf = array ( |
|
322 | - 'useCacheHash' => 1, |
|
323 | - 'parameter' => $GLOBALS['TSFE']->id, |
|
324 | - 'ATagParams' => $aTagParams, |
|
325 | - 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $overrulePIvars, '', TRUE, FALSE), |
|
326 | - 'title' => $label |
|
327 | - ); |
|
320 | + // Build typolink configuration array. |
|
321 | + $conf = array ( |
|
322 | + 'useCacheHash' => 1, |
|
323 | + 'parameter' => $GLOBALS['TSFE']->id, |
|
324 | + 'ATagParams' => $aTagParams, |
|
325 | + 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $overrulePIvars, '', TRUE, FALSE), |
|
326 | + 'title' => $label |
|
327 | + ); |
|
328 | 328 | |
329 | - return $this->cObj->typoLink($label, $conf); |
|
329 | + return $this->cObj->typoLink($label, $conf); |
|
330 | 330 | |
331 | - } |
|
331 | + } |
|
332 | 332 | |
333 | 333 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | if (count($list) > 0) { |
39 | 39 | |
40 | 40 | // Build typolink configuration array. |
41 | - $conf = array ( |
|
41 | + $conf = array( |
|
42 | 42 | 'useCacheHash' => 1, |
43 | 43 | 'parameter' => $this->conf['targetPid'], |
44 | 44 | 'title' => $this->pi_getLL('linkToList', '', TRUE) |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | protected function getPageSelector() { |
65 | 65 | |
66 | 66 | // Configure @action URL for form. |
67 | - $linkConf = array ( |
|
67 | + $linkConf = array( |
|
68 | 68 | 'parameter' => $GLOBALS['TSFE']->id, |
69 | 69 | 'forceAbsoluteUrl' => 1 |
70 | 70 | ); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | // Link to first page. |
179 | 179 | if ($this->piVars['page'] > 1) { |
180 | 180 | |
181 | - $markerArray['###FIRST###'] = $this->makeLink($this->pi_getLL('firstPage', '', TRUE), array ('page' => 1)); |
|
181 | + $markerArray['###FIRST###'] = $this->makeLink($this->pi_getLL('firstPage', '', TRUE), array('page' => 1)); |
|
182 | 182 | |
183 | 183 | } else { |
184 | 184 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | // Link back X pages. |
190 | 190 | if ($this->piVars['page'] > $pageSteps) { |
191 | 191 | |
192 | - $markerArray['###BACK###'] = $this->makeLink(sprintf($this->pi_getLL('backXPages', '', TRUE), $pageSteps), array ('page' => $this->piVars['page'] - $pageSteps)); |
|
192 | + $markerArray['###BACK###'] = $this->makeLink(sprintf($this->pi_getLL('backXPages', '', TRUE), $pageSteps), array('page' => $this->piVars['page'] - $pageSteps)); |
|
193 | 193 | |
194 | 194 | } else { |
195 | 195 | |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | // Link to previous page. |
201 | 201 | if ($this->piVars['page'] > (1 + $this->piVars['double'])) { |
202 | 202 | |
203 | - $markerArray['###PREVIOUS###'] = $this->makeLink($this->pi_getLL('prevPage', '', TRUE), array ('page' => $this->piVars['page'] - (1 + $this->piVars['double']))); |
|
203 | + $markerArray['###PREVIOUS###'] = $this->makeLink($this->pi_getLL('prevPage', '', TRUE), array('page' => $this->piVars['page'] - (1 + $this->piVars['double']))); |
|
204 | 204 | |
205 | 205 | } else { |
206 | 206 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | // Link to next page. |
212 | 212 | if ($this->piVars['page'] < ($this->doc->numPages - $this->piVars['double'])) { |
213 | 213 | |
214 | - $markerArray['###NEXT###'] = $this->makeLink($this->pi_getLL('nextPage', '', TRUE), array ('page' => $this->piVars['page'] + (1 + $this->piVars['double']))); |
|
214 | + $markerArray['###NEXT###'] = $this->makeLink($this->pi_getLL('nextPage', '', TRUE), array('page' => $this->piVars['page'] + (1 + $this->piVars['double']))); |
|
215 | 215 | |
216 | 216 | } else { |
217 | 217 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | // Link forward X pages. |
223 | 223 | if ($this->piVars['page'] <= ($this->doc->numPages - $pageSteps)) { |
224 | 224 | |
225 | - $markerArray['###FORWARD###'] = $this->makeLink(sprintf($this->pi_getLL('forwardXPages', '', TRUE), $pageSteps), array ('page' => $this->piVars['page'] + $pageSteps)); |
|
225 | + $markerArray['###FORWARD###'] = $this->makeLink(sprintf($this->pi_getLL('forwardXPages', '', TRUE), $pageSteps), array('page' => $this->piVars['page'] + $pageSteps)); |
|
226 | 226 | |
227 | 227 | } else { |
228 | 228 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | // Link to last page. |
234 | 234 | if ($this->piVars['page'] < $this->doc->numPages) { |
235 | 235 | |
236 | - $markerArray['###LAST###'] = $this->makeLink($this->pi_getLL('lastPage', '', TRUE), array ('page' => $this->doc->numPages)); |
|
236 | + $markerArray['###LAST###'] = $this->makeLink($this->pi_getLL('lastPage', '', TRUE), array('page' => $this->doc->numPages)); |
|
237 | 237 | |
238 | 238 | } else { |
239 | 239 | |
@@ -246,17 +246,17 @@ discard block |
||
246 | 246 | |
247 | 247 | if (!$this->piVars['double']) { |
248 | 248 | |
249 | - $markerArray['###DOUBLEPAGE###'] = $this->makeLink($this->pi_getLL('doublePageOn', '', TRUE), array ('double' => 1), 'class="tx-dlf-navigation-doubleOn"'); |
|
249 | + $markerArray['###DOUBLEPAGE###'] = $this->makeLink($this->pi_getLL('doublePageOn', '', TRUE), array('double' => 1), 'class="tx-dlf-navigation-doubleOn"'); |
|
250 | 250 | |
251 | 251 | } else { |
252 | 252 | |
253 | - $markerArray['###DOUBLEPAGE###'] = $this->makeLink($this->pi_getLL('doublePageOff', '', TRUE), array ('double' => 0), 'class="tx-dlf-navigation-doubleOff"'); |
|
253 | + $markerArray['###DOUBLEPAGE###'] = $this->makeLink($this->pi_getLL('doublePageOff', '', TRUE), array('double' => 0), 'class="tx-dlf-navigation-doubleOff"'); |
|
254 | 254 | |
255 | 255 | } |
256 | 256 | |
257 | 257 | if ($this->piVars['double'] && $this->piVars['page'] < $this->doc->numPages) { |
258 | 258 | |
259 | - $markerArray['###DOUBLEPAGE+1###'] = $this->makeLink($this->pi_getLL('doublePage+1', '', TRUE), array ('page' => $this->piVars['page'] + 1)); |
|
259 | + $markerArray['###DOUBLEPAGE+1###'] = $this->makeLink($this->pi_getLL('doublePage+1', '', TRUE), array('page' => $this->piVars['page'] + 1)); |
|
260 | 260 | |
261 | 261 | } else { |
262 | 262 | |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | * |
305 | 305 | * @return string Typolink ready to output |
306 | 306 | */ |
307 | - protected function makeLink($label, array $overrulePIvars = array (), $aTagParams = '') { |
|
307 | + protected function makeLink($label, array $overrulePIvars = array(), $aTagParams = '') { |
|
308 | 308 | |
309 | 309 | // Merge plugin variables with new set of values. |
310 | 310 | if (is_array($this->piVars)) { |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | } |
319 | 319 | |
320 | 320 | // Build typolink configuration array. |
321 | - $conf = array ( |
|
321 | + $conf = array( |
|
322 | 322 | 'useCacheHash' => 1, |
323 | 323 | 'parameter' => $GLOBALS['TSFE']->id, |
324 | 324 | 'ATagParams' => $aTagParams, |
@@ -20,689 +20,689 @@ |
||
20 | 20 | */ |
21 | 21 | class tx_dlf_listview extends tx_dlf_plugin { |
22 | 22 | |
23 | - public $scriptRelPath = 'plugins/listview/class.tx_dlf_listview.php'; |
|
23 | + public $scriptRelPath = 'plugins/listview/class.tx_dlf_listview.php'; |
|
24 | 24 | |
25 | - /** |
|
26 | - * This holds the list |
|
27 | - * |
|
28 | - * @var tx_dlf_list |
|
29 | - * @access protected |
|
30 | - */ |
|
31 | - protected $list; |
|
25 | + /** |
|
26 | + * This holds the list |
|
27 | + * |
|
28 | + * @var tx_dlf_list |
|
29 | + * @access protected |
|
30 | + */ |
|
31 | + protected $list; |
|
32 | 32 | |
33 | - /** |
|
34 | - * Array of sorted metadata |
|
35 | - * |
|
36 | - * @var array |
|
37 | - * @access protected |
|
38 | - */ |
|
39 | - protected $metadata = array (); |
|
33 | + /** |
|
34 | + * Array of sorted metadata |
|
35 | + * |
|
36 | + * @var array |
|
37 | + * @access protected |
|
38 | + */ |
|
39 | + protected $metadata = array (); |
|
40 | 40 | |
41 | - /** |
|
42 | - * Array of sortable metadata |
|
43 | - * |
|
44 | - * @var array |
|
45 | - * @access protected |
|
46 | - */ |
|
47 | - protected $sortables = array (); |
|
41 | + /** |
|
42 | + * Array of sortable metadata |
|
43 | + * |
|
44 | + * @var array |
|
45 | + * @access protected |
|
46 | + */ |
|
47 | + protected $sortables = array (); |
|
48 | 48 | |
49 | - /** |
|
50 | - * Renders the page browser |
|
51 | - * |
|
52 | - * @access protected |
|
53 | - * |
|
54 | - * @return string The rendered page browser ready for output |
|
55 | - */ |
|
56 | - protected function getPageBrowser() { |
|
49 | + /** |
|
50 | + * Renders the page browser |
|
51 | + * |
|
52 | + * @access protected |
|
53 | + * |
|
54 | + * @return string The rendered page browser ready for output |
|
55 | + */ |
|
56 | + protected function getPageBrowser() { |
|
57 | 57 | |
58 | - // Get overall number of pages. |
|
59 | - $maxPages = intval(ceil(count($this->list) / $this->conf['limit'])); |
|
58 | + // Get overall number of pages. |
|
59 | + $maxPages = intval(ceil(count($this->list) / $this->conf['limit'])); |
|
60 | 60 | |
61 | - // Return empty pagebrowser if there is just one page. |
|
62 | - if ($maxPages < 2) { |
|
61 | + // Return empty pagebrowser if there is just one page. |
|
62 | + if ($maxPages < 2) { |
|
63 | 63 | |
64 | - return ''; |
|
64 | + return ''; |
|
65 | 65 | |
66 | - } |
|
66 | + } |
|
67 | 67 | |
68 | - // Get separator. |
|
69 | - $separator = $this->pi_getLL('separator', ' - ', TRUE); |
|
68 | + // Get separator. |
|
69 | + $separator = $this->pi_getLL('separator', ' - ', TRUE); |
|
70 | 70 | |
71 | - // Add link to previous page. |
|
72 | - if ($this->piVars['pointer'] > 0) { |
|
71 | + // Add link to previous page. |
|
72 | + if ($this->piVars['pointer'] > 0) { |
|
73 | 73 | |
74 | - $output = $this->pi_linkTP_keepPIvars($this->pi_getLL('prevPage', '<', TRUE), array ('pointer' => $this->piVars['pointer'] - 1), TRUE).$separator; |
|
74 | + $output = $this->pi_linkTP_keepPIvars($this->pi_getLL('prevPage', '<', TRUE), array ('pointer' => $this->piVars['pointer'] - 1), TRUE).$separator; |
|
75 | 75 | |
76 | - } else { |
|
76 | + } else { |
|
77 | 77 | |
78 | - $output = $this->pi_getLL('prevPage', '<', TRUE).$separator; |
|
78 | + $output = $this->pi_getLL('prevPage', '<', TRUE).$separator; |
|
79 | 79 | |
80 | - } |
|
80 | + } |
|
81 | 81 | |
82 | - $i = 0; |
|
82 | + $i = 0; |
|
83 | 83 | |
84 | - $skip = NULL; |
|
84 | + $skip = NULL; |
|
85 | 85 | |
86 | - // Add links to pages. |
|
87 | - while ($i < $maxPages) { |
|
86 | + // Add links to pages. |
|
87 | + while ($i < $maxPages) { |
|
88 | 88 | |
89 | - if ($i < 3 || ($i > $this->piVars['pointer'] - 3 && $i < $this->piVars['pointer'] + 3) || $i > $maxPages - 4) { |
|
89 | + if ($i < 3 || ($i > $this->piVars['pointer'] - 3 && $i < $this->piVars['pointer'] + 3) || $i > $maxPages - 4) { |
|
90 | 90 | |
91 | - if ($this->piVars['pointer'] != $i) { |
|
91 | + if ($this->piVars['pointer'] != $i) { |
|
92 | 92 | |
93 | - $output .= $this->pi_linkTP_keepPIvars(sprintf($this->pi_getLL('page', '%d', TRUE), $i + 1), array ('pointer' => $i), TRUE).$separator; |
|
93 | + $output .= $this->pi_linkTP_keepPIvars(sprintf($this->pi_getLL('page', '%d', TRUE), $i + 1), array ('pointer' => $i), TRUE).$separator; |
|
94 | 94 | |
95 | - } else { |
|
95 | + } else { |
|
96 | 96 | |
97 | - $output .= sprintf($this->pi_getLL('page', '%d', TRUE), $i + 1).$separator; |
|
97 | + $output .= sprintf($this->pi_getLL('page', '%d', TRUE), $i + 1).$separator; |
|
98 | 98 | |
99 | - } |
|
99 | + } |
|
100 | 100 | |
101 | - $skip = TRUE; |
|
101 | + $skip = TRUE; |
|
102 | 102 | |
103 | - } elseif ($skip === TRUE) { |
|
103 | + } elseif ($skip === TRUE) { |
|
104 | 104 | |
105 | - $output .= $this->pi_getLL('skip', '...', TRUE).$separator; |
|
105 | + $output .= $this->pi_getLL('skip', '...', TRUE).$separator; |
|
106 | 106 | |
107 | - $skip = FALSE; |
|
107 | + $skip = FALSE; |
|
108 | 108 | |
109 | - } |
|
109 | + } |
|
110 | 110 | |
111 | - $i++; |
|
111 | + $i++; |
|
112 | 112 | |
113 | - } |
|
113 | + } |
|
114 | 114 | |
115 | - // Add link to next page. |
|
116 | - if ($this->piVars['pointer'] < $maxPages - 1) { |
|
115 | + // Add link to next page. |
|
116 | + if ($this->piVars['pointer'] < $maxPages - 1) { |
|
117 | 117 | |
118 | - $output .= $this->pi_linkTP_keepPIvars($this->pi_getLL('nextPage', '>', TRUE), array ('pointer' => $this->piVars['pointer'] + 1), TRUE); |
|
118 | + $output .= $this->pi_linkTP_keepPIvars($this->pi_getLL('nextPage', '>', TRUE), array ('pointer' => $this->piVars['pointer'] + 1), TRUE); |
|
119 | 119 | |
120 | - } else { |
|
120 | + } else { |
|
121 | 121 | |
122 | - $output .= $this->pi_getLL('nextPage', '>', TRUE); |
|
122 | + $output .= $this->pi_getLL('nextPage', '>', TRUE); |
|
123 | 123 | |
124 | - } |
|
124 | + } |
|
125 | 125 | |
126 | - return $output; |
|
126 | + return $output; |
|
127 | 127 | |
128 | - } |
|
128 | + } |
|
129 | 129 | |
130 | - /** |
|
131 | - * Renders one entry of the list |
|
132 | - * |
|
133 | - * @access protected |
|
134 | - * |
|
135 | - * @param integer $number: The number of the entry |
|
136 | - * @param string $template: Parsed template subpart |
|
137 | - * |
|
138 | - * @return string The rendered entry ready for output |
|
139 | - */ |
|
140 | - protected function getEntry($number, $template) { |
|
130 | + /** |
|
131 | + * Renders one entry of the list |
|
132 | + * |
|
133 | + * @access protected |
|
134 | + * |
|
135 | + * @param integer $number: The number of the entry |
|
136 | + * @param string $template: Parsed template subpart |
|
137 | + * |
|
138 | + * @return string The rendered entry ready for output |
|
139 | + */ |
|
140 | + protected function getEntry($number, $template) { |
|
141 | 141 | |
142 | - $markerArray['###NUMBER###'] = $number + 1; |
|
142 | + $markerArray['###NUMBER###'] = $number + 1; |
|
143 | 143 | |
144 | - $markerArray['###METADATA###'] = ''; |
|
144 | + $markerArray['###METADATA###'] = ''; |
|
145 | 145 | |
146 | - $markerArray['###THUMBNAIL###'] = ''; |
|
146 | + $markerArray['###THUMBNAIL###'] = ''; |
|
147 | 147 | |
148 | - $markerArray['###PREVIEW###'] = ''; |
|
148 | + $markerArray['###PREVIEW###'] = ''; |
|
149 | 149 | |
150 | - $subpart = ''; |
|
150 | + $subpart = ''; |
|
151 | 151 | |
152 | - $imgAlt = ''; |
|
152 | + $imgAlt = ''; |
|
153 | 153 | |
154 | - $metadata = $this->list[$number]['metadata']; |
|
154 | + $metadata = $this->list[$number]['metadata']; |
|
155 | 155 | |
156 | - foreach ($this->metadata as $index_name => $metaConf) { |
|
156 | + foreach ($this->metadata as $index_name => $metaConf) { |
|
157 | 157 | |
158 | - $parsedValue = ''; |
|
158 | + $parsedValue = ''; |
|
159 | 159 | |
160 | - $fieldwrap = $this->parseTS($metaConf['wrap']); |
|
160 | + $fieldwrap = $this->parseTS($metaConf['wrap']); |
|
161 | 161 | |
162 | - do { |
|
162 | + do { |
|
163 | 163 | |
164 | - $value = @array_shift($metadata[$index_name]); |
|
164 | + $value = @array_shift($metadata[$index_name]); |
|
165 | 165 | |
166 | - // Link title to pageview. |
|
167 | - if ($index_name == 'title') { |
|
166 | + // Link title to pageview. |
|
167 | + if ($index_name == 'title') { |
|
168 | 168 | |
169 | - // Get title of parent document if needed. |
|
170 | - if (empty($value) && $this->conf['getTitle']) { |
|
169 | + // Get title of parent document if needed. |
|
170 | + if (empty($value) && $this->conf['getTitle']) { |
|
171 | 171 | |
172 | - $superiorTitle = tx_dlf_document::getTitle($this->list[$number]['uid'], TRUE); |
|
172 | + $superiorTitle = tx_dlf_document::getTitle($this->list[$number]['uid'], TRUE); |
|
173 | 173 | |
174 | - if (!empty($superiorTitle)) { |
|
174 | + if (!empty($superiorTitle)) { |
|
175 | 175 | |
176 | - $value = '['.$superiorTitle.']'; |
|
176 | + $value = '['.$superiorTitle.']'; |
|
177 | 177 | |
178 | - } |
|
178 | + } |
|
179 | 179 | |
180 | - } |
|
180 | + } |
|
181 | 181 | |
182 | - // Set fake title if still not present. |
|
183 | - if (empty($value)) { |
|
182 | + // Set fake title if still not present. |
|
183 | + if (empty($value)) { |
|
184 | 184 | |
185 | - $value = $this->pi_getLL('noTitle'); |
|
185 | + $value = $this->pi_getLL('noTitle'); |
|
186 | 186 | |
187 | - } |
|
187 | + } |
|
188 | 188 | |
189 | - $imgAlt = htmlspecialchars($value); |
|
189 | + $imgAlt = htmlspecialchars($value); |
|
190 | 190 | |
191 | - $additionalParams = array ( |
|
192 | - 'id' => $this->list[$number]['uid'], |
|
193 | - 'page' => $this->list[$number]['page'] |
|
194 | - ); |
|
191 | + $additionalParams = array ( |
|
192 | + 'id' => $this->list[$number]['uid'], |
|
193 | + 'page' => $this->list[$number]['page'] |
|
194 | + ); |
|
195 | 195 | |
196 | - if (!empty($this->piVars['logicalPage'])) { |
|
196 | + if (!empty($this->piVars['logicalPage'])) { |
|
197 | 197 | |
198 | - $additionalParams['logicalPage'] = $this->piVars['logicalPage']; |
|
198 | + $additionalParams['logicalPage'] = $this->piVars['logicalPage']; |
|
199 | 199 | |
200 | - } |
|
200 | + } |
|
201 | 201 | |
202 | - $conf = array ( |
|
203 | - 'useCacheHash' => 1, |
|
204 | - 'parameter' => $this->conf['targetPid'], |
|
205 | - 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE) |
|
206 | - ); |
|
202 | + $conf = array ( |
|
203 | + 'useCacheHash' => 1, |
|
204 | + 'parameter' => $this->conf['targetPid'], |
|
205 | + 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE) |
|
206 | + ); |
|
207 | 207 | |
208 | - $value = $this->cObj->typoLink(htmlspecialchars($value), $conf); |
|
208 | + $value = $this->cObj->typoLink(htmlspecialchars($value), $conf); |
|
209 | 209 | |
210 | - // Translate name of holding library. |
|
211 | - } elseif ($index_name == 'owner' && !empty($value)) { |
|
210 | + // Translate name of holding library. |
|
211 | + } elseif ($index_name == 'owner' && !empty($value)) { |
|
212 | 212 | |
213 | - $value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_libraries', $this->conf['pages'])); |
|
213 | + $value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_libraries', $this->conf['pages'])); |
|
214 | 214 | |
215 | - // Translate document type. |
|
216 | - } elseif ($index_name == 'type' && !empty($value)) { |
|
215 | + // Translate document type. |
|
216 | + } elseif ($index_name == 'type' && !empty($value)) { |
|
217 | 217 | |
218 | - $value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_structures', $this->conf['pages'])); |
|
218 | + $value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_structures', $this->conf['pages'])); |
|
219 | 219 | |
220 | - // Translate ISO 639 language code. |
|
221 | - } elseif ($index_name == 'language' && !empty($value)) { |
|
220 | + // Translate ISO 639 language code. |
|
221 | + } elseif ($index_name == 'language' && !empty($value)) { |
|
222 | 222 | |
223 | - $value = htmlspecialchars(tx_dlf_helper::getLanguageName($value)); |
|
223 | + $value = htmlspecialchars(tx_dlf_helper::getLanguageName($value)); |
|
224 | 224 | |
225 | - } elseif (!empty($value)) { |
|
225 | + } elseif (!empty($value)) { |
|
226 | 226 | |
227 | - $value = htmlspecialchars($value); |
|
227 | + $value = htmlspecialchars($value); |
|
228 | 228 | |
229 | - } |
|
229 | + } |
|
230 | 230 | |
231 | - $value = $this->cObj->stdWrap($value, $fieldwrap['value.']); |
|
231 | + $value = $this->cObj->stdWrap($value, $fieldwrap['value.']); |
|
232 | 232 | |
233 | - if (!empty($value)) { |
|
233 | + if (!empty($value)) { |
|
234 | 234 | |
235 | - $parsedValue .= $value; |
|
235 | + $parsedValue .= $value; |
|
236 | 236 | |
237 | - } |
|
237 | + } |
|
238 | 238 | |
239 | - } while (count($metadata[$index_name])); |
|
239 | + } while (count($metadata[$index_name])); |
|
240 | 240 | |
241 | - if (!empty($parsedValue)) { |
|
241 | + if (!empty($parsedValue)) { |
|
242 | 242 | |
243 | - $field = $this->cObj->stdWrap(htmlspecialchars($metaConf['label']), $fieldwrap['key.']); |
|
243 | + $field = $this->cObj->stdWrap(htmlspecialchars($metaConf['label']), $fieldwrap['key.']); |
|
244 | 244 | |
245 | - $field .= $parsedValue; |
|
245 | + $field .= $parsedValue; |
|
246 | 246 | |
247 | - $markerArray['###METADATA###'] .= $this->cObj->stdWrap($field, $fieldwrap['all.']); |
|
247 | + $markerArray['###METADATA###'] .= $this->cObj->stdWrap($field, $fieldwrap['all.']); |
|
248 | 248 | |
249 | - } |
|
249 | + } |
|
250 | 250 | |
251 | - } |
|
251 | + } |
|
252 | 252 | |
253 | - // Add thumbnail. |
|
254 | - if (!empty($this->list[$number]['thumbnail'])) { |
|
253 | + // Add thumbnail. |
|
254 | + if (!empty($this->list[$number]['thumbnail'])) { |
|
255 | 255 | |
256 | - $markerArray['###THUMBNAIL###'] = '<img alt="'.$imgAlt.'" src="'.$this->list[$number]['thumbnail'].'" />'; |
|
256 | + $markerArray['###THUMBNAIL###'] = '<img alt="'.$imgAlt.'" src="'.$this->list[$number]['thumbnail'].'" />'; |
|
257 | 257 | |
258 | - } |
|
258 | + } |
|
259 | 259 | |
260 | - // Add preview. |
|
261 | - if (!empty($this->list[$number]['preview'])) { |
|
260 | + // Add preview. |
|
261 | + if (!empty($this->list[$number]['preview'])) { |
|
262 | 262 | |
263 | - $markerArray['###PREVIEW###'] = $this->list[$number]['preview']; |
|
263 | + $markerArray['###PREVIEW###'] = $this->list[$number]['preview']; |
|
264 | 264 | |
265 | - } |
|
265 | + } |
|
266 | 266 | |
267 | - if (!empty($this->list[$number]['subparts'])) { |
|
267 | + if (!empty($this->list[$number]['subparts'])) { |
|
268 | 268 | |
269 | - $subpart = $this->getSubEntries($number, $template); |
|
269 | + $subpart = $this->getSubEntries($number, $template); |
|
270 | 270 | |
271 | - } |
|
271 | + } |
|
272 | 272 | |
273 | - // basket button |
|
274 | - $markerArray['###BASKETBUTTON###'] = ''; |
|
273 | + // basket button |
|
274 | + $markerArray['###BASKETBUTTON###'] = ''; |
|
275 | 275 | |
276 | - if (!empty($this->conf['basketButton']) && !empty($this->conf['targetBasket'])) { |
|
276 | + if (!empty($this->conf['basketButton']) && !empty($this->conf['targetBasket'])) { |
|
277 | 277 | |
278 | - $additionalParams = array ('id' => $this->list[$number]['uid'], 'startpage' => $this->list[$number]['page'], 'addToBasket' => 'list'); |
|
278 | + $additionalParams = array ('id' => $this->list[$number]['uid'], 'startpage' => $this->list[$number]['page'], 'addToBasket' => 'list'); |
|
279 | 279 | |
280 | - $conf = array ( |
|
281 | - 'useCacheHash' => 1, |
|
282 | - 'parameter' => $this->conf['targetBasket'], |
|
283 | - 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE) |
|
284 | - ); |
|
280 | + $conf = array ( |
|
281 | + 'useCacheHash' => 1, |
|
282 | + 'parameter' => $this->conf['targetBasket'], |
|
283 | + 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE) |
|
284 | + ); |
|
285 | 285 | |
286 | - $link = $this->cObj->typoLink($this->pi_getLL('addBasket', '', TRUE), $conf); |
|
286 | + $link = $this->cObj->typoLink($this->pi_getLL('addBasket', '', TRUE), $conf); |
|
287 | 287 | |
288 | - $markerArray['###BASKETBUTTON###'] = $link; |
|
288 | + $markerArray['###BASKETBUTTON###'] = $link; |
|
289 | 289 | |
290 | - } |
|
290 | + } |
|
291 | 291 | |
292 | - return $this->cObj->substituteMarkerArray($this->cObj->substituteSubpart($template['entry'], '###SUBTEMPLATE###', $subpart, TRUE), $markerArray); |
|
292 | + return $this->cObj->substituteMarkerArray($this->cObj->substituteSubpart($template['entry'], '###SUBTEMPLATE###', $subpart, TRUE), $markerArray); |
|
293 | 293 | |
294 | - } |
|
294 | + } |
|
295 | 295 | |
296 | - /** |
|
297 | - * Renders sorting dialog |
|
298 | - * |
|
299 | - * @access protected |
|
300 | - * |
|
301 | - * @return string The rendered sorting dialog ready for output |
|
302 | - */ |
|
303 | - protected function getSortingForm() { |
|
296 | + /** |
|
297 | + * Renders sorting dialog |
|
298 | + * |
|
299 | + * @access protected |
|
300 | + * |
|
301 | + * @return string The rendered sorting dialog ready for output |
|
302 | + */ |
|
303 | + protected function getSortingForm() { |
|
304 | 304 | |
305 | - // Return nothing if there are no sortable metadata fields. |
|
306 | - if (!count($this->sortables)) { |
|
305 | + // Return nothing if there are no sortable metadata fields. |
|
306 | + if (!count($this->sortables)) { |
|
307 | 307 | |
308 | - return ''; |
|
308 | + return ''; |
|
309 | 309 | |
310 | - } |
|
310 | + } |
|
311 | 311 | |
312 | - // Set class prefix. |
|
313 | - $prefix = str_replace('_', '-', get_class($this)); |
|
312 | + // Set class prefix. |
|
313 | + $prefix = str_replace('_', '-', get_class($this)); |
|
314 | 314 | |
315 | - // Configure @action URL for form. |
|
316 | - $linkConf = array ( |
|
317 | - 'parameter' => $GLOBALS['TSFE']->id, |
|
318 | - 'forceAbsoluteUrl' => 1 |
|
319 | - ); |
|
315 | + // Configure @action URL for form. |
|
316 | + $linkConf = array ( |
|
317 | + 'parameter' => $GLOBALS['TSFE']->id, |
|
318 | + 'forceAbsoluteUrl' => 1 |
|
319 | + ); |
|
320 | 320 | |
321 | - if (!empty($this->piVars['logicalPage'])) { |
|
321 | + if (!empty($this->piVars['logicalPage'])) { |
|
322 | 322 | |
323 | - $linkConf['additionalParams'] = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, array ('logicalPage' => $this->piVars['logicalPage']), '', TRUE, FALSE); |
|
323 | + $linkConf['additionalParams'] = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, array ('logicalPage' => $this->piVars['logicalPage']), '', TRUE, FALSE); |
|
324 | 324 | |
325 | - } |
|
325 | + } |
|
326 | 326 | |
327 | - // Build HTML form. |
|
328 | - $sorting = '<form action="'.$this->cObj->typoLink_URL($linkConf).'" method="get"><div><input type="hidden" name="id" value="'.$GLOBALS['TSFE']->id.'" />'; |
|
327 | + // Build HTML form. |
|
328 | + $sorting = '<form action="'.$this->cObj->typoLink_URL($linkConf).'" method="get"><div><input type="hidden" name="id" value="'.$GLOBALS['TSFE']->id.'" />'; |
|
329 | 329 | |
330 | - foreach ($this->piVars as $piVar => $value) { |
|
330 | + foreach ($this->piVars as $piVar => $value) { |
|
331 | 331 | |
332 | - if ($piVar != 'order' && $piVar != 'DATA' && !empty($value)) { |
|
332 | + if ($piVar != 'order' && $piVar != 'DATA' && !empty($value)) { |
|
333 | 333 | |
334 | - $sorting .= '<input type="hidden" name="'.$this->prefixId.'['.$piVar.']" value="'.$value.'" />'; |
|
334 | + $sorting .= '<input type="hidden" name="'.$this->prefixId.'['.$piVar.']" value="'.$value.'" />'; |
|
335 | 335 | |
336 | - } |
|
336 | + } |
|
337 | 337 | |
338 | - } |
|
338 | + } |
|
339 | 339 | |
340 | - // Select sort field. |
|
341 | - $uniqId = uniqid($prefix.'-'); |
|
340 | + // Select sort field. |
|
341 | + $uniqId = uniqid($prefix.'-'); |
|
342 | 342 | |
343 | - $sorting .= '<label for="'.$uniqId.'">'.$this->pi_getLL('orderBy', '', TRUE).'</label><select id="'.$uniqId.'" name="'.$this->prefixId.'[order]" onchange="javascript:this.form.submit();">'; |
|
343 | + $sorting .= '<label for="'.$uniqId.'">'.$this->pi_getLL('orderBy', '', TRUE).'</label><select id="'.$uniqId.'" name="'.$this->prefixId.'[order]" onchange="javascript:this.form.submit();">'; |
|
344 | 344 | |
345 | - // Add relevance sorting if this is a search result list. |
|
346 | - if ($this->list->metadata['options']['source'] == 'search') { |
|
345 | + // Add relevance sorting if this is a search result list. |
|
346 | + if ($this->list->metadata['options']['source'] == 'search') { |
|
347 | 347 | |
348 | - $sorting .= '<option value="relevance"'.(($this->list->metadata['options']['order'] == 'relevance') ? ' selected="selected"' : '').'>'.$this->pi_getLL('relevance', '', TRUE).'</option>'; |
|
348 | + $sorting .= '<option value="relevance"'.(($this->list->metadata['options']['order'] == 'relevance') ? ' selected="selected"' : '').'>'.$this->pi_getLL('relevance', '', TRUE).'</option>'; |
|
349 | 349 | |
350 | - } |
|
350 | + } |
|
351 | 351 | |
352 | - foreach ($this->sortables as $index_name => $label) { |
|
352 | + foreach ($this->sortables as $index_name => $label) { |
|
353 | 353 | |
354 | - $sorting .= '<option value="'.$index_name.'"'.(($this->list->metadata['options']['order'] == $index_name) ? ' selected="selected"' : '').'>'.htmlspecialchars($label).'</option>'; |
|
354 | + $sorting .= '<option value="'.$index_name.'"'.(($this->list->metadata['options']['order'] == $index_name) ? ' selected="selected"' : '').'>'.htmlspecialchars($label).'</option>'; |
|
355 | 355 | |
356 | - } |
|
356 | + } |
|
357 | 357 | |
358 | - $sorting .= '</select>'; |
|
358 | + $sorting .= '</select>'; |
|
359 | 359 | |
360 | - // Select sort direction. |
|
361 | - $uniqId = uniqid($prefix.'-'); |
|
360 | + // Select sort direction. |
|
361 | + $uniqId = uniqid($prefix.'-'); |
|
362 | 362 | |
363 | - $sorting .= '<label for="'.$uniqId.'">'.$this->pi_getLL('direction', '', TRUE).'</label><select id="'.$uniqId.'" name="'.$this->prefixId.'[asc]" onchange="javascript:this.form.submit();">'; |
|
363 | + $sorting .= '<label for="'.$uniqId.'">'.$this->pi_getLL('direction', '', TRUE).'</label><select id="'.$uniqId.'" name="'.$this->prefixId.'[asc]" onchange="javascript:this.form.submit();">'; |
|
364 | 364 | |
365 | - $sorting .= '<option value="1" '.($this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '').'>'.$this->pi_getLL('direction.asc', '', TRUE).'</option>'; |
|
365 | + $sorting .= '<option value="1" '.($this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '').'>'.$this->pi_getLL('direction.asc', '', TRUE).'</option>'; |
|
366 | 366 | |
367 | - $sorting .= '<option value="0" '.(!$this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '').'>'.$this->pi_getLL('direction.desc', '', TRUE).'</option>'; |
|
367 | + $sorting .= '<option value="0" '.(!$this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '').'>'.$this->pi_getLL('direction.desc', '', TRUE).'</option>'; |
|
368 | 368 | |
369 | - $sorting .= '</select></div></form>'; |
|
369 | + $sorting .= '</select></div></form>'; |
|
370 | 370 | |
371 | - return $sorting; |
|
371 | + return $sorting; |
|
372 | 372 | |
373 | - } |
|
373 | + } |
|
374 | 374 | |
375 | - /** |
|
376 | - * Renders all sub-entries of one entry |
|
377 | - * |
|
378 | - * @access protected |
|
379 | - * |
|
380 | - * @param integer $number: The number of the entry |
|
381 | - * @param string $template: Parsed template subpart |
|
382 | - * |
|
383 | - * @return string The rendered entries ready for output |
|
384 | - */ |
|
385 | - protected function getSubEntries($number, $template) { |
|
375 | + /** |
|
376 | + * Renders all sub-entries of one entry |
|
377 | + * |
|
378 | + * @access protected |
|
379 | + * |
|
380 | + * @param integer $number: The number of the entry |
|
381 | + * @param string $template: Parsed template subpart |
|
382 | + * |
|
383 | + * @return string The rendered entries ready for output |
|
384 | + */ |
|
385 | + protected function getSubEntries($number, $template) { |
|
386 | 386 | |
387 | - $content = ''; |
|
387 | + $content = ''; |
|
388 | 388 | |
389 | - foreach ($this->list[$number]['subparts'] as $subpart) { |
|
389 | + foreach ($this->list[$number]['subparts'] as $subpart) { |
|
390 | 390 | |
391 | - $markerArray['###SUBMETADATA###'] = ''; |
|
391 | + $markerArray['###SUBMETADATA###'] = ''; |
|
392 | 392 | |
393 | - $markerArray['###SUBTHUMBNAIL###'] = ''; |
|
393 | + $markerArray['###SUBTHUMBNAIL###'] = ''; |
|
394 | 394 | |
395 | - $markerArray['###SUBPREVIEW###'] = ''; |
|
395 | + $markerArray['###SUBPREVIEW###'] = ''; |
|
396 | 396 | |
397 | - $imgAlt = ''; |
|
397 | + $imgAlt = ''; |
|
398 | 398 | |
399 | - foreach ($this->metadata as $index_name => $metaConf) { |
|
399 | + foreach ($this->metadata as $index_name => $metaConf) { |
|
400 | 400 | |
401 | - $parsedValue = ''; |
|
401 | + $parsedValue = ''; |
|
402 | 402 | |
403 | - $fieldwrap = $this->parseTS($metaConf['wrap']); |
|
403 | + $fieldwrap = $this->parseTS($metaConf['wrap']); |
|
404 | 404 | |
405 | - do { |
|
405 | + do { |
|
406 | 406 | |
407 | - $value = @array_shift($subpart['metadata'][$index_name]); |
|
407 | + $value = @array_shift($subpart['metadata'][$index_name]); |
|
408 | 408 | |
409 | - // Link title to pageview. |
|
410 | - if ($index_name == 'title') { |
|
409 | + // Link title to pageview. |
|
410 | + if ($index_name == 'title') { |
|
411 | 411 | |
412 | - // Get title of parent document if needed. |
|
413 | - if (empty($value) && $this->conf['getTitle']) { |
|
412 | + // Get title of parent document if needed. |
|
413 | + if (empty($value) && $this->conf['getTitle']) { |
|
414 | 414 | |
415 | - $superiorTitle = tx_dlf_document::getTitle($subpart['uid'], TRUE); |
|
415 | + $superiorTitle = tx_dlf_document::getTitle($subpart['uid'], TRUE); |
|
416 | 416 | |
417 | - if (!empty($superiorTitle)) { |
|
417 | + if (!empty($superiorTitle)) { |
|
418 | 418 | |
419 | - $value = '['.$superiorTitle.']'; |
|
419 | + $value = '['.$superiorTitle.']'; |
|
420 | 420 | |
421 | - } |
|
421 | + } |
|
422 | 422 | |
423 | - } |
|
423 | + } |
|
424 | 424 | |
425 | - // Set fake title if still not present. |
|
426 | - if (empty($value)) { |
|
425 | + // Set fake title if still not present. |
|
426 | + if (empty($value)) { |
|
427 | 427 | |
428 | - $value = $this->pi_getLL('noTitle'); |
|
428 | + $value = $this->pi_getLL('noTitle'); |
|
429 | 429 | |
430 | - } |
|
430 | + } |
|
431 | 431 | |
432 | - $imgAlt = htmlspecialchars($value); |
|
432 | + $imgAlt = htmlspecialchars($value); |
|
433 | 433 | |
434 | - $additionalParams = array ( |
|
435 | - 'id' => $subpart['uid'], |
|
436 | - 'page' => $subpart['page'], |
|
437 | - 'highlight_word' => preg_replace('/\s\s+/', ';', $this->list->metadata['searchString']) |
|
438 | - ); |
|
434 | + $additionalParams = array ( |
|
435 | + 'id' => $subpart['uid'], |
|
436 | + 'page' => $subpart['page'], |
|
437 | + 'highlight_word' => preg_replace('/\s\s+/', ';', $this->list->metadata['searchString']) |
|
438 | + ); |
|
439 | 439 | |
440 | - if (!empty($this->piVars['logicalPage'])) { |
|
440 | + if (!empty($this->piVars['logicalPage'])) { |
|
441 | 441 | |
442 | - $additionalParams['logicalPage'] = $this->piVars['logicalPage']; |
|
442 | + $additionalParams['logicalPage'] = $this->piVars['logicalPage']; |
|
443 | 443 | |
444 | - } |
|
444 | + } |
|
445 | 445 | |
446 | - $conf = array ( |
|
447 | - // we don't want cHash in case of search parameters |
|
448 | - 'useCacheHash' => empty($this->list->metadata['searchString']) ? 1 : 0, |
|
449 | - 'parameter' => $this->conf['targetPid'], |
|
450 | - 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE) |
|
451 | - ); |
|
446 | + $conf = array ( |
|
447 | + // we don't want cHash in case of search parameters |
|
448 | + 'useCacheHash' => empty($this->list->metadata['searchString']) ? 1 : 0, |
|
449 | + 'parameter' => $this->conf['targetPid'], |
|
450 | + 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE) |
|
451 | + ); |
|
452 | 452 | |
453 | - $value = $this->cObj->typoLink(htmlspecialchars($value), $conf); |
|
453 | + $value = $this->cObj->typoLink(htmlspecialchars($value), $conf); |
|
454 | 454 | |
455 | - // Translate name of holding library. |
|
456 | - } elseif ($index_name == 'owner' && !empty($value)) { |
|
455 | + // Translate name of holding library. |
|
456 | + } elseif ($index_name == 'owner' && !empty($value)) { |
|
457 | 457 | |
458 | - $value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_libraries', $this->conf['pages'])); |
|
458 | + $value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_libraries', $this->conf['pages'])); |
|
459 | 459 | |
460 | - // Translate document type. |
|
461 | - } elseif ($index_name == 'type' && !empty($value)) { |
|
460 | + // Translate document type. |
|
461 | + } elseif ($index_name == 'type' && !empty($value)) { |
|
462 | 462 | |
463 | - $_value = $value; |
|
463 | + $_value = $value; |
|
464 | 464 | |
465 | - $value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_structures', $this->conf['pages'])); |
|
465 | + $value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_structures', $this->conf['pages'])); |
|
466 | 466 | |
467 | - // Add page number for single pages. |
|
468 | - if ($_value == 'page') { |
|
467 | + // Add page number for single pages. |
|
468 | + if ($_value == 'page') { |
|
469 | 469 | |
470 | - $value .= ' '.intval($subpart['page']); |
|
470 | + $value .= ' '.intval($subpart['page']); |
|
471 | 471 | |
472 | - } |
|
472 | + } |
|
473 | 473 | |
474 | - // Translate ISO 639 language code. |
|
475 | - } elseif ($index_name == 'language' && !empty($value)) { |
|
474 | + // Translate ISO 639 language code. |
|
475 | + } elseif ($index_name == 'language' && !empty($value)) { |
|
476 | 476 | |
477 | - $value = htmlspecialchars(tx_dlf_helper::getLanguageName($value)); |
|
477 | + $value = htmlspecialchars(tx_dlf_helper::getLanguageName($value)); |
|
478 | 478 | |
479 | - } elseif (!empty($value)) { |
|
479 | + } elseif (!empty($value)) { |
|
480 | 480 | |
481 | - $value = htmlspecialchars($value); |
|
481 | + $value = htmlspecialchars($value); |
|
482 | 482 | |
483 | - } |
|
483 | + } |
|
484 | 484 | |
485 | - $value = $this->cObj->stdWrap($value, $fieldwrap['value.']); |
|
485 | + $value = $this->cObj->stdWrap($value, $fieldwrap['value.']); |
|
486 | 486 | |
487 | - if (!empty($value)) { |
|
487 | + if (!empty($value)) { |
|
488 | 488 | |
489 | - $parsedValue .= $value; |
|
489 | + $parsedValue .= $value; |
|
490 | 490 | |
491 | - } |
|
491 | + } |
|
492 | 492 | |
493 | - } while (count($subpart['metadata'][$index_name])); |
|
493 | + } while (count($subpart['metadata'][$index_name])); |
|
494 | 494 | |
495 | - if (!empty($parsedValue)) { |
|
495 | + if (!empty($parsedValue)) { |
|
496 | 496 | |
497 | - $field = $this->cObj->stdWrap(htmlspecialchars($metaConf['label']), $fieldwrap['key.']); |
|
497 | + $field = $this->cObj->stdWrap(htmlspecialchars($metaConf['label']), $fieldwrap['key.']); |
|
498 | 498 | |
499 | - $field .= $parsedValue; |
|
499 | + $field .= $parsedValue; |
|
500 | 500 | |
501 | - $markerArray['###SUBMETADATA###'] .= $this->cObj->stdWrap($field, $fieldwrap['all.']); |
|
501 | + $markerArray['###SUBMETADATA###'] .= $this->cObj->stdWrap($field, $fieldwrap['all.']); |
|
502 | 502 | |
503 | - } |
|
503 | + } |
|
504 | 504 | |
505 | - } |
|
505 | + } |
|
506 | 506 | |
507 | - // Add thumbnail. |
|
508 | - if (!empty($subpart['thumbnail'])) { |
|
507 | + // Add thumbnail. |
|
508 | + if (!empty($subpart['thumbnail'])) { |
|
509 | 509 | |
510 | - $markerArray['###SUBTHUMBNAIL###'] = '<img alt="'.$imgAlt.'" src="'.$subpart['thumbnail'].'" />'; |
|
510 | + $markerArray['###SUBTHUMBNAIL###'] = '<img alt="'.$imgAlt.'" src="'.$subpart['thumbnail'].'" />'; |
|
511 | 511 | |
512 | - } |
|
512 | + } |
|
513 | 513 | |
514 | - // Add preview. |
|
515 | - if (!empty($subpart['preview'])) { |
|
514 | + // Add preview. |
|
515 | + if (!empty($subpart['preview'])) { |
|
516 | 516 | |
517 | - $markerArray['###SUBPREVIEW###'] = $subpart['preview']; |
|
517 | + $markerArray['###SUBPREVIEW###'] = $subpart['preview']; |
|
518 | 518 | |
519 | - } |
|
519 | + } |
|
520 | 520 | |
521 | - // basket button |
|
522 | - $markerArray['###SUBBASKETBUTTON###'] = ''; |
|
521 | + // basket button |
|
522 | + $markerArray['###SUBBASKETBUTTON###'] = ''; |
|
523 | 523 | |
524 | - if (!empty($this->conf['basketButton']) && !empty($this->conf['targetBasket'])) { |
|
524 | + if (!empty($this->conf['basketButton']) && !empty($this->conf['targetBasket'])) { |
|
525 | 525 | |
526 | - $additionalParams = array ('id' => $this->list[$number]['uid'], 'startpage' => $subpart['page'], 'endpage' => $subpart['page'], 'logId' => $subpart['sid'], 'addToBasket' => 'subentry'); |
|
526 | + $additionalParams = array ('id' => $this->list[$number]['uid'], 'startpage' => $subpart['page'], 'endpage' => $subpart['page'], 'logId' => $subpart['sid'], 'addToBasket' => 'subentry'); |
|
527 | 527 | |
528 | - $conf = array ( |
|
529 | - 'useCacheHash' => 1, |
|
530 | - 'parameter' => $this->conf['targetBasket'], |
|
531 | - 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE) |
|
532 | - ); |
|
528 | + $conf = array ( |
|
529 | + 'useCacheHash' => 1, |
|
530 | + 'parameter' => $this->conf['targetBasket'], |
|
531 | + 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE) |
|
532 | + ); |
|
533 | 533 | |
534 | - $link = $this->cObj->typoLink($this->pi_getLL('addBasket', '', TRUE), $conf); |
|
534 | + $link = $this->cObj->typoLink($this->pi_getLL('addBasket', '', TRUE), $conf); |
|
535 | 535 | |
536 | - $markerArray['###SUBBASKETBUTTON###'] = $link; |
|
536 | + $markerArray['###SUBBASKETBUTTON###'] = $link; |
|
537 | 537 | |
538 | - } |
|
538 | + } |
|
539 | 539 | |
540 | - $content .= $this->cObj->substituteMarkerArray($template['subentry'], $markerArray); |
|
540 | + $content .= $this->cObj->substituteMarkerArray($template['subentry'], $markerArray); |
|
541 | 541 | |
542 | - } |
|
542 | + } |
|
543 | 543 | |
544 | - return $this->cObj->substituteSubpart($this->cObj->getSubpart($this->template, '###SUBTEMPLATE###'), '###SUBENTRY###', $content, TRUE); |
|
544 | + return $this->cObj->substituteSubpart($this->cObj->getSubpart($this->template, '###SUBTEMPLATE###'), '###SUBENTRY###', $content, TRUE); |
|
545 | 545 | |
546 | - } |
|
546 | + } |
|
547 | 547 | |
548 | - /** |
|
549 | - * Get metadata configuration from database |
|
550 | - * |
|
551 | - * @access protected |
|
552 | - * |
|
553 | - * @return void |
|
554 | - */ |
|
555 | - protected function loadConfig() { |
|
548 | + /** |
|
549 | + * Get metadata configuration from database |
|
550 | + * |
|
551 | + * @access protected |
|
552 | + * |
|
553 | + * @return void |
|
554 | + */ |
|
555 | + protected function loadConfig() { |
|
556 | 556 | |
557 | - $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
558 | - 'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.wrap AS wrap,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.is_sortable AS is_sortable', |
|
559 | - 'tx_dlf_metadata', |
|
560 | - '(tx_dlf_metadata.is_listed=1 OR tx_dlf_metadata.is_sortable=1) AND tx_dlf_metadata.pid='.intval($this->conf['pages']).tx_dlf_helper::whereClause('tx_dlf_metadata'), |
|
561 | - '', |
|
562 | - 'tx_dlf_metadata.sorting ASC', |
|
563 | - '' |
|
564 | - ); |
|
557 | + $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
558 | + 'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.wrap AS wrap,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.is_sortable AS is_sortable', |
|
559 | + 'tx_dlf_metadata', |
|
560 | + '(tx_dlf_metadata.is_listed=1 OR tx_dlf_metadata.is_sortable=1) AND tx_dlf_metadata.pid='.intval($this->conf['pages']).tx_dlf_helper::whereClause('tx_dlf_metadata'), |
|
561 | + '', |
|
562 | + 'tx_dlf_metadata.sorting ASC', |
|
563 | + '' |
|
564 | + ); |
|
565 | 565 | |
566 | - while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
|
566 | + while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
|
567 | 567 | |
568 | - if ($resArray['is_listed']) { |
|
568 | + if ($resArray['is_listed']) { |
|
569 | 569 | |
570 | - $this->metadata[$resArray['index_name']] = array ( |
|
571 | - 'wrap' => $resArray['wrap'], |
|
572 | - 'label' => tx_dlf_helper::translate($resArray['index_name'], 'tx_dlf_metadata', $this->conf['pages']) |
|
573 | - ); |
|
570 | + $this->metadata[$resArray['index_name']] = array ( |
|
571 | + 'wrap' => $resArray['wrap'], |
|
572 | + 'label' => tx_dlf_helper::translate($resArray['index_name'], 'tx_dlf_metadata', $this->conf['pages']) |
|
573 | + ); |
|
574 | 574 | |
575 | - } |
|
575 | + } |
|
576 | 576 | |
577 | - if ($resArray['is_sortable']) { |
|
577 | + if ($resArray['is_sortable']) { |
|
578 | 578 | |
579 | - $this->sortables[$resArray['index_name']] = tx_dlf_helper::translate($resArray['index_name'], 'tx_dlf_metadata', $this->conf['pages']); |
|
579 | + $this->sortables[$resArray['index_name']] = tx_dlf_helper::translate($resArray['index_name'], 'tx_dlf_metadata', $this->conf['pages']); |
|
580 | 580 | |
581 | - } |
|
581 | + } |
|
582 | 582 | |
583 | - } |
|
583 | + } |
|
584 | 584 | |
585 | - } |
|
585 | + } |
|
586 | 586 | |
587 | - /** |
|
588 | - * The main method of the PlugIn |
|
589 | - * |
|
590 | - * @access public |
|
591 | - * |
|
592 | - * @param string $content: The PlugIn content |
|
593 | - * @param array $conf: The PlugIn configuration |
|
594 | - * |
|
595 | - * @return string The content that is displayed on the website |
|
596 | - */ |
|
597 | - public function main($content, $conf) { |
|
587 | + /** |
|
588 | + * The main method of the PlugIn |
|
589 | + * |
|
590 | + * @access public |
|
591 | + * |
|
592 | + * @param string $content: The PlugIn content |
|
593 | + * @param array $conf: The PlugIn configuration |
|
594 | + * |
|
595 | + * @return string The content that is displayed on the website |
|
596 | + */ |
|
597 | + public function main($content, $conf) { |
|
598 | 598 | |
599 | - $this->init($conf); |
|
599 | + $this->init($conf); |
|
600 | 600 | |
601 | - // Don't cache the output. |
|
602 | - $this->setCache(FALSE); |
|
601 | + // Don't cache the output. |
|
602 | + $this->setCache(FALSE); |
|
603 | 603 | |
604 | - // Load the list. |
|
605 | - $this->list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_dlf_list'); |
|
604 | + // Load the list. |
|
605 | + $this->list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_dlf_list'); |
|
606 | 606 | |
607 | - // Sort the list if applicable. |
|
608 | - if ((!empty($this->piVars['order']) && $this->piVars['order'] != $this->list->metadata['options']['order']) |
|
609 | - || (isset($this->piVars['asc']) && $this->piVars['asc'] != $this->list->metadata['options']['order.asc'])) { |
|
607 | + // Sort the list if applicable. |
|
608 | + if ((!empty($this->piVars['order']) && $this->piVars['order'] != $this->list->metadata['options']['order']) |
|
609 | + || (isset($this->piVars['asc']) && $this->piVars['asc'] != $this->list->metadata['options']['order.asc'])) { |
|
610 | 610 | |
611 | - // Order list by given field. |
|
612 | - $this->list->sort($this->piVars['order'], (boolean) $this->piVars['asc']); |
|
611 | + // Order list by given field. |
|
612 | + $this->list->sort($this->piVars['order'], (boolean) $this->piVars['asc']); |
|
613 | 613 | |
614 | - // Update list's metadata. |
|
615 | - $listMetadata = $this->list->metadata; |
|
614 | + // Update list's metadata. |
|
615 | + $listMetadata = $this->list->metadata; |
|
616 | 616 | |
617 | - $listMetadata['options']['order'] = $this->piVars['order']; |
|
617 | + $listMetadata['options']['order'] = $this->piVars['order']; |
|
618 | 618 | |
619 | - $listMetadata['options']['order.asc'] = (boolean) $this->piVars['asc']; |
|
619 | + $listMetadata['options']['order.asc'] = (boolean) $this->piVars['asc']; |
|
620 | 620 | |
621 | - $this->list->metadata = $listMetadata; |
|
621 | + $this->list->metadata = $listMetadata; |
|
622 | 622 | |
623 | - // Save updated list. |
|
624 | - $this->list->save(); |
|
623 | + // Save updated list. |
|
624 | + $this->list->save(); |
|
625 | 625 | |
626 | - // Reset pointer. |
|
627 | - $this->piVars['pointer'] = 0; |
|
626 | + // Reset pointer. |
|
627 | + $this->piVars['pointer'] = 0; |
|
628 | 628 | |
629 | - } |
|
629 | + } |
|
630 | 630 | |
631 | - // Load template file. |
|
632 | - if (!empty($this->conf['templateFile'])) { |
|
631 | + // Load template file. |
|
632 | + if (!empty($this->conf['templateFile'])) { |
|
633 | 633 | |
634 | - $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###'); |
|
634 | + $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###'); |
|
635 | 635 | |
636 | - } else { |
|
636 | + } else { |
|
637 | 637 | |
638 | - $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/listview/template.tmpl'), '###TEMPLATE###'); |
|
638 | + $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/listview/template.tmpl'), '###TEMPLATE###'); |
|
639 | 639 | |
640 | - } |
|
640 | + } |
|
641 | 641 | |
642 | - $subpartArray['entry'] = $this->cObj->getSubpart($this->template, '###ENTRY###'); |
|
642 | + $subpartArray['entry'] = $this->cObj->getSubpart($this->template, '###ENTRY###'); |
|
643 | 643 | |
644 | - $subpartArray['subentry'] = $this->cObj->getSubpart($this->template, '###SUBENTRY###'); |
|
644 | + $subpartArray['subentry'] = $this->cObj->getSubpart($this->template, '###SUBENTRY###'); |
|
645 | 645 | |
646 | - // Set some variable defaults. |
|
647 | - if (!empty($this->piVars['pointer']) && (($this->piVars['pointer'] * $this->conf['limit']) + 1) <= count($this->list)) { |
|
646 | + // Set some variable defaults. |
|
647 | + if (!empty($this->piVars['pointer']) && (($this->piVars['pointer'] * $this->conf['limit']) + 1) <= count($this->list)) { |
|
648 | 648 | |
649 | - $this->piVars['pointer'] = max(intval($this->piVars['pointer']), 0); |
|
649 | + $this->piVars['pointer'] = max(intval($this->piVars['pointer']), 0); |
|
650 | 650 | |
651 | - } else { |
|
651 | + } else { |
|
652 | 652 | |
653 | - $this->piVars['pointer'] = 0; |
|
653 | + $this->piVars['pointer'] = 0; |
|
654 | 654 | |
655 | - } |
|
655 | + } |
|
656 | 656 | |
657 | - // Load metadata configuration. |
|
658 | - $this->loadConfig(); |
|
657 | + // Load metadata configuration. |
|
658 | + $this->loadConfig(); |
|
659 | 659 | |
660 | - for ($i = $this->piVars['pointer'] * $this->conf['limit'], $j = ($this->piVars['pointer'] + 1) * $this->conf['limit']; $i < $j; $i++) { |
|
660 | + for ($i = $this->piVars['pointer'] * $this->conf['limit'], $j = ($this->piVars['pointer'] + 1) * $this->conf['limit']; $i < $j; $i++) { |
|
661 | 661 | |
662 | - if (empty($this->list[$i])) { |
|
662 | + if (empty($this->list[$i])) { |
|
663 | 663 | |
664 | - break; |
|
664 | + break; |
|
665 | 665 | |
666 | - } else { |
|
666 | + } else { |
|
667 | 667 | |
668 | - $content .= $this->getEntry($i, $subpartArray); |
|
668 | + $content .= $this->getEntry($i, $subpartArray); |
|
669 | 669 | |
670 | - } |
|
670 | + } |
|
671 | 671 | |
672 | - } |
|
672 | + } |
|
673 | 673 | |
674 | - $markerArray['###LISTTITLE###'] = $this->list->metadata['label']; |
|
674 | + $markerArray['###LISTTITLE###'] = $this->list->metadata['label']; |
|
675 | 675 | |
676 | - $markerArray['###LISTDESCRIPTION###'] = $this->list->metadata['description']; |
|
676 | + $markerArray['###LISTDESCRIPTION###'] = $this->list->metadata['description']; |
|
677 | 677 | |
678 | - if (!empty($this->list->metadata['thumbnail'])) { |
|
678 | + if (!empty($this->list->metadata['thumbnail'])) { |
|
679 | 679 | |
680 | - $markerArray['###LISTTHUMBNAIL###'] = '<img alt="" src="'.$this->list->metadata['thumbnail'].'" />'; |
|
680 | + $markerArray['###LISTTHUMBNAIL###'] = '<img alt="" src="'.$this->list->metadata['thumbnail'].'" />'; |
|
681 | 681 | |
682 | - } else { |
|
682 | + } else { |
|
683 | 683 | |
684 | - $markerArray['###LISTTHUMBNAIL###'] = ''; |
|
684 | + $markerArray['###LISTTHUMBNAIL###'] = ''; |
|
685 | 685 | |
686 | - } |
|
686 | + } |
|
687 | 687 | |
688 | - if ($i) { |
|
688 | + if ($i) { |
|
689 | 689 | |
690 | - $markerArray['###COUNT###'] = htmlspecialchars(sprintf($this->pi_getLL('count'), ($this->piVars['pointer'] * $this->conf['limit']) + 1, $i, count($this->list))); |
|
690 | + $markerArray['###COUNT###'] = htmlspecialchars(sprintf($this->pi_getLL('count'), ($this->piVars['pointer'] * $this->conf['limit']) + 1, $i, count($this->list))); |
|
691 | 691 | |
692 | - } else { |
|
692 | + } else { |
|
693 | 693 | |
694 | - $markerArray['###COUNT###'] = $this->pi_getLL('nohits', '', TRUE); |
|
694 | + $markerArray['###COUNT###'] = $this->pi_getLL('nohits', '', TRUE); |
|
695 | 695 | |
696 | - } |
|
696 | + } |
|
697 | 697 | |
698 | - $markerArray['###PAGEBROWSER###'] = $this->getPageBrowser(); |
|
698 | + $markerArray['###PAGEBROWSER###'] = $this->getPageBrowser(); |
|
699 | 699 | |
700 | - $markerArray['###SORTING###'] = $this->getSortingForm(); |
|
700 | + $markerArray['###SORTING###'] = $this->getSortingForm(); |
|
701 | 701 | |
702 | - $content = $this->cObj->substituteMarkerArray($this->cObj->substituteSubpart($this->template, '###ENTRY###', $content, TRUE), $markerArray); |
|
702 | + $content = $this->cObj->substituteMarkerArray($this->cObj->substituteSubpart($this->template, '###ENTRY###', $content, TRUE), $markerArray); |
|
703 | 703 | |
704 | - return $this->pi_wrapInBaseClass($content); |
|
704 | + return $this->pi_wrapInBaseClass($content); |
|
705 | 705 | |
706 | - } |
|
706 | + } |
|
707 | 707 | |
708 | 708 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * @var array |
37 | 37 | * @access protected |
38 | 38 | */ |
39 | - protected $metadata = array (); |
|
39 | + protected $metadata = array(); |
|
40 | 40 | |
41 | 41 | /** |
42 | 42 | * Array of sortable metadata |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @var array |
45 | 45 | * @access protected |
46 | 46 | */ |
47 | - protected $sortables = array (); |
|
47 | + protected $sortables = array(); |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * Renders the page browser |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | // Add link to previous page. |
72 | 72 | if ($this->piVars['pointer'] > 0) { |
73 | 73 | |
74 | - $output = $this->pi_linkTP_keepPIvars($this->pi_getLL('prevPage', '<', TRUE), array ('pointer' => $this->piVars['pointer'] - 1), TRUE).$separator; |
|
74 | + $output = $this->pi_linkTP_keepPIvars($this->pi_getLL('prevPage', '<', TRUE), array('pointer' => $this->piVars['pointer'] - 1), TRUE).$separator; |
|
75 | 75 | |
76 | 76 | } else { |
77 | 77 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | if ($this->piVars['pointer'] != $i) { |
92 | 92 | |
93 | - $output .= $this->pi_linkTP_keepPIvars(sprintf($this->pi_getLL('page', '%d', TRUE), $i + 1), array ('pointer' => $i), TRUE).$separator; |
|
93 | + $output .= $this->pi_linkTP_keepPIvars(sprintf($this->pi_getLL('page', '%d', TRUE), $i + 1), array('pointer' => $i), TRUE).$separator; |
|
94 | 94 | |
95 | 95 | } else { |
96 | 96 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | // Add link to next page. |
116 | 116 | if ($this->piVars['pointer'] < $maxPages - 1) { |
117 | 117 | |
118 | - $output .= $this->pi_linkTP_keepPIvars($this->pi_getLL('nextPage', '>', TRUE), array ('pointer' => $this->piVars['pointer'] + 1), TRUE); |
|
118 | + $output .= $this->pi_linkTP_keepPIvars($this->pi_getLL('nextPage', '>', TRUE), array('pointer' => $this->piVars['pointer'] + 1), TRUE); |
|
119 | 119 | |
120 | 120 | } else { |
121 | 121 | |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | |
189 | 189 | $imgAlt = htmlspecialchars($value); |
190 | 190 | |
191 | - $additionalParams = array ( |
|
191 | + $additionalParams = array( |
|
192 | 192 | 'id' => $this->list[$number]['uid'], |
193 | 193 | 'page' => $this->list[$number]['page'] |
194 | 194 | ); |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | |
200 | 200 | } |
201 | 201 | |
202 | - $conf = array ( |
|
202 | + $conf = array( |
|
203 | 203 | 'useCacheHash' => 1, |
204 | 204 | 'parameter' => $this->conf['targetPid'], |
205 | 205 | 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE) |
@@ -275,9 +275,9 @@ discard block |
||
275 | 275 | |
276 | 276 | if (!empty($this->conf['basketButton']) && !empty($this->conf['targetBasket'])) { |
277 | 277 | |
278 | - $additionalParams = array ('id' => $this->list[$number]['uid'], 'startpage' => $this->list[$number]['page'], 'addToBasket' => 'list'); |
|
278 | + $additionalParams = array('id' => $this->list[$number]['uid'], 'startpage' => $this->list[$number]['page'], 'addToBasket' => 'list'); |
|
279 | 279 | |
280 | - $conf = array ( |
|
280 | + $conf = array( |
|
281 | 281 | 'useCacheHash' => 1, |
282 | 282 | 'parameter' => $this->conf['targetBasket'], |
283 | 283 | 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE) |
@@ -313,14 +313,14 @@ discard block |
||
313 | 313 | $prefix = str_replace('_', '-', get_class($this)); |
314 | 314 | |
315 | 315 | // Configure @action URL for form. |
316 | - $linkConf = array ( |
|
316 | + $linkConf = array( |
|
317 | 317 | 'parameter' => $GLOBALS['TSFE']->id, |
318 | 318 | 'forceAbsoluteUrl' => 1 |
319 | 319 | ); |
320 | 320 | |
321 | 321 | if (!empty($this->piVars['logicalPage'])) { |
322 | 322 | |
323 | - $linkConf['additionalParams'] = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, array ('logicalPage' => $this->piVars['logicalPage']), '', TRUE, FALSE); |
|
323 | + $linkConf['additionalParams'] = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, array('logicalPage' => $this->piVars['logicalPage']), '', TRUE, FALSE); |
|
324 | 324 | |
325 | 325 | } |
326 | 326 | |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | |
432 | 432 | $imgAlt = htmlspecialchars($value); |
433 | 433 | |
434 | - $additionalParams = array ( |
|
434 | + $additionalParams = array( |
|
435 | 435 | 'id' => $subpart['uid'], |
436 | 436 | 'page' => $subpart['page'], |
437 | 437 | 'highlight_word' => preg_replace('/\s\s+/', ';', $this->list->metadata['searchString']) |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | |
444 | 444 | } |
445 | 445 | |
446 | - $conf = array ( |
|
446 | + $conf = array( |
|
447 | 447 | // we don't want cHash in case of search parameters |
448 | 448 | 'useCacheHash' => empty($this->list->metadata['searchString']) ? 1 : 0, |
449 | 449 | 'parameter' => $this->conf['targetPid'], |
@@ -523,9 +523,9 @@ discard block |
||
523 | 523 | |
524 | 524 | if (!empty($this->conf['basketButton']) && !empty($this->conf['targetBasket'])) { |
525 | 525 | |
526 | - $additionalParams = array ('id' => $this->list[$number]['uid'], 'startpage' => $subpart['page'], 'endpage' => $subpart['page'], 'logId' => $subpart['sid'], 'addToBasket' => 'subentry'); |
|
526 | + $additionalParams = array('id' => $this->list[$number]['uid'], 'startpage' => $subpart['page'], 'endpage' => $subpart['page'], 'logId' => $subpart['sid'], 'addToBasket' => 'subentry'); |
|
527 | 527 | |
528 | - $conf = array ( |
|
528 | + $conf = array( |
|
529 | 529 | 'useCacheHash' => 1, |
530 | 530 | 'parameter' => $this->conf['targetBasket'], |
531 | 531 | 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE) |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | |
568 | 568 | if ($resArray['is_listed']) { |
569 | 569 | |
570 | - $this->metadata[$resArray['index_name']] = array ( |
|
570 | + $this->metadata[$resArray['index_name']] = array( |
|
571 | 571 | 'wrap' => $resArray['wrap'], |
572 | 572 | 'label' => tx_dlf_helper::translate($resArray['index_name'], 'tx_dlf_metadata', $this->conf['pages']) |
573 | 573 | ); |
@@ -20,85 +20,85 @@ |
||
20 | 20 | */ |
21 | 21 | class tx_dlf_toolsFulltext extends tx_dlf_plugin { |
22 | 22 | |
23 | - public $scriptRelPath = 'plugins/toolbox/tools/fulltext/class.tx_dlf_toolsFulltext.php'; |
|
23 | + public $scriptRelPath = 'plugins/toolbox/tools/fulltext/class.tx_dlf_toolsFulltext.php'; |
|
24 | 24 | |
25 | - /** |
|
26 | - * The main method of the PlugIn |
|
27 | - * |
|
28 | - * @access public |
|
29 | - * |
|
30 | - * @param string $content: The PlugIn content |
|
31 | - * @param array $conf: The PlugIn configuration |
|
32 | - * |
|
33 | - * @return string The content that is displayed on the website |
|
34 | - */ |
|
35 | - public function main($content, $conf) { |
|
25 | + /** |
|
26 | + * The main method of the PlugIn |
|
27 | + * |
|
28 | + * @access public |
|
29 | + * |
|
30 | + * @param string $content: The PlugIn content |
|
31 | + * @param array $conf: The PlugIn configuration |
|
32 | + * |
|
33 | + * @return string The content that is displayed on the website |
|
34 | + */ |
|
35 | + public function main($content, $conf) { |
|
36 | 36 | |
37 | - $this->init($conf); |
|
37 | + $this->init($conf); |
|
38 | 38 | |
39 | - // Merge configuration with conf array of toolbox. |
|
40 | - $this->conf = tx_dlf_helper::array_merge_recursive_overrule($this->cObj->data['conf'], $this->conf); |
|
39 | + // Merge configuration with conf array of toolbox. |
|
40 | + $this->conf = tx_dlf_helper::array_merge_recursive_overrule($this->cObj->data['conf'], $this->conf); |
|
41 | 41 | |
42 | - // Load current document. |
|
43 | - $this->loadDocument(); |
|
42 | + // Load current document. |
|
43 | + $this->loadDocument(); |
|
44 | 44 | |
45 | - if ($this->doc === NULL || $this->doc->numPages < 1 || empty($this->conf['fileGrpFulltext'])) { |
|
45 | + if ($this->doc === NULL || $this->doc->numPages < 1 || empty($this->conf['fileGrpFulltext'])) { |
|
46 | 46 | |
47 | - // Quit without doing anything if required variables are not set. |
|
48 | - return $content; |
|
47 | + // Quit without doing anything if required variables are not set. |
|
48 | + return $content; |
|
49 | 49 | |
50 | - } else { |
|
50 | + } else { |
|
51 | 51 | |
52 | - if (!empty($this->piVars['logicalPage'])) { |
|
52 | + if (!empty($this->piVars['logicalPage'])) { |
|
53 | 53 | |
54 | - $this->piVars['page'] = $this->doc->getPhysicalPage($this->piVars['logicalPage']); |
|
55 | - // The logical page parameter should not appear again |
|
56 | - unset($this->piVars['logicalPage']); |
|
54 | + $this->piVars['page'] = $this->doc->getPhysicalPage($this->piVars['logicalPage']); |
|
55 | + // The logical page parameter should not appear again |
|
56 | + unset($this->piVars['logicalPage']); |
|
57 | 57 | |
58 | - } |
|
58 | + } |
|
59 | 59 | |
60 | - // Set default values if not set. |
|
61 | - // $this->piVars['page'] may be integer or string (physical structure @ID) |
|
62 | - if ((int) $this->piVars['page'] > 0 || empty($this->piVars['page'])) { |
|
60 | + // Set default values if not set. |
|
61 | + // $this->piVars['page'] may be integer or string (physical structure @ID) |
|
62 | + if ((int) $this->piVars['page'] > 0 || empty($this->piVars['page'])) { |
|
63 | 63 | |
64 | - $this->piVars['page'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange((int) $this->piVars['page'], 1, $this->doc->numPages, 1); |
|
64 | + $this->piVars['page'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange((int) $this->piVars['page'], 1, $this->doc->numPages, 1); |
|
65 | 65 | |
66 | - } else { |
|
66 | + } else { |
|
67 | 67 | |
68 | - $this->piVars['page'] = array_search($this->piVars['page'], $this->doc->physicalStructure); |
|
68 | + $this->piVars['page'] = array_search($this->piVars['page'], $this->doc->physicalStructure); |
|
69 | 69 | |
70 | - } |
|
70 | + } |
|
71 | 71 | |
72 | - $this->piVars['double'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->piVars['double'], 0, 1, 0); |
|
72 | + $this->piVars['double'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->piVars['double'], 0, 1, 0); |
|
73 | 73 | |
74 | - } |
|
74 | + } |
|
75 | 75 | |
76 | - // Load template file. |
|
77 | - if (!empty($this->conf['toolTemplateFile'])) { |
|
76 | + // Load template file. |
|
77 | + if (!empty($this->conf['toolTemplateFile'])) { |
|
78 | 78 | |
79 | - $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['toolTemplateFile']), '###TEMPLATE###'); |
|
79 | + $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['toolTemplateFile']), '###TEMPLATE###'); |
|
80 | 80 | |
81 | - } else { |
|
81 | + } else { |
|
82 | 82 | |
83 | - $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/toolbox/tools/fulltext/template.tmpl'), '###TEMPLATE###'); |
|
83 | + $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/toolbox/tools/fulltext/template.tmpl'), '###TEMPLATE###'); |
|
84 | 84 | |
85 | - } |
|
85 | + } |
|
86 | 86 | |
87 | 87 | |
88 | - $fullTextFile = $this->doc->physicalStructureInfo[$this->doc->physicalStructure[$this->piVars['page']]]['files'][$this->conf['fileGrpFulltext']]; |
|
88 | + $fullTextFile = $this->doc->physicalStructureInfo[$this->doc->physicalStructure[$this->piVars['page']]]['files'][$this->conf['fileGrpFulltext']]; |
|
89 | 89 | |
90 | - if (!empty($fullTextFile)) { |
|
91 | - $markerArray['###FULLTEXT_SELECT###'] = '<a class="select switchoff" id="tx-dlf-tools-fulltext" title="" data-dic="fulltext-on:' |
|
92 | - .$this->pi_getLL('fulltext-on', '', TRUE).';fulltext-off:' |
|
93 | - .$this->pi_getLL('fulltext-off', '', TRUE).'"> </a>'; |
|
94 | - } else { |
|
95 | - $markerArray['###FULLTEXT_SELECT###'] = '<span class="no-fulltext">'.$this->pi_getLL('fulltext-not-available', '', TRUE).'</span>'; |
|
96 | - } |
|
90 | + if (!empty($fullTextFile)) { |
|
91 | + $markerArray['###FULLTEXT_SELECT###'] = '<a class="select switchoff" id="tx-dlf-tools-fulltext" title="" data-dic="fulltext-on:' |
|
92 | + .$this->pi_getLL('fulltext-on', '', TRUE).';fulltext-off:' |
|
93 | + .$this->pi_getLL('fulltext-off', '', TRUE).'"> </a>'; |
|
94 | + } else { |
|
95 | + $markerArray['###FULLTEXT_SELECT###'] = '<span class="no-fulltext">'.$this->pi_getLL('fulltext-not-available', '', TRUE).'</span>'; |
|
96 | + } |
|
97 | 97 | |
98 | - $content .= $this->cObj->substituteMarkerArray($this->template, $markerArray); |
|
98 | + $content .= $this->cObj->substituteMarkerArray($this->template, $markerArray); |
|
99 | 99 | |
100 | - return $this->pi_wrapInBaseClass($content); |
|
100 | + return $this->pi_wrapInBaseClass($content); |
|
101 | 101 | |
102 | - } |
|
102 | + } |
|
103 | 103 | |
104 | 104 | } |
@@ -19,54 +19,54 @@ |
||
19 | 19 | */ |
20 | 20 | class tx_dlf_toolsImagemanipulation extends tx_dlf_plugin { |
21 | 21 | |
22 | - public $scriptRelPath = 'plugins/toolbox/tools/imagemanipulation/class.tx_dlf_toolsImagemanipulation.php'; |
|
22 | + public $scriptRelPath = 'plugins/toolbox/tools/imagemanipulation/class.tx_dlf_toolsImagemanipulation.php'; |
|
23 | 23 | |
24 | - /** |
|
25 | - * The main method of the PlugIn |
|
26 | - * |
|
27 | - * @access public |
|
28 | - * |
|
29 | - * @param string $content: The PlugIn content |
|
30 | - * @param array $conf: The PlugIn configuration |
|
31 | - * |
|
32 | - * @return string The content that is displayed on the website |
|
33 | - */ |
|
34 | - public function main($content, $conf) { |
|
24 | + /** |
|
25 | + * The main method of the PlugIn |
|
26 | + * |
|
27 | + * @access public |
|
28 | + * |
|
29 | + * @param string $content: The PlugIn content |
|
30 | + * @param array $conf: The PlugIn configuration |
|
31 | + * |
|
32 | + * @return string The content that is displayed on the website |
|
33 | + */ |
|
34 | + public function main($content, $conf) { |
|
35 | 35 | |
36 | - $this->init($conf); |
|
36 | + $this->init($conf); |
|
37 | 37 | |
38 | - // Merge configuration with conf array of toolbox. |
|
39 | - $this->conf = tx_dlf_helper::array_merge_recursive_overrule($this->cObj->data['conf'], $this->conf); |
|
38 | + // Merge configuration with conf array of toolbox. |
|
39 | + $this->conf = tx_dlf_helper::array_merge_recursive_overrule($this->cObj->data['conf'], $this->conf); |
|
40 | 40 | |
41 | - // Load current document. |
|
42 | - $this->loadDocument(); |
|
41 | + // Load current document. |
|
42 | + $this->loadDocument(); |
|
43 | 43 | |
44 | - // Load template file. |
|
45 | - if (!empty($this->conf['toolTemplateFile'])) { |
|
44 | + // Load template file. |
|
45 | + if (!empty($this->conf['toolTemplateFile'])) { |
|
46 | 46 | |
47 | - $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['toolTemplateFile']), '###TEMPLATE###'); |
|
47 | + $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['toolTemplateFile']), '###TEMPLATE###'); |
|
48 | 48 | |
49 | - } else { |
|
49 | + } else { |
|
50 | 50 | |
51 | - $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/toolbox/tools/imagemanipulation/template.tmpl'), '###TEMPLATE###'); |
|
51 | + $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/toolbox/tools/imagemanipulation/template.tmpl'), '###TEMPLATE###'); |
|
52 | 52 | |
53 | - } |
|
53 | + } |
|
54 | 54 | |
55 | - $markerArray['###IMAGEMANIPULATION_SELECT###'] = '<span class="tx-dlf-tools-imagetools" id="tx-dlf-tools-imagetools" data-dic="imagemanipulation-on:' |
|
56 | - .$this->pi_getLL('imagemanipulation-on', '', TRUE).';imagemanipulation-off:' |
|
57 | - .$this->pi_getLL('imagemanipulation-off', '', TRUE).';reset:' |
|
58 | - .$this->pi_getLL('reset', '', TRUE).';saturation:' |
|
59 | - .$this->pi_getLL('saturation', '', TRUE).';hue:' |
|
60 | - .$this->pi_getLL('hue', '', TRUE).';contrast:' |
|
61 | - .$this->pi_getLL('contrast', '', TRUE).';brightness:' |
|
62 | - .$this->pi_getLL('brightness', '', TRUE).';invert:' |
|
63 | - .$this->pi_getLL('invert', '', TRUE).'" title="' |
|
64 | - .$this->pi_getLL('no-support', '', TRUE).'"></span>'; |
|
55 | + $markerArray['###IMAGEMANIPULATION_SELECT###'] = '<span class="tx-dlf-tools-imagetools" id="tx-dlf-tools-imagetools" data-dic="imagemanipulation-on:' |
|
56 | + .$this->pi_getLL('imagemanipulation-on', '', TRUE).';imagemanipulation-off:' |
|
57 | + .$this->pi_getLL('imagemanipulation-off', '', TRUE).';reset:' |
|
58 | + .$this->pi_getLL('reset', '', TRUE).';saturation:' |
|
59 | + .$this->pi_getLL('saturation', '', TRUE).';hue:' |
|
60 | + .$this->pi_getLL('hue', '', TRUE).';contrast:' |
|
61 | + .$this->pi_getLL('contrast', '', TRUE).';brightness:' |
|
62 | + .$this->pi_getLL('brightness', '', TRUE).';invert:' |
|
63 | + .$this->pi_getLL('invert', '', TRUE).'" title="' |
|
64 | + .$this->pi_getLL('no-support', '', TRUE).'"></span>'; |
|
65 | 65 | |
66 | - $content .= $this->cObj->substituteMarkerArray($this->template, $markerArray); |
|
66 | + $content .= $this->cObj->substituteMarkerArray($this->template, $markerArray); |
|
67 | 67 | |
68 | - return $this->pi_wrapInBaseClass($content); |
|
68 | + return $this->pi_wrapInBaseClass($content); |
|
69 | 69 | |
70 | - } |
|
70 | + } |
|
71 | 71 | |
72 | 72 | } |
@@ -20,182 +20,182 @@ |
||
20 | 20 | */ |
21 | 21 | class tx_dlf_toolsPdf extends tx_dlf_plugin { |
22 | 22 | |
23 | - public $scriptRelPath = 'plugins/toolbox/tools/pdf/class.tx_dlf_toolsPdf.php'; |
|
23 | + public $scriptRelPath = 'plugins/toolbox/tools/pdf/class.tx_dlf_toolsPdf.php'; |
|
24 | 24 | |
25 | - /** |
|
26 | - * The main method of the PlugIn |
|
27 | - * |
|
28 | - * @access public |
|
29 | - * |
|
30 | - * @param string $content: The PlugIn content |
|
31 | - * @param array $conf: The PlugIn configuration |
|
32 | - * |
|
33 | - * @return string The content that is displayed on the website |
|
34 | - */ |
|
35 | - public function main($content, $conf) { |
|
25 | + /** |
|
26 | + * The main method of the PlugIn |
|
27 | + * |
|
28 | + * @access public |
|
29 | + * |
|
30 | + * @param string $content: The PlugIn content |
|
31 | + * @param array $conf: The PlugIn configuration |
|
32 | + * |
|
33 | + * @return string The content that is displayed on the website |
|
34 | + */ |
|
35 | + public function main($content, $conf) { |
|
36 | 36 | |
37 | - $this->init($conf); |
|
37 | + $this->init($conf); |
|
38 | 38 | |
39 | - // Merge configuration with conf array of toolbox. |
|
40 | - $this->conf = tx_dlf_helper::array_merge_recursive_overrule($this->cObj->data['conf'], $this->conf); |
|
39 | + // Merge configuration with conf array of toolbox. |
|
40 | + $this->conf = tx_dlf_helper::array_merge_recursive_overrule($this->cObj->data['conf'], $this->conf); |
|
41 | 41 | |
42 | - // Load current document. |
|
43 | - $this->loadDocument(); |
|
42 | + // Load current document. |
|
43 | + $this->loadDocument(); |
|
44 | 44 | |
45 | - if ($this->doc === NULL || $this->doc->numPages < 1 || empty($this->conf['fileGrpDownload'])) { |
|
45 | + if ($this->doc === NULL || $this->doc->numPages < 1 || empty($this->conf['fileGrpDownload'])) { |
|
46 | 46 | |
47 | - // Quit without doing anything if required variables are not set. |
|
48 | - return $content; |
|
47 | + // Quit without doing anything if required variables are not set. |
|
48 | + return $content; |
|
49 | 49 | |
50 | - } else { |
|
50 | + } else { |
|
51 | 51 | |
52 | - if (!empty($this->piVars['logicalPage'])) { |
|
52 | + if (!empty($this->piVars['logicalPage'])) { |
|
53 | 53 | |
54 | - $this->piVars['page'] = $this->doc->getPhysicalPage($this->piVars['logicalPage']); |
|
55 | - // The logical page parameter should not appear again |
|
56 | - unset($this->piVars['logicalPage']); |
|
54 | + $this->piVars['page'] = $this->doc->getPhysicalPage($this->piVars['logicalPage']); |
|
55 | + // The logical page parameter should not appear again |
|
56 | + unset($this->piVars['logicalPage']); |
|
57 | 57 | |
58 | - } |
|
58 | + } |
|
59 | 59 | |
60 | - // Set default values if not set. |
|
61 | - // $this->piVars['page'] may be integer or string (physical structure @ID) |
|
62 | - if ((int) $this->piVars['page'] > 0 || empty($this->piVars['page'])) { |
|
60 | + // Set default values if not set. |
|
61 | + // $this->piVars['page'] may be integer or string (physical structure @ID) |
|
62 | + if ((int) $this->piVars['page'] > 0 || empty($this->piVars['page'])) { |
|
63 | 63 | |
64 | - $this->piVars['page'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange((int) $this->piVars['page'], 1, $this->doc->numPages, 1); |
|
64 | + $this->piVars['page'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange((int) $this->piVars['page'], 1, $this->doc->numPages, 1); |
|
65 | 65 | |
66 | - } else { |
|
66 | + } else { |
|
67 | 67 | |
68 | - $this->piVars['page'] = array_search($this->piVars['page'], $this->doc->physicalStructure); |
|
68 | + $this->piVars['page'] = array_search($this->piVars['page'], $this->doc->physicalStructure); |
|
69 | 69 | |
70 | - } |
|
70 | + } |
|
71 | 71 | |
72 | - $this->piVars['double'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->piVars['double'], 0, 1, 0); |
|
72 | + $this->piVars['double'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->piVars['double'], 0, 1, 0); |
|
73 | 73 | |
74 | - } |
|
74 | + } |
|
75 | 75 | |
76 | - // Load template file. |
|
77 | - if (!empty($this->conf['toolTemplateFile'])) { |
|
76 | + // Load template file. |
|
77 | + if (!empty($this->conf['toolTemplateFile'])) { |
|
78 | 78 | |
79 | - $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['toolTemplateFile']), '###TEMPLATE###'); |
|
79 | + $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['toolTemplateFile']), '###TEMPLATE###'); |
|
80 | 80 | |
81 | - } else { |
|
81 | + } else { |
|
82 | 82 | |
83 | - $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/toolbox/tools/pdf/template.tmpl'), '###TEMPLATE###'); |
|
83 | + $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/toolbox/tools/pdf/template.tmpl'), '###TEMPLATE###'); |
|
84 | 84 | |
85 | - } |
|
85 | + } |
|
86 | 86 | |
87 | - // Get single page downloads. |
|
88 | - $markerArray['###PAGE###'] = $this->getPageLink(); |
|
87 | + // Get single page downloads. |
|
88 | + $markerArray['###PAGE###'] = $this->getPageLink(); |
|
89 | 89 | |
90 | - // Get work download. |
|
91 | - $markerArray['###WORK###'] = $this->getWorkLink(); |
|
90 | + // Get work download. |
|
91 | + $markerArray['###WORK###'] = $this->getWorkLink(); |
|
92 | 92 | |
93 | - $content .= $this->cObj->substituteMarkerArray($this->template, $markerArray); |
|
93 | + $content .= $this->cObj->substituteMarkerArray($this->template, $markerArray); |
|
94 | 94 | |
95 | - return $this->pi_wrapInBaseClass($content); |
|
95 | + return $this->pi_wrapInBaseClass($content); |
|
96 | 96 | |
97 | - } |
|
97 | + } |
|
98 | 98 | |
99 | - /** |
|
100 | - * Get page's download link |
|
101 | - * |
|
102 | - * @access protected |
|
103 | - * |
|
104 | - * @return string Link to downloadable page |
|
105 | - */ |
|
106 | - protected function getPageLink() { |
|
99 | + /** |
|
100 | + * Get page's download link |
|
101 | + * |
|
102 | + * @access protected |
|
103 | + * |
|
104 | + * @return string Link to downloadable page |
|
105 | + */ |
|
106 | + protected function getPageLink() { |
|
107 | 107 | |
108 | - $page1Link = ''; |
|
109 | - $page2Link = ''; |
|
110 | - $pageNumber = $this->piVars['page']; |
|
108 | + $page1Link = ''; |
|
109 | + $page2Link = ''; |
|
110 | + $pageNumber = $this->piVars['page']; |
|
111 | 111 | |
112 | - // Get image link. |
|
113 | - $details = $this->doc->physicalStructureInfo[$this->doc->physicalStructure[$pageNumber]]; |
|
114 | - $file = $details['files'][$this->conf['fileGrpDownload']]; |
|
115 | - if (!empty($file)) { |
|
116 | - $page1Link = $this->doc->getFileLocation($file); |
|
117 | - } |
|
112 | + // Get image link. |
|
113 | + $details = $this->doc->physicalStructureInfo[$this->doc->physicalStructure[$pageNumber]]; |
|
114 | + $file = $details['files'][$this->conf['fileGrpDownload']]; |
|
115 | + if (!empty($file)) { |
|
116 | + $page1Link = $this->doc->getFileLocation($file); |
|
117 | + } |
|
118 | 118 | |
119 | - // Get second page, too, if double page view is activated. |
|
120 | - if ($this->piVars['double'] && $pageNumber < $this->doc->numPages) { |
|
121 | - $details = $this->doc->physicalStructureInfo[$this->doc->physicalStructure[$pageNumber + 1]]; |
|
122 | - $file = $details['files'][$this->conf['fileGrpDownload']]; |
|
123 | - if (!empty($file)) { |
|
124 | - $page2Link = $this->doc->getFileLocation($file); |
|
125 | - } |
|
126 | - } |
|
119 | + // Get second page, too, if double page view is activated. |
|
120 | + if ($this->piVars['double'] && $pageNumber < $this->doc->numPages) { |
|
121 | + $details = $this->doc->physicalStructureInfo[$this->doc->physicalStructure[$pageNumber + 1]]; |
|
122 | + $file = $details['files'][$this->conf['fileGrpDownload']]; |
|
123 | + if (!empty($file)) { |
|
124 | + $page2Link = $this->doc->getFileLocation($file); |
|
125 | + } |
|
126 | + } |
|
127 | 127 | |
128 | - if (TYPO3_DLOG && empty($page1Link) && empty($page2Link)) { |
|
129 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_toolsPdf->getPageLink()] '. |
|
130 | - 'File not found in fileGrp "'. |
|
131 | - $this->conf['fileGrpDownload'].'"', |
|
132 | - $this->extKey, |
|
133 | - SYSLOG_SEVERITY_WARNING); |
|
134 | - } |
|
128 | + if (TYPO3_DLOG && empty($page1Link) && empty($page2Link)) { |
|
129 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_toolsPdf->getPageLink()] '. |
|
130 | + 'File not found in fileGrp "'. |
|
131 | + $this->conf['fileGrpDownload'].'"', |
|
132 | + $this->extKey, |
|
133 | + SYSLOG_SEVERITY_WARNING); |
|
134 | + } |
|
135 | 135 | |
136 | - // Wrap URLs with HTML. |
|
137 | - if (!empty($page1Link)) { |
|
138 | - if ($this->piVars['double']) { |
|
139 | - $page1Link = $this->cObj->typoLink($this->pi_getLL('leftPage', ''), |
|
140 | - array ('parameter' => $page1Link, 'title' => $this->pi_getLL('leftPage', ''))); |
|
141 | - } else { |
|
142 | - $page1Link = $this->cObj->typoLink($this->pi_getLL('singlePage', ''), |
|
143 | - array ('parameter' => $page1Link, 'title' => $this->pi_getLL('singlePage', ''))); |
|
144 | - } |
|
145 | - } |
|
146 | - if (!empty($page2Link)) { |
|
147 | - $page2Link = $this->cObj->typoLink($this->pi_getLL('rightPage', ''), |
|
148 | - array ('parameter' => $page2Link, 'title' => $this->pi_getLL('rightPage', ''))); |
|
149 | - } |
|
136 | + // Wrap URLs with HTML. |
|
137 | + if (!empty($page1Link)) { |
|
138 | + if ($this->piVars['double']) { |
|
139 | + $page1Link = $this->cObj->typoLink($this->pi_getLL('leftPage', ''), |
|
140 | + array ('parameter' => $page1Link, 'title' => $this->pi_getLL('leftPage', ''))); |
|
141 | + } else { |
|
142 | + $page1Link = $this->cObj->typoLink($this->pi_getLL('singlePage', ''), |
|
143 | + array ('parameter' => $page1Link, 'title' => $this->pi_getLL('singlePage', ''))); |
|
144 | + } |
|
145 | + } |
|
146 | + if (!empty($page2Link)) { |
|
147 | + $page2Link = $this->cObj->typoLink($this->pi_getLL('rightPage', ''), |
|
148 | + array ('parameter' => $page2Link, 'title' => $this->pi_getLL('rightPage', ''))); |
|
149 | + } |
|
150 | 150 | |
151 | - return $page1Link.$page2Link; |
|
152 | - } |
|
151 | + return $page1Link.$page2Link; |
|
152 | + } |
|
153 | 153 | |
154 | - /** |
|
155 | - * Get work's download link |
|
156 | - * |
|
157 | - * @access protected |
|
158 | - * |
|
159 | - * @return string Link to downloadable work |
|
160 | - */ |
|
161 | - protected function getWorkLink() { |
|
154 | + /** |
|
155 | + * Get work's download link |
|
156 | + * |
|
157 | + * @access protected |
|
158 | + * |
|
159 | + * @return string Link to downloadable work |
|
160 | + */ |
|
161 | + protected function getWorkLink() { |
|
162 | 162 | |
163 | - $workLink = ''; |
|
163 | + $workLink = ''; |
|
164 | 164 | |
165 | - // Get work link. |
|
166 | - if (!empty($this->doc->physicalStructureInfo[$this->doc->physicalStructure[0]]['files'][$this->conf['fileGrpDownload']])) { |
|
165 | + // Get work link. |
|
166 | + if (!empty($this->doc->physicalStructureInfo[$this->doc->physicalStructure[0]]['files'][$this->conf['fileGrpDownload']])) { |
|
167 | 167 | |
168 | - $workLink = $this->doc->getFileLocation($this->doc->physicalStructureInfo[$this->doc->physicalStructure[0]]['files'][$this->conf['fileGrpDownload']]); |
|
168 | + $workLink = $this->doc->getFileLocation($this->doc->physicalStructureInfo[$this->doc->physicalStructure[0]]['files'][$this->conf['fileGrpDownload']]); |
|
169 | 169 | |
170 | - } else { |
|
170 | + } else { |
|
171 | 171 | |
172 | - $details = $this->doc->getLogicalStructure($this->doc->toplevelId); |
|
172 | + $details = $this->doc->getLogicalStructure($this->doc->toplevelId); |
|
173 | 173 | |
174 | - if (!empty($details['files'][$this->conf['fileGrpDownload']])) { |
|
174 | + if (!empty($details['files'][$this->conf['fileGrpDownload']])) { |
|
175 | 175 | |
176 | - $workLink = $this->doc->getFileLocation($details['files'][$this->conf['fileGrpDownload']]); |
|
176 | + $workLink = $this->doc->getFileLocation($details['files'][$this->conf['fileGrpDownload']]); |
|
177 | 177 | |
178 | - } |
|
178 | + } |
|
179 | 179 | |
180 | - } |
|
180 | + } |
|
181 | 181 | |
182 | - // Wrap URLs with HTML. |
|
183 | - if (!empty($workLink)) { |
|
182 | + // Wrap URLs with HTML. |
|
183 | + if (!empty($workLink)) { |
|
184 | 184 | |
185 | - $workLink = $this->cObj->typoLink($this->pi_getLL('work', ''), array ('parameter' => $workLink, 'title' => $this->pi_getLL('work', ''))); |
|
185 | + $workLink = $this->cObj->typoLink($this->pi_getLL('work', ''), array ('parameter' => $workLink, 'title' => $this->pi_getLL('work', ''))); |
|
186 | 186 | |
187 | - } else { |
|
187 | + } else { |
|
188 | 188 | |
189 | - if (TYPO3_DLOG) { |
|
189 | + if (TYPO3_DLOG) { |
|
190 | 190 | |
191 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_toolsPdf->getWorkLink()] File not found in fileGrp "'.$this->conf['fileGrpDownload'].'"', $this->extKey, SYSLOG_SEVERITY_WARNING); |
|
191 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_toolsPdf->getWorkLink()] File not found in fileGrp "'.$this->conf['fileGrpDownload'].'"', $this->extKey, SYSLOG_SEVERITY_WARNING); |
|
192 | 192 | |
193 | - } |
|
193 | + } |
|
194 | 194 | |
195 | - } |
|
195 | + } |
|
196 | 196 | |
197 | - return $workLink; |
|
197 | + return $workLink; |
|
198 | 198 | |
199 | - } |
|
199 | + } |
|
200 | 200 | |
201 | 201 | } |
@@ -137,15 +137,15 @@ discard block |
||
137 | 137 | if (!empty($page1Link)) { |
138 | 138 | if ($this->piVars['double']) { |
139 | 139 | $page1Link = $this->cObj->typoLink($this->pi_getLL('leftPage', ''), |
140 | - array ('parameter' => $page1Link, 'title' => $this->pi_getLL('leftPage', ''))); |
|
140 | + array('parameter' => $page1Link, 'title' => $this->pi_getLL('leftPage', ''))); |
|
141 | 141 | } else { |
142 | 142 | $page1Link = $this->cObj->typoLink($this->pi_getLL('singlePage', ''), |
143 | - array ('parameter' => $page1Link, 'title' => $this->pi_getLL('singlePage', ''))); |
|
143 | + array('parameter' => $page1Link, 'title' => $this->pi_getLL('singlePage', ''))); |
|
144 | 144 | } |
145 | 145 | } |
146 | 146 | if (!empty($page2Link)) { |
147 | 147 | $page2Link = $this->cObj->typoLink($this->pi_getLL('rightPage', ''), |
148 | - array ('parameter' => $page2Link, 'title' => $this->pi_getLL('rightPage', ''))); |
|
148 | + array('parameter' => $page2Link, 'title' => $this->pi_getLL('rightPage', ''))); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | return $page1Link.$page2Link; |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | // Wrap URLs with HTML. |
183 | 183 | if (!empty($workLink)) { |
184 | 184 | |
185 | - $workLink = $this->cObj->typoLink($this->pi_getLL('work', ''), array ('parameter' => $workLink, 'title' => $this->pi_getLL('work', ''))); |
|
185 | + $workLink = $this->cObj->typoLink($this->pi_getLL('work', ''), array('parameter' => $workLink, 'title' => $this->pi_getLL('work', ''))); |
|
186 | 186 | |
187 | 187 | } else { |
188 | 188 |
@@ -19,140 +19,140 @@ |
||
19 | 19 | */ |
20 | 20 | class tx_dlf_toolsImagedownload extends tx_dlf_plugin { |
21 | 21 | |
22 | - public $scriptRelPath = 'plugins/toolbox/tools/imagedownload/class.tx_dlf_toolsImagedownload.php'; |
|
22 | + public $scriptRelPath = 'plugins/toolbox/tools/imagedownload/class.tx_dlf_toolsImagedownload.php'; |
|
23 | 23 | |
24 | - /** |
|
25 | - * The main method of the PlugIn |
|
26 | - * |
|
27 | - * @access public |
|
28 | - * |
|
29 | - * @param string $content: The PlugIn content |
|
30 | - * @param array $conf: The PlugIn configuration |
|
31 | - * |
|
32 | - * @return string The content that is displayed on the website |
|
33 | - */ |
|
34 | - public function main($content, $conf) { |
|
24 | + /** |
|
25 | + * The main method of the PlugIn |
|
26 | + * |
|
27 | + * @access public |
|
28 | + * |
|
29 | + * @param string $content: The PlugIn content |
|
30 | + * @param array $conf: The PlugIn configuration |
|
31 | + * |
|
32 | + * @return string The content that is displayed on the website |
|
33 | + */ |
|
34 | + public function main($content, $conf) { |
|
35 | 35 | |
36 | - $this->init($conf); |
|
36 | + $this->init($conf); |
|
37 | 37 | |
38 | - // Merge configuration with conf array of toolbox. |
|
39 | - $this->conf = tx_dlf_helper::array_merge_recursive_overrule($this->cObj->data['conf'], $this->conf); |
|
38 | + // Merge configuration with conf array of toolbox. |
|
39 | + $this->conf = tx_dlf_helper::array_merge_recursive_overrule($this->cObj->data['conf'], $this->conf); |
|
40 | 40 | |
41 | - // Load current document. |
|
42 | - $this->loadDocument(); |
|
41 | + // Load current document. |
|
42 | + $this->loadDocument(); |
|
43 | 43 | |
44 | - if ($this->doc === NULL || $this->doc->numPages < 1 || empty($this->conf['fileGrpsImageDownload'])) { |
|
44 | + if ($this->doc === NULL || $this->doc->numPages < 1 || empty($this->conf['fileGrpsImageDownload'])) { |
|
45 | 45 | |
46 | - // Quit without doing anything if required variables are not set. |
|
47 | - return $content; |
|
46 | + // Quit without doing anything if required variables are not set. |
|
47 | + return $content; |
|
48 | 48 | |
49 | - } else { |
|
49 | + } else { |
|
50 | 50 | |
51 | - if (!empty($this->piVars['logicalPage'])) { |
|
51 | + if (!empty($this->piVars['logicalPage'])) { |
|
52 | 52 | |
53 | - $this->piVars['page'] = $this->doc->getPhysicalPage($this->piVars['logicalPage']); |
|
54 | - // The logical page parameter should not appear again |
|
55 | - unset($this->piVars['logicalPage']); |
|
53 | + $this->piVars['page'] = $this->doc->getPhysicalPage($this->piVars['logicalPage']); |
|
54 | + // The logical page parameter should not appear again |
|
55 | + unset($this->piVars['logicalPage']); |
|
56 | 56 | |
57 | - } |
|
57 | + } |
|
58 | 58 | |
59 | - // Set default values if not set. |
|
60 | - // $this->piVars['page'] may be integer or string (physical structure @ID) |
|
61 | - if ((int) $this->piVars['page'] > 0 || empty($this->piVars['page'])) { |
|
59 | + // Set default values if not set. |
|
60 | + // $this->piVars['page'] may be integer or string (physical structure @ID) |
|
61 | + if ((int) $this->piVars['page'] > 0 || empty($this->piVars['page'])) { |
|
62 | 62 | |
63 | - $this->piVars['page'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange((int) $this->piVars['page'], 1, $this->doc->numPages, 1); |
|
63 | + $this->piVars['page'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange((int) $this->piVars['page'], 1, $this->doc->numPages, 1); |
|
64 | 64 | |
65 | - } else { |
|
65 | + } else { |
|
66 | 66 | |
67 | - $this->piVars['page'] = array_search($this->piVars['page'], $this->doc->physicalStructure); |
|
67 | + $this->piVars['page'] = array_search($this->piVars['page'], $this->doc->physicalStructure); |
|
68 | 68 | |
69 | - } |
|
69 | + } |
|
70 | 70 | |
71 | - $this->piVars['double'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->piVars['double'], 0, 1, 0); |
|
71 | + $this->piVars['double'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->piVars['double'], 0, 1, 0); |
|
72 | 72 | |
73 | - } |
|
73 | + } |
|
74 | 74 | |
75 | - // Load template file. |
|
76 | - if (!empty($this->conf['toolTemplateFile'])) { |
|
75 | + // Load template file. |
|
76 | + if (!empty($this->conf['toolTemplateFile'])) { |
|
77 | 77 | |
78 | - $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['toolTemplateFile']), '###TEMPLATE###'); |
|
78 | + $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['toolTemplateFile']), '###TEMPLATE###'); |
|
79 | 79 | |
80 | - } else { |
|
80 | + } else { |
|
81 | 81 | |
82 | - $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/toolbox/tools/imagedownload/template.tmpl'), '###TEMPLATE###'); |
|
82 | + $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/toolbox/tools/imagedownload/template.tmpl'), '###TEMPLATE###'); |
|
83 | 83 | |
84 | - } |
|
84 | + } |
|
85 | 85 | |
86 | - // Get left or single page download. |
|
87 | - $markerArray['###IMAGE_LEFT###'] = $this->piVars['double'] == 1 ? $this->getImage($this->piVars['page'], $this->pi_getLL('leftPage', '')) : $this->getImage($this->piVars['page'], $this->pi_getLL('singlePage', '')); |
|
86 | + // Get left or single page download. |
|
87 | + $markerArray['###IMAGE_LEFT###'] = $this->piVars['double'] == 1 ? $this->getImage($this->piVars['page'], $this->pi_getLL('leftPage', '')) : $this->getImage($this->piVars['page'], $this->pi_getLL('singlePage', '')); |
|
88 | 88 | |
89 | - // Get right page download. |
|
90 | - $markerArray['###IMAGE_RIGHT###'] = $this->piVars['double'] == 1 ? $this->getImage($this->piVars['page'] + 1, $this->pi_getLL('rightPage', '')) : ''; |
|
89 | + // Get right page download. |
|
90 | + $markerArray['###IMAGE_RIGHT###'] = $this->piVars['double'] == 1 ? $this->getImage($this->piVars['page'] + 1, $this->pi_getLL('rightPage', '')) : ''; |
|
91 | 91 | |
92 | - $content .= $this->cObj->substituteMarkerArray($this->template, $markerArray); |
|
92 | + $content .= $this->cObj->substituteMarkerArray($this->template, $markerArray); |
|
93 | 93 | |
94 | - return $this->pi_wrapInBaseClass($content); |
|
94 | + return $this->pi_wrapInBaseClass($content); |
|
95 | 95 | |
96 | - } |
|
96 | + } |
|
97 | 97 | |
98 | 98 | |
99 | - /** |
|
100 | - * Get image's URL and MIME type |
|
101 | - * |
|
102 | - * @access protected |
|
103 | - * |
|
104 | - * @param integer $page: Page number |
|
105 | - * @param string $label: Link title and label |
|
106 | - * |
|
107 | - * @return string linkt to image file with given label |
|
108 | - */ |
|
109 | - protected function getImage($page, $label) { |
|
99 | + /** |
|
100 | + * Get image's URL and MIME type |
|
101 | + * |
|
102 | + * @access protected |
|
103 | + * |
|
104 | + * @param integer $page: Page number |
|
105 | + * @param string $label: Link title and label |
|
106 | + * |
|
107 | + * @return string linkt to image file with given label |
|
108 | + */ |
|
109 | + protected function getImage($page, $label) { |
|
110 | 110 | |
111 | - $image = array (); |
|
111 | + $image = array (); |
|
112 | 112 | |
113 | - // Get @USE value of METS fileGrp. |
|
114 | - $fileGrps = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['fileGrpsImageDownload']); |
|
113 | + // Get @USE value of METS fileGrp. |
|
114 | + $fileGrps = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['fileGrpsImageDownload']); |
|
115 | 115 | |
116 | - while ($fileGrp = @array_pop($fileGrps)) { |
|
116 | + while ($fileGrp = @array_pop($fileGrps)) { |
|
117 | 117 | |
118 | - // Get image link. |
|
119 | - if (!empty($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrp])) { |
|
118 | + // Get image link. |
|
119 | + if (!empty($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrp])) { |
|
120 | 120 | |
121 | - $image['url'] = $this->doc->getFileLocation($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrp]); |
|
121 | + $image['url'] = $this->doc->getFileLocation($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrp]); |
|
122 | 122 | |
123 | - $image['mimetype'] = $this->doc->getFileMimeType($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrp]); |
|
123 | + $image['mimetype'] = $this->doc->getFileMimeType($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrp]); |
|
124 | 124 | |
125 | - switch ($image['mimetype']) { |
|
126 | - case 'image/jpeg': $mimetypeLabel = '(JPG)'; |
|
127 | - break; |
|
128 | - case 'image/tiff': $mimetypeLabel = '(TIFF)'; |
|
129 | - break; |
|
130 | - default: $mimetypeLabel = ''; |
|
131 | - } |
|
132 | - $linkConf = array ( |
|
133 | - 'parameter' => $image['url'], |
|
134 | - 'title' => $label.' '.$mimetypeLabel, |
|
135 | - 'additionalParams' => '', |
|
136 | - ); |
|
125 | + switch ($image['mimetype']) { |
|
126 | + case 'image/jpeg': $mimetypeLabel = '(JPG)'; |
|
127 | + break; |
|
128 | + case 'image/tiff': $mimetypeLabel = '(TIFF)'; |
|
129 | + break; |
|
130 | + default: $mimetypeLabel = ''; |
|
131 | + } |
|
132 | + $linkConf = array ( |
|
133 | + 'parameter' => $image['url'], |
|
134 | + 'title' => $label.' '.$mimetypeLabel, |
|
135 | + 'additionalParams' => '', |
|
136 | + ); |
|
137 | 137 | |
138 | - $imageLink = $this->cObj->typoLink($label.' '.$mimetypeLabel, $linkConf); |
|
138 | + $imageLink = $this->cObj->typoLink($label.' '.$mimetypeLabel, $linkConf); |
|
139 | 139 | |
140 | - break; |
|
140 | + break; |
|
141 | 141 | |
142 | - } else { |
|
142 | + } else { |
|
143 | 143 | |
144 | - if (TYPO3_DLOG) { |
|
144 | + if (TYPO3_DLOG) { |
|
145 | 145 | |
146 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_toolsImagedownload->getImage('.$page.')] File not found in fileGrp "'.$fileGrp.'"', $this->extKey, SYSLOG_SEVERITY_WARNING); |
|
146 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_toolsImagedownload->getImage('.$page.')] File not found in fileGrp "'.$fileGrp.'"', $this->extKey, SYSLOG_SEVERITY_WARNING); |
|
147 | 147 | |
148 | - } |
|
148 | + } |
|
149 | 149 | |
150 | - } |
|
150 | + } |
|
151 | 151 | |
152 | - } |
|
152 | + } |
|
153 | 153 | |
154 | - return $imageLink; |
|
154 | + return $imageLink; |
|
155 | 155 | |
156 | - } |
|
156 | + } |
|
157 | 157 | |
158 | 158 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | protected function getImage($page, $label) { |
110 | 110 | |
111 | - $image = array (); |
|
111 | + $image = array(); |
|
112 | 112 | |
113 | 113 | // Get @USE value of METS fileGrp. |
114 | 114 | $fileGrps = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['fileGrpsImageDownload']); |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | break; |
130 | 130 | default: $mimetypeLabel = ''; |
131 | 131 | } |
132 | - $linkConf = array ( |
|
132 | + $linkConf = array( |
|
133 | 133 | 'parameter' => $image['url'], |
134 | 134 | 'title' => $label.' '.$mimetypeLabel, |
135 | 135 | 'additionalParams' => '', |
@@ -19,66 +19,66 @@ |
||
19 | 19 | */ |
20 | 20 | class tx_dlf_toolbox extends tx_dlf_plugin { |
21 | 21 | |
22 | - public $scriptRelPath = 'plugins/toolbox/class.tx_dlf_toolbox.php'; |
|
22 | + public $scriptRelPath = 'plugins/toolbox/class.tx_dlf_toolbox.php'; |
|
23 | 23 | |
24 | - /** |
|
25 | - * The main method of the PlugIn |
|
26 | - * |
|
27 | - * @access public |
|
28 | - * |
|
29 | - * @param string $content: The PlugIn content |
|
30 | - * @param array $conf: The PlugIn configuration |
|
31 | - * |
|
32 | - * @return string The content that is displayed on the website |
|
33 | - */ |
|
34 | - public function main($content, $conf) { |
|
24 | + /** |
|
25 | + * The main method of the PlugIn |
|
26 | + * |
|
27 | + * @access public |
|
28 | + * |
|
29 | + * @param string $content: The PlugIn content |
|
30 | + * @param array $conf: The PlugIn configuration |
|
31 | + * |
|
32 | + * @return string The content that is displayed on the website |
|
33 | + */ |
|
34 | + public function main($content, $conf) { |
|
35 | 35 | |
36 | - $this->init($conf); |
|
36 | + $this->init($conf); |
|
37 | 37 | |
38 | - // Quit without doing anything if required variable is not set. |
|
39 | - if (empty($this->piVars['id'])) { |
|
38 | + // Quit without doing anything if required variable is not set. |
|
39 | + if (empty($this->piVars['id'])) { |
|
40 | 40 | |
41 | - return $content; |
|
41 | + return $content; |
|
42 | 42 | |
43 | - } |
|
43 | + } |
|
44 | 44 | |
45 | - // Load template file. |
|
46 | - if (!empty($this->conf['templateFile'])) { |
|
45 | + // Load template file. |
|
46 | + if (!empty($this->conf['templateFile'])) { |
|
47 | 47 | |
48 | - $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###'); |
|
48 | + $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###'); |
|
49 | 49 | |
50 | - } else { |
|
50 | + } else { |
|
51 | 51 | |
52 | - $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/toolbox/template.tmpl'), '###TEMPLATE###'); |
|
52 | + $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/toolbox/template.tmpl'), '###TEMPLATE###'); |
|
53 | 53 | |
54 | - } |
|
54 | + } |
|
55 | 55 | |
56 | - // Build data array. |
|
57 | - $data = array ( |
|
58 | - 'conf' => $this->conf, |
|
59 | - 'piVars' => $this->piVars, |
|
60 | - ); |
|
56 | + // Build data array. |
|
57 | + $data = array ( |
|
58 | + 'conf' => $this->conf, |
|
59 | + 'piVars' => $this->piVars, |
|
60 | + ); |
|
61 | 61 | |
62 | - // Get template subpart for tools. |
|
63 | - $subpart = $this->cObj->getSubpart($this->template, '###TOOLS###'); |
|
62 | + // Get template subpart for tools. |
|
63 | + $subpart = $this->cObj->getSubpart($this->template, '###TOOLS###'); |
|
64 | 64 | |
65 | - $tools = explode(',', $this->conf['tools']); |
|
65 | + $tools = explode(',', $this->conf['tools']); |
|
66 | 66 | |
67 | - // Add the tools to the toolbox. |
|
68 | - foreach ($tools as $tool) { |
|
67 | + // Add the tools to the toolbox. |
|
68 | + foreach ($tools as $tool) { |
|
69 | 69 | |
70 | - $tool = trim($tool); |
|
70 | + $tool = trim($tool); |
|
71 | 71 | |
72 | - $cObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer'); |
|
72 | + $cObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer'); |
|
73 | 73 | |
74 | - $cObj->data = $data; |
|
74 | + $cObj->data = $data; |
|
75 | 75 | |
76 | - $content .= $this->cObj->substituteMarkerArray($subpart, array ('###TOOL###' => $cObj->cObjGetSingle($GLOBALS['TSFE']->tmpl->setup['plugin.'][$tool], $GLOBALS['TSFE']->tmpl->setup['plugin.'][$tool.'.']))); |
|
76 | + $content .= $this->cObj->substituteMarkerArray($subpart, array ('###TOOL###' => $cObj->cObjGetSingle($GLOBALS['TSFE']->tmpl->setup['plugin.'][$tool], $GLOBALS['TSFE']->tmpl->setup['plugin.'][$tool.'.']))); |
|
77 | 77 | |
78 | - } |
|
78 | + } |
|
79 | 79 | |
80 | - return $this->pi_wrapInBaseClass($this->cObj->substituteSubpart($this->template, '###TOOLS###', $content, TRUE)); |
|
80 | + return $this->pi_wrapInBaseClass($this->cObj->substituteSubpart($this->template, '###TOOLS###', $content, TRUE)); |
|
81 | 81 | |
82 | - } |
|
82 | + } |
|
83 | 83 | |
84 | 84 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | // Build data array. |
57 | - $data = array ( |
|
57 | + $data = array( |
|
58 | 58 | 'conf' => $this->conf, |
59 | 59 | 'piVars' => $this->piVars, |
60 | 60 | ); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | $cObj->data = $data; |
75 | 75 | |
76 | - $content .= $this->cObj->substituteMarkerArray($subpart, array ('###TOOL###' => $cObj->cObjGetSingle($GLOBALS['TSFE']->tmpl->setup['plugin.'][$tool], $GLOBALS['TSFE']->tmpl->setup['plugin.'][$tool.'.']))); |
|
76 | + $content .= $this->cObj->substituteMarkerArray($subpart, array('###TOOL###' => $cObj->cObjGetSingle($GLOBALS['TSFE']->tmpl->setup['plugin.'][$tool], $GLOBALS['TSFE']->tmpl->setup['plugin.'][$tool.'.']))); |
|
77 | 77 | |
78 | 78 | } |
79 | 79 |