We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -19,893 +19,893 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | class tx_dlf_list implements ArrayAccess, Countable, Iterator, \TYPO3\CMS\Core\SingletonInterface { |
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * This holds the number of documents in the list |
|
| 24 | - * @see Countable |
|
| 25 | - * |
|
| 26 | - * @var integer |
|
| 27 | - * @access protected |
|
| 28 | - */ |
|
| 29 | - protected $count = 0; |
|
| 30 | - |
|
| 31 | - /** |
|
| 32 | - * This holds the list entries in sorted order |
|
| 33 | - * @see ArrayAccess |
|
| 34 | - * |
|
| 35 | - * @var array() |
|
| 36 | - * @access protected |
|
| 37 | - */ |
|
| 38 | - protected $elements = array (); |
|
| 39 | - |
|
| 40 | - /** |
|
| 41 | - * This holds the list's metadata |
|
| 42 | - * |
|
| 43 | - * @var array |
|
| 44 | - * @access protected |
|
| 45 | - */ |
|
| 46 | - protected $metadata = array (); |
|
| 47 | - |
|
| 48 | - /** |
|
| 49 | - * This holds the current list position |
|
| 50 | - * @see Iterator |
|
| 51 | - * |
|
| 52 | - * @var integer |
|
| 53 | - * @access protected |
|
| 54 | - */ |
|
| 55 | - protected $position = 0; |
|
| 56 | - |
|
| 57 | - /** |
|
| 58 | - * This holds the full records of already processed list elements |
|
| 59 | - * |
|
| 60 | - * @var array() |
|
| 61 | - * @access protected |
|
| 62 | - */ |
|
| 63 | - protected $records = array (); |
|
| 64 | - |
|
| 65 | - /** |
|
| 66 | - * Instance of Apache_Solr_Service class |
|
| 67 | - * |
|
| 68 | - * @var Apache_Solr_Service |
|
| 69 | - * @access protected |
|
| 70 | - */ |
|
| 71 | - protected $solr; |
|
| 72 | - |
|
| 73 | - /** |
|
| 74 | - * This holds the Solr metadata configuration |
|
| 75 | - * |
|
| 76 | - * @var array |
|
| 77 | - * @access protected |
|
| 78 | - */ |
|
| 79 | - protected $solrConfig = array (); |
|
| 80 | - |
|
| 81 | - /** |
|
| 82 | - * This adds an array of elements at the given position to the list |
|
| 83 | - * |
|
| 84 | - * @access public |
|
| 85 | - * |
|
| 86 | - * @param array $elements: Array of elements to add to list |
|
| 87 | - * @param integer $position: Numeric position for including |
|
| 88 | - * |
|
| 89 | - * @return void |
|
| 90 | - */ |
|
| 91 | - public function add(array $elements, $position = -1) { |
|
| 92 | - |
|
| 93 | - $position = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($position, 0, $this->count, $this->count); |
|
| 94 | - |
|
| 95 | - if (!empty($elements)) { |
|
| 96 | - |
|
| 97 | - array_splice($this->elements, $position, 0, $elements); |
|
| 98 | - |
|
| 99 | - $this->count = count($this->elements); |
|
| 100 | - |
|
| 101 | - } |
|
| 102 | - |
|
| 103 | - } |
|
| 104 | - |
|
| 105 | - /** |
|
| 106 | - * This counts the elements |
|
| 107 | - * @see Countable::count() |
|
| 108 | - * |
|
| 109 | - * @access public |
|
| 110 | - * |
|
| 111 | - * @return integer The number of elements in the list |
|
| 112 | - */ |
|
| 113 | - public function count() { |
|
| 22 | + /** |
|
| 23 | + * This holds the number of documents in the list |
|
| 24 | + * @see Countable |
|
| 25 | + * |
|
| 26 | + * @var integer |
|
| 27 | + * @access protected |
|
| 28 | + */ |
|
| 29 | + protected $count = 0; |
|
| 30 | + |
|
| 31 | + /** |
|
| 32 | + * This holds the list entries in sorted order |
|
| 33 | + * @see ArrayAccess |
|
| 34 | + * |
|
| 35 | + * @var array() |
|
| 36 | + * @access protected |
|
| 37 | + */ |
|
| 38 | + protected $elements = array (); |
|
| 39 | + |
|
| 40 | + /** |
|
| 41 | + * This holds the list's metadata |
|
| 42 | + * |
|
| 43 | + * @var array |
|
| 44 | + * @access protected |
|
| 45 | + */ |
|
| 46 | + protected $metadata = array (); |
|
| 47 | + |
|
| 48 | + /** |
|
| 49 | + * This holds the current list position |
|
| 50 | + * @see Iterator |
|
| 51 | + * |
|
| 52 | + * @var integer |
|
| 53 | + * @access protected |
|
| 54 | + */ |
|
| 55 | + protected $position = 0; |
|
| 56 | + |
|
| 57 | + /** |
|
| 58 | + * This holds the full records of already processed list elements |
|
| 59 | + * |
|
| 60 | + * @var array() |
|
| 61 | + * @access protected |
|
| 62 | + */ |
|
| 63 | + protected $records = array (); |
|
| 64 | + |
|
| 65 | + /** |
|
| 66 | + * Instance of Apache_Solr_Service class |
|
| 67 | + * |
|
| 68 | + * @var Apache_Solr_Service |
|
| 69 | + * @access protected |
|
| 70 | + */ |
|
| 71 | + protected $solr; |
|
| 72 | + |
|
| 73 | + /** |
|
| 74 | + * This holds the Solr metadata configuration |
|
| 75 | + * |
|
| 76 | + * @var array |
|
| 77 | + * @access protected |
|
| 78 | + */ |
|
| 79 | + protected $solrConfig = array (); |
|
| 80 | + |
|
| 81 | + /** |
|
| 82 | + * This adds an array of elements at the given position to the list |
|
| 83 | + * |
|
| 84 | + * @access public |
|
| 85 | + * |
|
| 86 | + * @param array $elements: Array of elements to add to list |
|
| 87 | + * @param integer $position: Numeric position for including |
|
| 88 | + * |
|
| 89 | + * @return void |
|
| 90 | + */ |
|
| 91 | + public function add(array $elements, $position = -1) { |
|
| 92 | + |
|
| 93 | + $position = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($position, 0, $this->count, $this->count); |
|
| 94 | + |
|
| 95 | + if (!empty($elements)) { |
|
| 96 | + |
|
| 97 | + array_splice($this->elements, $position, 0, $elements); |
|
| 98 | + |
|
| 99 | + $this->count = count($this->elements); |
|
| 100 | + |
|
| 101 | + } |
|
| 102 | + |
|
| 103 | + } |
|
| 104 | + |
|
| 105 | + /** |
|
| 106 | + * This counts the elements |
|
| 107 | + * @see Countable::count() |
|
| 108 | + * |
|
| 109 | + * @access public |
|
| 110 | + * |
|
| 111 | + * @return integer The number of elements in the list |
|
| 112 | + */ |
|
| 113 | + public function count() { |
|
| 114 | 114 | |
| 115 | - return $this->count; |
|
| 115 | + return $this->count; |
|
| 116 | 116 | |
| 117 | - } |
|
| 117 | + } |
|
| 118 | 118 | |
| 119 | - /** |
|
| 120 | - * This returns the current element |
|
| 121 | - * @see Iterator::current() |
|
| 122 | - * |
|
| 123 | - * @access public |
|
| 124 | - * |
|
| 125 | - * @return array The current element |
|
| 126 | - */ |
|
| 127 | - public function current() { |
|
| 119 | + /** |
|
| 120 | + * This returns the current element |
|
| 121 | + * @see Iterator::current() |
|
| 122 | + * |
|
| 123 | + * @access public |
|
| 124 | + * |
|
| 125 | + * @return array The current element |
|
| 126 | + */ |
|
| 127 | + public function current() { |
|
| 128 | 128 | |
| 129 | - if ($this->valid()) { |
|
| 129 | + if ($this->valid()) { |
|
| 130 | 130 | |
| 131 | - return $this->getRecord($this->elements[$this->position]); |
|
| 131 | + return $this->getRecord($this->elements[$this->position]); |
|
| 132 | 132 | |
| 133 | - } else { |
|
| 133 | + } else { |
|
| 134 | 134 | |
| 135 | - if (TYPO3_DLOG) { |
|
| 135 | + if (TYPO3_DLOG) { |
|
| 136 | 136 | |
| 137 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_list->current()] Invalid position "'.$this->position.'" for list element', $this->extKey, SYSLOG_SEVERITY_NOTICE); |
|
| 137 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_list->current()] Invalid position "'.$this->position.'" for list element', $this->extKey, SYSLOG_SEVERITY_NOTICE); |
|
| 138 | 138 | |
| 139 | - } |
|
| 139 | + } |
|
| 140 | 140 | |
| 141 | - return; |
|
| 141 | + return; |
|
| 142 | 142 | |
| 143 | - } |
|
| 143 | + } |
|
| 144 | 144 | |
| 145 | - } |
|
| 145 | + } |
|
| 146 | 146 | |
| 147 | - /** |
|
| 148 | - * This returns the full record of any list element |
|
| 149 | - * |
|
| 150 | - * @access protected |
|
| 151 | - * |
|
| 152 | - * @param mixed $element: The list element |
|
| 153 | - * |
|
| 154 | - * @return mixed The element's full record |
|
| 155 | - */ |
|
| 156 | - protected function getRecord($element) { |
|
| 147 | + /** |
|
| 148 | + * This returns the full record of any list element |
|
| 149 | + * |
|
| 150 | + * @access protected |
|
| 151 | + * |
|
| 152 | + * @param mixed $element: The list element |
|
| 153 | + * |
|
| 154 | + * @return mixed The element's full record |
|
| 155 | + */ |
|
| 156 | + protected function getRecord($element) { |
|
| 157 | 157 | |
| 158 | - if (is_array($element) && array_keys($element) == array ('u', 'h', 's', 'p')) { |
|
| 158 | + if (is_array($element) && array_keys($element) == array ('u', 'h', 's', 'p')) { |
|
| 159 | 159 | |
| 160 | - // Return already processed record if possible. |
|
| 161 | - if (!empty($this->records[$element['u']])) { |
|
| 160 | + // Return already processed record if possible. |
|
| 161 | + if (!empty($this->records[$element['u']])) { |
|
| 162 | 162 | |
| 163 | - return $this->records[$element['u']]; |
|
| 163 | + return $this->records[$element['u']]; |
|
| 164 | 164 | |
| 165 | - } |
|
| 165 | + } |
|
| 166 | 166 | |
| 167 | - $record = array ( |
|
| 168 | - 'uid' => $element['u'], |
|
| 169 | - 'page' => 1, |
|
| 170 | - 'preview' => '', |
|
| 171 | - 'subparts' => $element['p'] |
|
| 172 | - ); |
|
| 167 | + $record = array ( |
|
| 168 | + 'uid' => $element['u'], |
|
| 169 | + 'page' => 1, |
|
| 170 | + 'preview' => '', |
|
| 171 | + 'subparts' => $element['p'] |
|
| 172 | + ); |
|
| 173 | 173 | |
| 174 | - // Check if it's a list of database records or Solr documents. |
|
| 175 | - if (!empty($this->metadata['options']['source']) && $this->metadata['options']['source'] == 'collection') { |
|
| 174 | + // Check if it's a list of database records or Solr documents. |
|
| 175 | + if (!empty($this->metadata['options']['source']) && $this->metadata['options']['source'] == 'collection') { |
|
| 176 | 176 | |
| 177 | - // Get document's thumbnail and metadata from database. |
|
| 178 | - $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 179 | - 'tx_dlf_documents.uid AS uid,tx_dlf_documents.thumbnail AS thumbnail,tx_dlf_documents.metadata AS metadata', |
|
| 180 | - 'tx_dlf_documents', |
|
| 181 | - '(tx_dlf_documents.uid='.intval($record['uid']).' OR tx_dlf_documents.partof='.intval($record['uid']).')'.tx_dlf_helper::whereClause('tx_dlf_documents'), |
|
| 182 | - '', |
|
| 183 | - '', |
|
| 184 | - '' |
|
| 185 | - ); |
|
| 177 | + // Get document's thumbnail and metadata from database. |
|
| 178 | + $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 179 | + 'tx_dlf_documents.uid AS uid,tx_dlf_documents.thumbnail AS thumbnail,tx_dlf_documents.metadata AS metadata', |
|
| 180 | + 'tx_dlf_documents', |
|
| 181 | + '(tx_dlf_documents.uid='.intval($record['uid']).' OR tx_dlf_documents.partof='.intval($record['uid']).')'.tx_dlf_helper::whereClause('tx_dlf_documents'), |
|
| 182 | + '', |
|
| 183 | + '', |
|
| 184 | + '' |
|
| 185 | + ); |
|
| 186 | 186 | |
| 187 | - // Process results. |
|
| 188 | - while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
|
| 187 | + // Process results. |
|
| 188 | + while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
|
| 189 | 189 | |
| 190 | - // Prepare document's metadata. |
|
| 191 | - $metadata = unserialize($resArray['metadata']); |
|
| 190 | + // Prepare document's metadata. |
|
| 191 | + $metadata = unserialize($resArray['metadata']); |
|
| 192 | 192 | |
| 193 | - if (!empty($metadata['type'][0]) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($metadata['type'][0])) { |
|
| 193 | + if (!empty($metadata['type'][0]) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($metadata['type'][0])) { |
|
| 194 | 194 | |
| 195 | - $metadata['type'][0] = tx_dlf_helper::getIndexName($metadata['type'][0], 'tx_dlf_structures', $this->metadata['options']['pid']); |
|
| 195 | + $metadata['type'][0] = tx_dlf_helper::getIndexName($metadata['type'][0], 'tx_dlf_structures', $this->metadata['options']['pid']); |
|
| 196 | 196 | |
| 197 | - } |
|
| 197 | + } |
|
| 198 | 198 | |
| 199 | - if (!empty($metadata['owner'][0]) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($metadata['owner'][0])) { |
|
| 199 | + if (!empty($metadata['owner'][0]) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($metadata['owner'][0])) { |
|
| 200 | 200 | |
| 201 | - $metadata['owner'][0] = tx_dlf_helper::getIndexName($metadata['owner'][0], 'tx_dlf_libraries', $this->metadata['options']['pid']); |
|
| 201 | + $metadata['owner'][0] = tx_dlf_helper::getIndexName($metadata['owner'][0], 'tx_dlf_libraries', $this->metadata['options']['pid']); |
|
| 202 | 202 | |
| 203 | - } |
|
| 203 | + } |
|
| 204 | 204 | |
| 205 | - if (!empty($metadata['collection']) && is_array($metadata['collection'])) { |
|
| 205 | + if (!empty($metadata['collection']) && is_array($metadata['collection'])) { |
|
| 206 | 206 | |
| 207 | - foreach ($metadata['collection'] as $i => $collection) { |
|
| 207 | + foreach ($metadata['collection'] as $i => $collection) { |
|
| 208 | 208 | |
| 209 | - if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($collection)) { |
|
| 209 | + if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($collection)) { |
|
| 210 | 210 | |
| 211 | - $metadata['collection'][$i] = tx_dlf_helper::getIndexName($metadata['collection'][$i], 'tx_dlf_collections', $this->metadata['options']['pid']); |
|
| 211 | + $metadata['collection'][$i] = tx_dlf_helper::getIndexName($metadata['collection'][$i], 'tx_dlf_collections', $this->metadata['options']['pid']); |
|
| 212 | 212 | |
| 213 | - } |
|
| 213 | + } |
|
| 214 | 214 | |
| 215 | - } |
|
| 215 | + } |
|
| 216 | 216 | |
| 217 | - } |
|
| 217 | + } |
|
| 218 | 218 | |
| 219 | - // Add metadata to list element. |
|
| 220 | - if ($resArray['uid'] == $record['uid']) { |
|
| 219 | + // Add metadata to list element. |
|
| 220 | + if ($resArray['uid'] == $record['uid']) { |
|
| 221 | 221 | |
| 222 | - $record['thumbnail'] = $resArray['thumbnail']; |
|
| 222 | + $record['thumbnail'] = $resArray['thumbnail']; |
|
| 223 | 223 | |
| 224 | - $record['metadata'] = $metadata; |
|
| 224 | + $record['metadata'] = $metadata; |
|
| 225 | 225 | |
| 226 | - } elseif (($key = tx_dlf_helper::array_search_recursive($resArray['uid'], $record['subparts'], TRUE)) !== FALSE) { |
|
| 226 | + } elseif (($key = tx_dlf_helper::array_search_recursive($resArray['uid'], $record['subparts'], TRUE)) !== FALSE) { |
|
| 227 | 227 | |
| 228 | - $record['subparts'][$key] = array ( |
|
| 229 | - 'uid' => $resArray['uid'], |
|
| 230 | - 'page' => 1, |
|
| 231 | - 'preview' => (!empty($record['subparts'][$key]['h']) ? $record['subparts'][$key]['h'] : ''), |
|
| 232 | - 'thumbnail' => $resArray['thumbnail'], |
|
| 233 | - 'metadata' => $metadata |
|
| 234 | - ); |
|
| 228 | + $record['subparts'][$key] = array ( |
|
| 229 | + 'uid' => $resArray['uid'], |
|
| 230 | + 'page' => 1, |
|
| 231 | + 'preview' => (!empty($record['subparts'][$key]['h']) ? $record['subparts'][$key]['h'] : ''), |
|
| 232 | + 'thumbnail' => $resArray['thumbnail'], |
|
| 233 | + 'metadata' => $metadata |
|
| 234 | + ); |
|
| 235 | 235 | |
| 236 | - } |
|
| 236 | + } |
|
| 237 | 237 | |
| 238 | - } |
|
| 238 | + } |
|
| 239 | 239 | |
| 240 | - } elseif (!empty($this->metadata['options']['source']) && $this->metadata['options']['source'] == 'search') { |
|
| 240 | + } elseif (!empty($this->metadata['options']['source']) && $this->metadata['options']['source'] == 'search') { |
|
| 241 | 241 | |
| 242 | - if ($this->solrConnect()) { |
|
| 242 | + if ($this->solrConnect()) { |
|
| 243 | 243 | |
| 244 | - // Get document's thumbnail and metadata from Solr index. |
|
| 245 | - $result = $this->solr->service->search('uid:'.tx_dlf_solr::escapeQuery($record['uid']), 0, $this->solr->limit); |
|
| 244 | + // Get document's thumbnail and metadata from Solr index. |
|
| 245 | + $result = $this->solr->service->search('uid:'.tx_dlf_solr::escapeQuery($record['uid']), 0, $this->solr->limit); |
|
| 246 | 246 | |
| 247 | - // Process results. |
|
| 248 | - foreach ($result->response->docs as $resArray) { |
|
| 247 | + // Process results. |
|
| 248 | + foreach ($result->response->docs as $resArray) { |
|
| 249 | 249 | |
| 250 | - // Prepare document's metadata. |
|
| 251 | - $metadata = array (); |
|
| 250 | + // Prepare document's metadata. |
|
| 251 | + $metadata = array (); |
|
| 252 | 252 | |
| 253 | - foreach ($this->solrConfig as $index_name => $solr_name) { |
|
| 253 | + foreach ($this->solrConfig as $index_name => $solr_name) { |
|
| 254 | 254 | |
| 255 | - if (!empty($resArray->$solr_name)) { |
|
| 255 | + if (!empty($resArray->$solr_name)) { |
|
| 256 | 256 | |
| 257 | - $metadata[$index_name] = (is_array($resArray->$solr_name) ? $resArray->$solr_name : array ($resArray->$solr_name)); |
|
| 257 | + $metadata[$index_name] = (is_array($resArray->$solr_name) ? $resArray->$solr_name : array ($resArray->$solr_name)); |
|
| 258 | 258 | |
| 259 | - } |
|
| 259 | + } |
|
| 260 | 260 | |
| 261 | - } |
|
| 261 | + } |
|
| 262 | 262 | |
| 263 | - // Add metadata to list elements. |
|
| 264 | - if ($resArray->toplevel) { |
|
| 263 | + // Add metadata to list elements. |
|
| 264 | + if ($resArray->toplevel) { |
|
| 265 | 265 | |
| 266 | - $record['thumbnail'] = $resArray->thumbnail; |
|
| 266 | + $record['thumbnail'] = $resArray->thumbnail; |
|
| 267 | 267 | |
| 268 | - $record['metadata'] = $metadata; |
|
| 268 | + $record['metadata'] = $metadata; |
|
| 269 | 269 | |
| 270 | - } elseif (($key = tx_dlf_helper::array_search_recursive($resArray->id, $record['subparts'], TRUE)) !== FALSE) { |
|
| 270 | + } elseif (($key = tx_dlf_helper::array_search_recursive($resArray->id, $record['subparts'], TRUE)) !== FALSE) { |
|
| 271 | 271 | |
| 272 | - $record['subparts'][$key] = array ( |
|
| 273 | - 'uid' => $resArray->uid, |
|
| 274 | - 'page' => $resArray->page, |
|
| 275 | - 'preview' => (!empty($record['subparts'][$key]['h']) ? $record['subparts'][$key]['h'] : ''), |
|
| 276 | - 'thumbnail' => $resArray->thumbnail, |
|
| 277 | - 'metadata' => $metadata |
|
| 278 | - ); |
|
| 272 | + $record['subparts'][$key] = array ( |
|
| 273 | + 'uid' => $resArray->uid, |
|
| 274 | + 'page' => $resArray->page, |
|
| 275 | + 'preview' => (!empty($record['subparts'][$key]['h']) ? $record['subparts'][$key]['h'] : ''), |
|
| 276 | + 'thumbnail' => $resArray->thumbnail, |
|
| 277 | + 'metadata' => $metadata |
|
| 278 | + ); |
|
| 279 | 279 | |
| 280 | - } |
|
| 280 | + } |
|
| 281 | 281 | |
| 282 | - } |
|
| 282 | + } |
|
| 283 | 283 | |
| 284 | - } |
|
| 284 | + } |
|
| 285 | 285 | |
| 286 | - } |
|
| 286 | + } |
|
| 287 | 287 | |
| 288 | - // Save record for later usage. |
|
| 289 | - $this->records[$element['u']] = $record; |
|
| 288 | + // Save record for later usage. |
|
| 289 | + $this->records[$element['u']] = $record; |
|
| 290 | 290 | |
| 291 | - } else { |
|
| 291 | + } else { |
|
| 292 | 292 | |
| 293 | - if (TYPO3_DLOG) { |
|
| 293 | + if (TYPO3_DLOG) { |
|
| 294 | 294 | |
| 295 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_list->getRecord([data])] No UID of list element to fetch full record', $this->extKey, SYSLOG_SEVERITY_NOTICE, $element); |
|
| 295 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_list->getRecord([data])] No UID of list element to fetch full record', $this->extKey, SYSLOG_SEVERITY_NOTICE, $element); |
|
| 296 | 296 | |
| 297 | - } |
|
| 297 | + } |
|
| 298 | 298 | |
| 299 | - $record = $element; |
|
| 299 | + $record = $element; |
|
| 300 | 300 | |
| 301 | - } |
|
| 301 | + } |
|
| 302 | 302 | |
| 303 | - return $record; |
|
| 303 | + return $record; |
|
| 304 | 304 | |
| 305 | - } |
|
| 305 | + } |
|
| 306 | 306 | |
| 307 | - /** |
|
| 308 | - * This returns the current position |
|
| 309 | - * @see Iterator::key() |
|
| 310 | - * |
|
| 311 | - * @access public |
|
| 312 | - * |
|
| 313 | - * @return integer The current position |
|
| 314 | - */ |
|
| 315 | - public function key() { |
|
| 307 | + /** |
|
| 308 | + * This returns the current position |
|
| 309 | + * @see Iterator::key() |
|
| 310 | + * |
|
| 311 | + * @access public |
|
| 312 | + * |
|
| 313 | + * @return integer The current position |
|
| 314 | + */ |
|
| 315 | + public function key() { |
|
| 316 | 316 | |
| 317 | - return $this->position; |
|
| 317 | + return $this->position; |
|
| 318 | 318 | |
| 319 | - } |
|
| 319 | + } |
|
| 320 | 320 | |
| 321 | 321 | |
| 322 | 322 | |
| 323 | - /** |
|
| 324 | - * This moves the element at the given position up or down |
|
| 325 | - * |
|
| 326 | - * @access public |
|
| 327 | - * |
|
| 328 | - * @param integer $position: Numeric position for moving |
|
| 329 | - * @param integer $steps: Amount of steps to move up or down |
|
| 330 | - * |
|
| 331 | - * @return void |
|
| 332 | - */ |
|
| 333 | - public function move($position, $steps) { |
|
| 323 | + /** |
|
| 324 | + * This moves the element at the given position up or down |
|
| 325 | + * |
|
| 326 | + * @access public |
|
| 327 | + * |
|
| 328 | + * @param integer $position: Numeric position for moving |
|
| 329 | + * @param integer $steps: Amount of steps to move up or down |
|
| 330 | + * |
|
| 331 | + * @return void |
|
| 332 | + */ |
|
| 333 | + public function move($position, $steps) { |
|
| 334 | 334 | |
| 335 | - // Save parameters for logging purposes. |
|
| 336 | - $_position = $position; |
|
| 335 | + // Save parameters for logging purposes. |
|
| 336 | + $_position = $position; |
|
| 337 | 337 | |
| 338 | - $_steps = $steps; |
|
| 338 | + $_steps = $steps; |
|
| 339 | 339 | |
| 340 | - $position = intval($position); |
|
| 340 | + $position = intval($position); |
|
| 341 | 341 | |
| 342 | - // Check if list position is valid. |
|
| 343 | - if ($position < 0 || $position >= $this->count) { |
|
| 342 | + // Check if list position is valid. |
|
| 343 | + if ($position < 0 || $position >= $this->count) { |
|
| 344 | 344 | |
| 345 | - if (TYPO3_DLOG) { |
|
| 345 | + if (TYPO3_DLOG) { |
|
| 346 | 346 | |
| 347 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_list->move('.$_position.', '.$_steps.')] Invalid position "'.$position.'" for element moving', $this->extKey, SYSLOG_SEVERITY_WARNING); |
|
| 347 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_list->move('.$_position.', '.$_steps.')] Invalid position "'.$position.'" for element moving', $this->extKey, SYSLOG_SEVERITY_WARNING); |
|
| 348 | 348 | |
| 349 | - } |
|
| 349 | + } |
|
| 350 | 350 | |
| 351 | - return; |
|
| 351 | + return; |
|
| 352 | 352 | |
| 353 | - } |
|
| 353 | + } |
|
| 354 | 354 | |
| 355 | - $steps = intval($steps); |
|
| 355 | + $steps = intval($steps); |
|
| 356 | 356 | |
| 357 | - // Check if moving given amount of steps is possible. |
|
| 358 | - if (($position + $steps) < 0 || ($position + $steps) >= $this->count) { |
|
| 357 | + // Check if moving given amount of steps is possible. |
|
| 358 | + if (($position + $steps) < 0 || ($position + $steps) >= $this->count) { |
|
| 359 | 359 | |
| 360 | - if (TYPO3_DLOG) { |
|
| 360 | + if (TYPO3_DLOG) { |
|
| 361 | 361 | |
| 362 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_list->move('.$_position.', '.$_steps.')] Invalid steps "'.$steps.'" for moving element at position "'.$position.'"', $this->extKey, SYSLOG_SEVERITY_WARNING); |
|
| 362 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_list->move('.$_position.', '.$_steps.')] Invalid steps "'.$steps.'" for moving element at position "'.$position.'"', $this->extKey, SYSLOG_SEVERITY_WARNING); |
|
| 363 | 363 | |
| 364 | - } |
|
| 364 | + } |
|
| 365 | 365 | |
| 366 | - return; |
|
| 366 | + return; |
|
| 367 | 367 | |
| 368 | - } |
|
| 368 | + } |
|
| 369 | 369 | |
| 370 | - $element = $this->remove($position); |
|
| 370 | + $element = $this->remove($position); |
|
| 371 | 371 | |
| 372 | - $this->add(array ($element), $position + $steps); |
|
| 372 | + $this->add(array ($element), $position + $steps); |
|
| 373 | 373 | |
| 374 | - } |
|
| 374 | + } |
|
| 375 | 375 | |
| 376 | - /** |
|
| 377 | - * This moves the element at the given position up |
|
| 378 | - * |
|
| 379 | - * @access public |
|
| 380 | - * |
|
| 381 | - * @param integer $position: Numeric position for moving |
|
| 382 | - * |
|
| 383 | - * @return void |
|
| 384 | - */ |
|
| 385 | - public function moveUp($position) { |
|
| 376 | + /** |
|
| 377 | + * This moves the element at the given position up |
|
| 378 | + * |
|
| 379 | + * @access public |
|
| 380 | + * |
|
| 381 | + * @param integer $position: Numeric position for moving |
|
| 382 | + * |
|
| 383 | + * @return void |
|
| 384 | + */ |
|
| 385 | + public function moveUp($position) { |
|
| 386 | 386 | |
| 387 | - $this->move($position, -1); |
|
| 387 | + $this->move($position, -1); |
|
| 388 | 388 | |
| 389 | - } |
|
| 389 | + } |
|
| 390 | 390 | |
| 391 | - /** |
|
| 392 | - * This moves the element at the given position down |
|
| 393 | - * |
|
| 394 | - * @access public |
|
| 395 | - * |
|
| 396 | - * @param integer $position: Numeric position for moving |
|
| 397 | - * |
|
| 398 | - * @return void |
|
| 399 | - */ |
|
| 400 | - public function moveDown($position) { |
|
| 391 | + /** |
|
| 392 | + * This moves the element at the given position down |
|
| 393 | + * |
|
| 394 | + * @access public |
|
| 395 | + * |
|
| 396 | + * @param integer $position: Numeric position for moving |
|
| 397 | + * |
|
| 398 | + * @return void |
|
| 399 | + */ |
|
| 400 | + public function moveDown($position) { |
|
| 401 | 401 | |
| 402 | - $this->move($position, 1); |
|
| 402 | + $this->move($position, 1); |
|
| 403 | 403 | |
| 404 | - } |
|
| 404 | + } |
|
| 405 | 405 | |
| 406 | - /** |
|
| 407 | - * This increments the current list position |
|
| 408 | - * @see Iterator::next() |
|
| 409 | - * |
|
| 410 | - * @access public |
|
| 411 | - * |
|
| 412 | - * @return void |
|
| 413 | - */ |
|
| 414 | - public function next() { |
|
| 406 | + /** |
|
| 407 | + * This increments the current list position |
|
| 408 | + * @see Iterator::next() |
|
| 409 | + * |
|
| 410 | + * @access public |
|
| 411 | + * |
|
| 412 | + * @return void |
|
| 413 | + */ |
|
| 414 | + public function next() { |
|
| 415 | 415 | |
| 416 | - $this->position++; |
|
| 416 | + $this->position++; |
|
| 417 | 417 | |
| 418 | - } |
|
| 418 | + } |
|
| 419 | 419 | |
| 420 | - /** |
|
| 421 | - * This checks if an offset exists |
|
| 422 | - * @see ArrayAccess::offsetExists() |
|
| 423 | - * |
|
| 424 | - * @access public |
|
| 425 | - * |
|
| 426 | - * @param mixed $offset: The offset to check |
|
| 427 | - * |
|
| 428 | - * @return boolean Does the given offset exist? |
|
| 429 | - */ |
|
| 430 | - public function offsetExists($offset) { |
|
| 420 | + /** |
|
| 421 | + * This checks if an offset exists |
|
| 422 | + * @see ArrayAccess::offsetExists() |
|
| 423 | + * |
|
| 424 | + * @access public |
|
| 425 | + * |
|
| 426 | + * @param mixed $offset: The offset to check |
|
| 427 | + * |
|
| 428 | + * @return boolean Does the given offset exist? |
|
| 429 | + */ |
|
| 430 | + public function offsetExists($offset) { |
|
| 431 | 431 | |
| 432 | - return isset($this->elements[$offset]); |
|
| 432 | + return isset($this->elements[$offset]); |
|
| 433 | 433 | |
| 434 | - } |
|
| 434 | + } |
|
| 435 | 435 | |
| 436 | - /** |
|
| 437 | - * This returns the element at the given offset |
|
| 438 | - * @see ArrayAccess::offsetGet() |
|
| 439 | - * |
|
| 440 | - * @access public |
|
| 441 | - * |
|
| 442 | - * @param mixed $offset: The offset to return |
|
| 443 | - * |
|
| 444 | - * @return array The element at the given offset |
|
| 445 | - */ |
|
| 446 | - public function offsetGet($offset) { |
|
| 436 | + /** |
|
| 437 | + * This returns the element at the given offset |
|
| 438 | + * @see ArrayAccess::offsetGet() |
|
| 439 | + * |
|
| 440 | + * @access public |
|
| 441 | + * |
|
| 442 | + * @param mixed $offset: The offset to return |
|
| 443 | + * |
|
| 444 | + * @return array The element at the given offset |
|
| 445 | + */ |
|
| 446 | + public function offsetGet($offset) { |
|
| 447 | 447 | |
| 448 | - if ($this->offsetExists($offset)) { |
|
| 448 | + if ($this->offsetExists($offset)) { |
|
| 449 | 449 | |
| 450 | - return $this->getRecord($this->elements[$offset]); |
|
| 450 | + return $this->getRecord($this->elements[$offset]); |
|
| 451 | 451 | |
| 452 | - } else { |
|
| 452 | + } else { |
|
| 453 | 453 | |
| 454 | - if (TYPO3_DLOG) { |
|
| 454 | + if (TYPO3_DLOG) { |
|
| 455 | 455 | |
| 456 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_list->offsetGet('.$offset.')] Invalid offset "'.$offset.'" for list element', $this->extKey, SYSLOG_SEVERITY_NOTICE); |
|
| 456 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_list->offsetGet('.$offset.')] Invalid offset "'.$offset.'" for list element', $this->extKey, SYSLOG_SEVERITY_NOTICE); |
|
| 457 | 457 | |
| 458 | - } |
|
| 458 | + } |
|
| 459 | 459 | |
| 460 | - return; |
|
| 460 | + return; |
|
| 461 | 461 | |
| 462 | - } |
|
| 462 | + } |
|
| 463 | 463 | |
| 464 | - } |
|
| 464 | + } |
|
| 465 | 465 | |
| 466 | - /** |
|
| 467 | - * This sets the element at the given offset |
|
| 468 | - * @see ArrayAccess::offsetSet() |
|
| 469 | - * |
|
| 470 | - * @access public |
|
| 471 | - * |
|
| 472 | - * @param mixed $offset: The offset to set (non-integer offsets will be appended) |
|
| 473 | - * @param mixed $value: The value to set |
|
| 474 | - * |
|
| 475 | - * @return void |
|
| 476 | - */ |
|
| 477 | - public function offsetSet($offset, $value) { |
|
| 466 | + /** |
|
| 467 | + * This sets the element at the given offset |
|
| 468 | + * @see ArrayAccess::offsetSet() |
|
| 469 | + * |
|
| 470 | + * @access public |
|
| 471 | + * |
|
| 472 | + * @param mixed $offset: The offset to set (non-integer offsets will be appended) |
|
| 473 | + * @param mixed $value: The value to set |
|
| 474 | + * |
|
| 475 | + * @return void |
|
| 476 | + */ |
|
| 477 | + public function offsetSet($offset, $value) { |
|
| 478 | 478 | |
| 479 | - if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($offset)) { |
|
| 479 | + if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($offset)) { |
|
| 480 | 480 | |
| 481 | - $this->elements[$offset] = $value; |
|
| 481 | + $this->elements[$offset] = $value; |
|
| 482 | 482 | |
| 483 | - } else { |
|
| 483 | + } else { |
|
| 484 | 484 | |
| 485 | - $this->elements[] = $value; |
|
| 485 | + $this->elements[] = $value; |
|
| 486 | 486 | |
| 487 | - } |
|
| 487 | + } |
|
| 488 | 488 | |
| 489 | - // Re-number the elements. |
|
| 490 | - $this->elements = array_values($this->elements); |
|
| 489 | + // Re-number the elements. |
|
| 490 | + $this->elements = array_values($this->elements); |
|
| 491 | 491 | |
| 492 | - $this->count = count($this->elements); |
|
| 492 | + $this->count = count($this->elements); |
|
| 493 | 493 | |
| 494 | - } |
|
| 494 | + } |
|
| 495 | 495 | |
| 496 | - /** |
|
| 497 | - * This removes the element at the given position from the list |
|
| 498 | - * |
|
| 499 | - * @access public |
|
| 500 | - * |
|
| 501 | - * @param integer $position: Numeric position for removing |
|
| 502 | - * |
|
| 503 | - * @return array The removed element |
|
| 504 | - */ |
|
| 505 | - public function remove($position) { |
|
| 496 | + /** |
|
| 497 | + * This removes the element at the given position from the list |
|
| 498 | + * |
|
| 499 | + * @access public |
|
| 500 | + * |
|
| 501 | + * @param integer $position: Numeric position for removing |
|
| 502 | + * |
|
| 503 | + * @return array The removed element |
|
| 504 | + */ |
|
| 505 | + public function remove($position) { |
|
| 506 | 506 | |
| 507 | - // Save parameter for logging purposes. |
|
| 508 | - $_position = $position; |
|
| 507 | + // Save parameter for logging purposes. |
|
| 508 | + $_position = $position; |
|
| 509 | 509 | |
| 510 | - $position = intval($position); |
|
| 510 | + $position = intval($position); |
|
| 511 | 511 | |
| 512 | - if ($position < 0 || $position >= $this->count) { |
|
| 512 | + if ($position < 0 || $position >= $this->count) { |
|
| 513 | 513 | |
| 514 | - if (TYPO3_DLOG) { |
|
| 514 | + if (TYPO3_DLOG) { |
|
| 515 | 515 | |
| 516 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_list->remove('.$_position.')] Invalid position "'.$position.'" for element removing', $this->extKey, SYSLOG_SEVERITY_WARNING); |
|
| 516 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_list->remove('.$_position.')] Invalid position "'.$position.'" for element removing', $this->extKey, SYSLOG_SEVERITY_WARNING); |
|
| 517 | 517 | |
| 518 | - } |
|
| 518 | + } |
|
| 519 | 519 | |
| 520 | - return; |
|
| 520 | + return; |
|
| 521 | 521 | |
| 522 | - } |
|
| 522 | + } |
|
| 523 | 523 | |
| 524 | - $removed = array_splice($this->elements, $position, 1); |
|
| 524 | + $removed = array_splice($this->elements, $position, 1); |
|
| 525 | 525 | |
| 526 | - $this->count = count($this->elements); |
|
| 526 | + $this->count = count($this->elements); |
|
| 527 | 527 | |
| 528 | - return $this->getRecord($removed[0]); |
|
| 528 | + return $this->getRecord($removed[0]); |
|
| 529 | 529 | |
| 530 | - } |
|
| 530 | + } |
|
| 531 | 531 | |
| 532 | - /** |
|
| 533 | - * This clears the current list |
|
| 534 | - * |
|
| 535 | - * @access public |
|
| 536 | - * |
|
| 537 | - * @return void |
|
| 538 | - */ |
|
| 539 | - public function reset() { |
|
| 532 | + /** |
|
| 533 | + * This clears the current list |
|
| 534 | + * |
|
| 535 | + * @access public |
|
| 536 | + * |
|
| 537 | + * @return void |
|
| 538 | + */ |
|
| 539 | + public function reset() { |
|
| 540 | 540 | |
| 541 | - $this->elements = array (); |
|
| 541 | + $this->elements = array (); |
|
| 542 | 542 | |
| 543 | - $this->records = array (); |
|
| 543 | + $this->records = array (); |
|
| 544 | 544 | |
| 545 | - $this->metadata = array (); |
|
| 545 | + $this->metadata = array (); |
|
| 546 | 546 | |
| 547 | - $this->count = 0; |
|
| 547 | + $this->count = 0; |
|
| 548 | 548 | |
| 549 | - $this->position = 0; |
|
| 549 | + $this->position = 0; |
|
| 550 | 550 | |
| 551 | - } |
|
| 551 | + } |
|
| 552 | 552 | |
| 553 | - /** |
|
| 554 | - * This resets the list position |
|
| 555 | - * @see Iterator::rewind() |
|
| 556 | - * |
|
| 557 | - * @access public |
|
| 558 | - * |
|
| 559 | - * @return void |
|
| 560 | - */ |
|
| 561 | - public function rewind() { |
|
| 553 | + /** |
|
| 554 | + * This resets the list position |
|
| 555 | + * @see Iterator::rewind() |
|
| 556 | + * |
|
| 557 | + * @access public |
|
| 558 | + * |
|
| 559 | + * @return void |
|
| 560 | + */ |
|
| 561 | + public function rewind() { |
|
| 562 | 562 | |
| 563 | - $this->position = 0; |
|
| 563 | + $this->position = 0; |
|
| 564 | 564 | |
| 565 | - } |
|
| 565 | + } |
|
| 566 | 566 | |
| 567 | - /** |
|
| 568 | - * This saves the current list |
|
| 569 | - * |
|
| 570 | - * @access public |
|
| 571 | - * |
|
| 572 | - * @param integer $pid: PID for saving in database |
|
| 573 | - * |
|
| 574 | - * @return void |
|
| 575 | - */ |
|
| 576 | - public function save($pid = 0) { |
|
| 567 | + /** |
|
| 568 | + * This saves the current list |
|
| 569 | + * |
|
| 570 | + * @access public |
|
| 571 | + * |
|
| 572 | + * @param integer $pid: PID for saving in database |
|
| 573 | + * |
|
| 574 | + * @return void |
|
| 575 | + */ |
|
| 576 | + public function save($pid = 0) { |
|
| 577 | 577 | |
| 578 | - $pid = max(intval($pid), 0); |
|
| 578 | + $pid = max(intval($pid), 0); |
|
| 579 | 579 | |
| 580 | - // If no PID is given, save to the user's session instead |
|
| 581 | - if ($pid > 0) { |
|
| 580 | + // If no PID is given, save to the user's session instead |
|
| 581 | + if ($pid > 0) { |
|
| 582 | 582 | |
| 583 | - // TODO: Liste in Datenbank speichern (inkl. Sichtbarkeit, Beschreibung, etc.) |
|
| 583 | + // TODO: Liste in Datenbank speichern (inkl. Sichtbarkeit, Beschreibung, etc.) |
|
| 584 | 584 | |
| 585 | - } else { |
|
| 585 | + } else { |
|
| 586 | 586 | |
| 587 | - tx_dlf_helper::saveToSession(array ($this->elements, $this->metadata), get_class($this)); |
|
| 587 | + tx_dlf_helper::saveToSession(array ($this->elements, $this->metadata), get_class($this)); |
|
| 588 | 588 | |
| 589 | - } |
|
| 589 | + } |
|
| 590 | 590 | |
| 591 | - } |
|
| 591 | + } |
|
| 592 | 592 | |
| 593 | - /** |
|
| 594 | - * Connects to Solr server. |
|
| 595 | - * |
|
| 596 | - * @access protected |
|
| 597 | - * |
|
| 598 | - * @return boolean TRUE on success or FALSE on failure |
|
| 599 | - */ |
|
| 600 | - protected function solrConnect() { |
|
| 593 | + /** |
|
| 594 | + * Connects to Solr server. |
|
| 595 | + * |
|
| 596 | + * @access protected |
|
| 597 | + * |
|
| 598 | + * @return boolean TRUE on success or FALSE on failure |
|
| 599 | + */ |
|
| 600 | + protected function solrConnect() { |
|
| 601 | 601 | |
| 602 | - // Get Solr instance. |
|
| 603 | - if (!$this->solr) { |
|
| 602 | + // Get Solr instance. |
|
| 603 | + if (!$this->solr) { |
|
| 604 | 604 | |
| 605 | - // Connect to Solr server. |
|
| 606 | - if ($this->solr = tx_dlf_solr::getInstance($this->metadata['options']['core'])) { |
|
| 605 | + // Connect to Solr server. |
|
| 606 | + if ($this->solr = tx_dlf_solr::getInstance($this->metadata['options']['core'])) { |
|
| 607 | 607 | |
| 608 | - // Load index configuration. |
|
| 609 | - $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 610 | - 'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.index_tokenized AS index_tokenized,tx_dlf_metadata.index_indexed AS index_indexed', |
|
| 611 | - 'tx_dlf_metadata', |
|
| 612 | - 'tx_dlf_metadata.is_listed=1 AND tx_dlf_metadata.pid='.intval($this->metadata['options']['pid']).tx_dlf_helper::whereClause('tx_dlf_metadata'), |
|
| 613 | - '', |
|
| 614 | - 'tx_dlf_metadata.sorting ASC', |
|
| 615 | - '' |
|
| 616 | - ); |
|
| 608 | + // Load index configuration. |
|
| 609 | + $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 610 | + 'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.index_tokenized AS index_tokenized,tx_dlf_metadata.index_indexed AS index_indexed', |
|
| 611 | + 'tx_dlf_metadata', |
|
| 612 | + 'tx_dlf_metadata.is_listed=1 AND tx_dlf_metadata.pid='.intval($this->metadata['options']['pid']).tx_dlf_helper::whereClause('tx_dlf_metadata'), |
|
| 613 | + '', |
|
| 614 | + 'tx_dlf_metadata.sorting ASC', |
|
| 615 | + '' |
|
| 616 | + ); |
|
| 617 | 617 | |
| 618 | - while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
|
| 618 | + while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
|
| 619 | 619 | |
| 620 | - $this->solrConfig[$resArray['index_name']] = $resArray['index_name'].'_'.($resArray['index_tokenized'] ? 't' : 'u').'s'.($resArray['index_indexed'] ? 'i' : 'u'); |
|
| 620 | + $this->solrConfig[$resArray['index_name']] = $resArray['index_name'].'_'.($resArray['index_tokenized'] ? 't' : 'u').'s'.($resArray['index_indexed'] ? 'i' : 'u'); |
|
| 621 | 621 | |
| 622 | - } |
|
| 622 | + } |
|
| 623 | 623 | |
| 624 | - // Add static fields. |
|
| 625 | - $this->solrConfig['type'] = 'type'; |
|
| 624 | + // Add static fields. |
|
| 625 | + $this->solrConfig['type'] = 'type'; |
|
| 626 | 626 | |
| 627 | - } else { |
|
| 627 | + } else { |
|
| 628 | 628 | |
| 629 | - return FALSE; |
|
| 629 | + return FALSE; |
|
| 630 | 630 | |
| 631 | - } |
|
| 631 | + } |
|
| 632 | 632 | |
| 633 | - } |
|
| 633 | + } |
|
| 634 | 634 | |
| 635 | - return TRUE; |
|
| 635 | + return TRUE; |
|
| 636 | 636 | |
| 637 | - } |
|
| 637 | + } |
|
| 638 | 638 | |
| 639 | - /** |
|
| 640 | - * This sorts the current list by the given field |
|
| 641 | - * |
|
| 642 | - * @access public |
|
| 643 | - * |
|
| 644 | - * @param string $by: Sort the list by this field |
|
| 645 | - * @param boolean $asc: Sort ascending? |
|
| 646 | - * |
|
| 647 | - * @return void |
|
| 648 | - */ |
|
| 649 | - public function sort($by, $asc = TRUE) { |
|
| 639 | + /** |
|
| 640 | + * This sorts the current list by the given field |
|
| 641 | + * |
|
| 642 | + * @access public |
|
| 643 | + * |
|
| 644 | + * @param string $by: Sort the list by this field |
|
| 645 | + * @param boolean $asc: Sort ascending? |
|
| 646 | + * |
|
| 647 | + * @return void |
|
| 648 | + */ |
|
| 649 | + public function sort($by, $asc = TRUE) { |
|
| 650 | 650 | |
| 651 | - $newOrder = array (); |
|
| 651 | + $newOrder = array (); |
|
| 652 | 652 | |
| 653 | - $nonSortable = array (); |
|
| 653 | + $nonSortable = array (); |
|
| 654 | 654 | |
| 655 | - foreach ($this->elements as $num => $element) { |
|
| 655 | + foreach ($this->elements as $num => $element) { |
|
| 656 | 656 | |
| 657 | - // Is this element sortable? |
|
| 658 | - if (!empty($element['s'][$by])) { |
|
| 657 | + // Is this element sortable? |
|
| 658 | + if (!empty($element['s'][$by])) { |
|
| 659 | 659 | |
| 660 | - $newOrder[$element['s'][$by].str_pad($num, 6, '0', STR_PAD_LEFT)] = $element; |
|
| 660 | + $newOrder[$element['s'][$by].str_pad($num, 6, '0', STR_PAD_LEFT)] = $element; |
|
| 661 | 661 | |
| 662 | - } else { |
|
| 662 | + } else { |
|
| 663 | 663 | |
| 664 | - $nonSortable[] = $element; |
|
| 664 | + $nonSortable[] = $element; |
|
| 665 | 665 | |
| 666 | - } |
|
| 666 | + } |
|
| 667 | 667 | |
| 668 | - } |
|
| 668 | + } |
|
| 669 | 669 | |
| 670 | - // Reorder elements. |
|
| 671 | - if ($asc) { |
|
| 670 | + // Reorder elements. |
|
| 671 | + if ($asc) { |
|
| 672 | 672 | |
| 673 | - ksort($newOrder, SORT_LOCALE_STRING); |
|
| 673 | + ksort($newOrder, SORT_LOCALE_STRING); |
|
| 674 | 674 | |
| 675 | - } else { |
|
| 675 | + } else { |
|
| 676 | 676 | |
| 677 | - krsort($newOrder, SORT_LOCALE_STRING); |
|
| 677 | + krsort($newOrder, SORT_LOCALE_STRING); |
|
| 678 | 678 | |
| 679 | - } |
|
| 679 | + } |
|
| 680 | 680 | |
| 681 | - // Add non sortable elements to the end of the list. |
|
| 682 | - $newOrder = array_merge(array_values($newOrder), $nonSortable); |
|
| 681 | + // Add non sortable elements to the end of the list. |
|
| 682 | + $newOrder = array_merge(array_values($newOrder), $nonSortable); |
|
| 683 | 683 | |
| 684 | - // Check if something is missing. |
|
| 685 | - if ($this->count == count($newOrder)) { |
|
| 684 | + // Check if something is missing. |
|
| 685 | + if ($this->count == count($newOrder)) { |
|
| 686 | 686 | |
| 687 | - $this->elements = $newOrder; |
|
| 687 | + $this->elements = $newOrder; |
|
| 688 | 688 | |
| 689 | - } else { |
|
| 689 | + } else { |
|
| 690 | 690 | |
| 691 | - if (TYPO3_DLOG) { |
|
| 691 | + if (TYPO3_DLOG) { |
|
| 692 | 692 | |
| 693 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_list->sort('.$by.', ['.($asc ? 'TRUE' : 'FALSE').'])] Sorted list elements do not match unsorted elements', $this->extKey, SYSLOG_SEVERITY_ERROR); |
|
| 693 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_list->sort('.$by.', ['.($asc ? 'TRUE' : 'FALSE').'])] Sorted list elements do not match unsorted elements', $this->extKey, SYSLOG_SEVERITY_ERROR); |
|
| 694 | 694 | |
| 695 | - } |
|
| 695 | + } |
|
| 696 | 696 | |
| 697 | - } |
|
| 697 | + } |
|
| 698 | 698 | |
| 699 | - } |
|
| 699 | + } |
|
| 700 | 700 | |
| 701 | - /** |
|
| 702 | - * This unsets the element at the given offset |
|
| 703 | - * @see ArrayAccess::offsetUnset() |
|
| 704 | - * |
|
| 705 | - * @access public |
|
| 706 | - * |
|
| 707 | - * @param mixed $offset: The offset to unset |
|
| 708 | - * |
|
| 709 | - * @return void |
|
| 710 | - */ |
|
| 711 | - public function offsetUnset($offset) { |
|
| 701 | + /** |
|
| 702 | + * This unsets the element at the given offset |
|
| 703 | + * @see ArrayAccess::offsetUnset() |
|
| 704 | + * |
|
| 705 | + * @access public |
|
| 706 | + * |
|
| 707 | + * @param mixed $offset: The offset to unset |
|
| 708 | + * |
|
| 709 | + * @return void |
|
| 710 | + */ |
|
| 711 | + public function offsetUnset($offset) { |
|
| 712 | 712 | |
| 713 | - unset ($this->elements[$offset]); |
|
| 713 | + unset ($this->elements[$offset]); |
|
| 714 | 714 | |
| 715 | - // Re-number the elements. |
|
| 716 | - $this->elements = array_values($this->elements); |
|
| 715 | + // Re-number the elements. |
|
| 716 | + $this->elements = array_values($this->elements); |
|
| 717 | 717 | |
| 718 | - $this->count = count($this->elements); |
|
| 718 | + $this->count = count($this->elements); |
|
| 719 | 719 | |
| 720 | - } |
|
| 720 | + } |
|
| 721 | 721 | |
| 722 | - /** |
|
| 723 | - * This checks if the current list position is valid |
|
| 724 | - * @see Iterator::valid() |
|
| 725 | - * |
|
| 726 | - * @access public |
|
| 727 | - * |
|
| 728 | - * @return boolean Is the current list position valid? |
|
| 729 | - */ |
|
| 730 | - public function valid() { |
|
| 722 | + /** |
|
| 723 | + * This checks if the current list position is valid |
|
| 724 | + * @see Iterator::valid() |
|
| 725 | + * |
|
| 726 | + * @access public |
|
| 727 | + * |
|
| 728 | + * @return boolean Is the current list position valid? |
|
| 729 | + */ |
|
| 730 | + public function valid() { |
|
| 731 | 731 | |
| 732 | - return isset($this->elements[$this->position]); |
|
| 732 | + return isset($this->elements[$this->position]); |
|
| 733 | 733 | |
| 734 | - } |
|
| 734 | + } |
|
| 735 | 735 | |
| 736 | - /** |
|
| 737 | - * This returns $this->metadata via __get() |
|
| 738 | - * |
|
| 739 | - * @access protected |
|
| 740 | - * |
|
| 741 | - * @return array The list's metadata |
|
| 742 | - */ |
|
| 743 | - protected function _getMetadata() { |
|
| 736 | + /** |
|
| 737 | + * This returns $this->metadata via __get() |
|
| 738 | + * |
|
| 739 | + * @access protected |
|
| 740 | + * |
|
| 741 | + * @return array The list's metadata |
|
| 742 | + */ |
|
| 743 | + protected function _getMetadata() { |
|
| 744 | 744 | |
| 745 | - return $this->metadata; |
|
| 745 | + return $this->metadata; |
|
| 746 | 746 | |
| 747 | - } |
|
| 747 | + } |
|
| 748 | 748 | |
| 749 | - /** |
|
| 750 | - * This sets $this->metadata via __set() |
|
| 751 | - * |
|
| 752 | - * @access protected |
|
| 753 | - * |
|
| 754 | - * @param array $metadata: Array of new metadata |
|
| 755 | - * |
|
| 756 | - * @return void |
|
| 757 | - */ |
|
| 758 | - protected function _setMetadata(array $metadata = array ()) { |
|
| 749 | + /** |
|
| 750 | + * This sets $this->metadata via __set() |
|
| 751 | + * |
|
| 752 | + * @access protected |
|
| 753 | + * |
|
| 754 | + * @param array $metadata: Array of new metadata |
|
| 755 | + * |
|
| 756 | + * @return void |
|
| 757 | + */ |
|
| 758 | + protected function _setMetadata(array $metadata = array ()) { |
|
| 759 | 759 | |
| 760 | - $this->metadata = $metadata; |
|
| 760 | + $this->metadata = $metadata; |
|
| 761 | 761 | |
| 762 | - } |
|
| 762 | + } |
|
| 763 | 763 | |
| 764 | - /** |
|
| 765 | - * This is the constructor |
|
| 766 | - * |
|
| 767 | - * @access public |
|
| 768 | - * |
|
| 769 | - * @param array $elements: Array of documents initially setting up the list |
|
| 770 | - * @param array $metadata: Array of initial metadata |
|
| 771 | - * |
|
| 772 | - * @return void |
|
| 773 | - */ |
|
| 774 | - public function __construct(array $elements = array (), array $metadata = array ()) { |
|
| 764 | + /** |
|
| 765 | + * This is the constructor |
|
| 766 | + * |
|
| 767 | + * @access public |
|
| 768 | + * |
|
| 769 | + * @param array $elements: Array of documents initially setting up the list |
|
| 770 | + * @param array $metadata: Array of initial metadata |
|
| 771 | + * |
|
| 772 | + * @return void |
|
| 773 | + */ |
|
| 774 | + public function __construct(array $elements = array (), array $metadata = array ()) { |
|
| 775 | 775 | |
| 776 | - if (empty($elements) && empty($metadata)) { |
|
| 776 | + if (empty($elements) && empty($metadata)) { |
|
| 777 | 777 | |
| 778 | - // Let's check the user's session. |
|
| 779 | - $sessionData = tx_dlf_helper::loadFromSession(get_class($this)); |
|
| 778 | + // Let's check the user's session. |
|
| 779 | + $sessionData = tx_dlf_helper::loadFromSession(get_class($this)); |
|
| 780 | 780 | |
| 781 | - // Restore list from session data. |
|
| 782 | - if (is_array($sessionData)) { |
|
| 781 | + // Restore list from session data. |
|
| 782 | + if (is_array($sessionData)) { |
|
| 783 | 783 | |
| 784 | - if (is_array($sessionData[0])) { |
|
| 784 | + if (is_array($sessionData[0])) { |
|
| 785 | 785 | |
| 786 | - $this->elements = $sessionData[0]; |
|
| 786 | + $this->elements = $sessionData[0]; |
|
| 787 | 787 | |
| 788 | - } |
|
| 788 | + } |
|
| 789 | 789 | |
| 790 | - if (is_array($sessionData[1])) { |
|
| 790 | + if (is_array($sessionData[1])) { |
|
| 791 | 791 | |
| 792 | - $this->metadata = $sessionData[1]; |
|
| 792 | + $this->metadata = $sessionData[1]; |
|
| 793 | 793 | |
| 794 | - } |
|
| 794 | + } |
|
| 795 | 795 | |
| 796 | - } |
|
| 796 | + } |
|
| 797 | 797 | |
| 798 | - } else { |
|
| 798 | + } else { |
|
| 799 | 799 | |
| 800 | - // Add metadata to the list. |
|
| 801 | - $this->metadata = $metadata; |
|
| 800 | + // Add metadata to the list. |
|
| 801 | + $this->metadata = $metadata; |
|
| 802 | 802 | |
| 803 | - // Add initial set of elements to the list. |
|
| 804 | - $this->elements = $elements; |
|
| 803 | + // Add initial set of elements to the list. |
|
| 804 | + $this->elements = $elements; |
|
| 805 | 805 | |
| 806 | - } |
|
| 806 | + } |
|
| 807 | 807 | |
| 808 | - $this->count = count($this->elements); |
|
| 808 | + $this->count = count($this->elements); |
|
| 809 | 809 | |
| 810 | - } |
|
| 810 | + } |
|
| 811 | 811 | |
| 812 | - /** |
|
| 813 | - * This magic method is invoked each time a clone is called on the object variable |
|
| 814 | - * (This method is defined as private/protected because singleton objects should not be cloned) |
|
| 815 | - * |
|
| 816 | - * @access protected |
|
| 817 | - * |
|
| 818 | - * @return void |
|
| 819 | - */ |
|
| 820 | - protected function __clone() {} |
|
| 812 | + /** |
|
| 813 | + * This magic method is invoked each time a clone is called on the object variable |
|
| 814 | + * (This method is defined as private/protected because singleton objects should not be cloned) |
|
| 815 | + * |
|
| 816 | + * @access protected |
|
| 817 | + * |
|
| 818 | + * @return void |
|
| 819 | + */ |
|
| 820 | + protected function __clone() {} |
|
| 821 | 821 | |
| 822 | - /** |
|
| 823 | - * This magic method is called each time an invisible property is referenced from the object |
|
| 824 | - * |
|
| 825 | - * @access public |
|
| 826 | - * |
|
| 827 | - * @param string $var: Name of variable to get |
|
| 828 | - * |
|
| 829 | - * @return mixed Value of $this->$var |
|
| 830 | - */ |
|
| 831 | - public function __get($var) { |
|
| 822 | + /** |
|
| 823 | + * This magic method is called each time an invisible property is referenced from the object |
|
| 824 | + * |
|
| 825 | + * @access public |
|
| 826 | + * |
|
| 827 | + * @param string $var: Name of variable to get |
|
| 828 | + * |
|
| 829 | + * @return mixed Value of $this->$var |
|
| 830 | + */ |
|
| 831 | + public function __get($var) { |
|
| 832 | 832 | |
| 833 | - $method = '_get'.ucfirst($var); |
|
| 833 | + $method = '_get'.ucfirst($var); |
|
| 834 | 834 | |
| 835 | - if (!property_exists($this, $var) || !method_exists($this, $method)) { |
|
| 835 | + if (!property_exists($this, $var) || !method_exists($this, $method)) { |
|
| 836 | 836 | |
| 837 | - if (TYPO3_DLOG) { |
|
| 837 | + if (TYPO3_DLOG) { |
|
| 838 | 838 | |
| 839 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_list->__get('.$var.')] There is no getter function for property "'.$var.'"', $this->extKey, SYSLOG_SEVERITY_WARNING); |
|
| 839 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_list->__get('.$var.')] There is no getter function for property "'.$var.'"', $this->extKey, SYSLOG_SEVERITY_WARNING); |
|
| 840 | 840 | |
| 841 | - } |
|
| 841 | + } |
|
| 842 | 842 | |
| 843 | - return; |
|
| 843 | + return; |
|
| 844 | 844 | |
| 845 | - } else { |
|
| 845 | + } else { |
|
| 846 | 846 | |
| 847 | - return $this->$method(); |
|
| 847 | + return $this->$method(); |
|
| 848 | 848 | |
| 849 | - } |
|
| 849 | + } |
|
| 850 | 850 | |
| 851 | - } |
|
| 851 | + } |
|
| 852 | 852 | |
| 853 | - /** |
|
| 854 | - * This magic method is called each time an invisible property is referenced from the object |
|
| 855 | - * |
|
| 856 | - * @access public |
|
| 857 | - * |
|
| 858 | - * @param string $var: Name of variable to set |
|
| 859 | - * @param mixed $value: New value of variable |
|
| 860 | - * |
|
| 861 | - * @return void |
|
| 862 | - */ |
|
| 863 | - public function __set($var, $value) { |
|
| 853 | + /** |
|
| 854 | + * This magic method is called each time an invisible property is referenced from the object |
|
| 855 | + * |
|
| 856 | + * @access public |
|
| 857 | + * |
|
| 858 | + * @param string $var: Name of variable to set |
|
| 859 | + * @param mixed $value: New value of variable |
|
| 860 | + * |
|
| 861 | + * @return void |
|
| 862 | + */ |
|
| 863 | + public function __set($var, $value) { |
|
| 864 | 864 | |
| 865 | - $method = '_set'.ucfirst($var); |
|
| 865 | + $method = '_set'.ucfirst($var); |
|
| 866 | 866 | |
| 867 | - if (!property_exists($this, $var) || !method_exists($this, $method)) { |
|
| 867 | + if (!property_exists($this, $var) || !method_exists($this, $method)) { |
|
| 868 | 868 | |
| 869 | - if (TYPO3_DLOG) { |
|
| 869 | + if (TYPO3_DLOG) { |
|
| 870 | 870 | |
| 871 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_list->__set('.$var.', [data])] There is no setter function for property "'.$var.'"', $this->extKey, SYSLOG_SEVERITY_WARNING, $value); |
|
| 871 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_list->__set('.$var.', [data])] There is no setter function for property "'.$var.'"', $this->extKey, SYSLOG_SEVERITY_WARNING, $value); |
|
| 872 | 872 | |
| 873 | - } |
|
| 873 | + } |
|
| 874 | 874 | |
| 875 | - } else { |
|
| 875 | + } else { |
|
| 876 | 876 | |
| 877 | - $this->$method($value); |
|
| 877 | + $this->$method($value); |
|
| 878 | 878 | |
| 879 | - } |
|
| 879 | + } |
|
| 880 | 880 | |
| 881 | - } |
|
| 881 | + } |
|
| 882 | 882 | |
| 883 | - /** |
|
| 884 | - * This magic method is executed prior to any serialization of the object |
|
| 885 | - * @see __wakeup() |
|
| 886 | - * |
|
| 887 | - * @access public |
|
| 888 | - * |
|
| 889 | - * @return array Properties to be serialized |
|
| 890 | - */ |
|
| 891 | - public function __sleep() { |
|
| 883 | + /** |
|
| 884 | + * This magic method is executed prior to any serialization of the object |
|
| 885 | + * @see __wakeup() |
|
| 886 | + * |
|
| 887 | + * @access public |
|
| 888 | + * |
|
| 889 | + * @return array Properties to be serialized |
|
| 890 | + */ |
|
| 891 | + public function __sleep() { |
|
| 892 | 892 | |
| 893 | - return array ('elements', 'metadata'); |
|
| 893 | + return array ('elements', 'metadata'); |
|
| 894 | 894 | |
| 895 | - } |
|
| 895 | + } |
|
| 896 | 896 | |
| 897 | - /** |
|
| 898 | - * This magic method is executed after the object is deserialized |
|
| 899 | - * @see __sleep() |
|
| 900 | - * |
|
| 901 | - * @access public |
|
| 902 | - * |
|
| 903 | - * @return void |
|
| 904 | - */ |
|
| 905 | - public function __wakeup() { |
|
| 897 | + /** |
|
| 898 | + * This magic method is executed after the object is deserialized |
|
| 899 | + * @see __sleep() |
|
| 900 | + * |
|
| 901 | + * @access public |
|
| 902 | + * |
|
| 903 | + * @return void |
|
| 904 | + */ |
|
| 905 | + public function __wakeup() { |
|
| 906 | 906 | |
| 907 | - $this->count = count($this->elements); |
|
| 907 | + $this->count = count($this->elements); |
|
| 908 | 908 | |
| 909 | - } |
|
| 909 | + } |
|
| 910 | 910 | |
| 911 | 911 | } |
@@ -20,320 +20,320 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | abstract class tx_dlf_plugin extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin { |
| 22 | 22 | |
| 23 | - public $extKey = 'dlf'; |
|
| 23 | + public $extKey = 'dlf'; |
|
| 24 | 24 | |
| 25 | - public $prefixId = 'tx_dlf'; |
|
| 25 | + public $prefixId = 'tx_dlf'; |
|
| 26 | 26 | |
| 27 | - public $scriptRelPath = 'common/class.tx_dlf_plugin.php'; |
|
| 27 | + public $scriptRelPath = 'common/class.tx_dlf_plugin.php'; |
|
| 28 | 28 | |
| 29 | - // Plugins are cached by default (@see setCache()). |
|
| 30 | - public $pi_USER_INT_obj = FALSE; |
|
| 29 | + // Plugins are cached by default (@see setCache()). |
|
| 30 | + public $pi_USER_INT_obj = FALSE; |
|
| 31 | 31 | |
| 32 | - public $pi_checkCHash = TRUE; |
|
| 32 | + public $pi_checkCHash = TRUE; |
|
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * This holds the current document |
|
| 36 | - * |
|
| 37 | - * @var tx_dlf_document |
|
| 38 | - * @access protected |
|
| 39 | - */ |
|
| 40 | - protected $doc; |
|
| 34 | + /** |
|
| 35 | + * This holds the current document |
|
| 36 | + * |
|
| 37 | + * @var tx_dlf_document |
|
| 38 | + * @access protected |
|
| 39 | + */ |
|
| 40 | + protected $doc; |
|
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * This holds the plugin's parsed template |
|
| 44 | - * |
|
| 45 | - * @var string |
|
| 46 | - * @access protected |
|
| 47 | - */ |
|
| 48 | - protected $template = ''; |
|
| 42 | + /** |
|
| 43 | + * This holds the plugin's parsed template |
|
| 44 | + * |
|
| 45 | + * @var string |
|
| 46 | + * @access protected |
|
| 47 | + */ |
|
| 48 | + protected $template = ''; |
|
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * All the needed configuration values are stored in class variables |
|
| 52 | - * Priority: Flexforms > TS-Templates > Extension Configuration > ext_localconf.php |
|
| 53 | - * |
|
| 54 | - * @access protected |
|
| 55 | - * |
|
| 56 | - * @param array $conf: configuration array from TS-Template |
|
| 57 | - * |
|
| 58 | - * @return void |
|
| 59 | - */ |
|
| 60 | - protected function init(array $conf) { |
|
| 50 | + /** |
|
| 51 | + * All the needed configuration values are stored in class variables |
|
| 52 | + * Priority: Flexforms > TS-Templates > Extension Configuration > ext_localconf.php |
|
| 53 | + * |
|
| 54 | + * @access protected |
|
| 55 | + * |
|
| 56 | + * @param array $conf: configuration array from TS-Template |
|
| 57 | + * |
|
| 58 | + * @return void |
|
| 59 | + */ |
|
| 60 | + protected function init(array $conf) { |
|
| 61 | 61 | |
| 62 | - // Read FlexForm configuration. |
|
| 63 | - $flexFormConf = array (); |
|
| 62 | + // Read FlexForm configuration. |
|
| 63 | + $flexFormConf = array (); |
|
| 64 | 64 | |
| 65 | - $this->cObj->readFlexformIntoConf($this->cObj->data['pi_flexform'], $flexFormConf); |
|
| 65 | + $this->cObj->readFlexformIntoConf($this->cObj->data['pi_flexform'], $flexFormConf); |
|
| 66 | 66 | |
| 67 | - if (!empty($flexFormConf)) { |
|
| 67 | + if (!empty($flexFormConf)) { |
|
| 68 | 68 | |
| 69 | - $conf = tx_dlf_helper::array_merge_recursive_overrule($flexFormConf, $conf); |
|
| 69 | + $conf = tx_dlf_helper::array_merge_recursive_overrule($flexFormConf, $conf); |
|
| 70 | 70 | |
| 71 | - } |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | - // Read plugin TS configuration. |
|
| 74 | - $pluginConf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][get_class($this).'.']; |
|
| 73 | + // Read plugin TS configuration. |
|
| 74 | + $pluginConf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][get_class($this).'.']; |
|
| 75 | 75 | |
| 76 | - if (is_array($pluginConf)) { |
|
| 76 | + if (is_array($pluginConf)) { |
|
| 77 | 77 | |
| 78 | - $conf = tx_dlf_helper::array_merge_recursive_overrule($pluginConf, $conf); |
|
| 78 | + $conf = tx_dlf_helper::array_merge_recursive_overrule($pluginConf, $conf); |
|
| 79 | 79 | |
| 80 | - } |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | - // Read general TS configuration. |
|
| 83 | - $generalConf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][$this->prefixId.'.']; |
|
| 82 | + // Read general TS configuration. |
|
| 83 | + $generalConf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][$this->prefixId.'.']; |
|
| 84 | 84 | |
| 85 | - if (is_array($generalConf)) { |
|
| 85 | + if (is_array($generalConf)) { |
|
| 86 | 86 | |
| 87 | - $conf = tx_dlf_helper::array_merge_recursive_overrule($generalConf, $conf); |
|
| 87 | + $conf = tx_dlf_helper::array_merge_recursive_overrule($generalConf, $conf); |
|
| 88 | 88 | |
| 89 | - } |
|
| 89 | + } |
|
| 90 | 90 | |
| 91 | - // Read extension configuration. |
|
| 92 | - $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$this->extKey]); |
|
| 91 | + // Read extension configuration. |
|
| 92 | + $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$this->extKey]); |
|
| 93 | 93 | |
| 94 | - if (is_array($extConf)) { |
|
| 94 | + if (is_array($extConf)) { |
|
| 95 | 95 | |
| 96 | - $conf = tx_dlf_helper::array_merge_recursive_overrule($extConf, $conf); |
|
| 96 | + $conf = tx_dlf_helper::array_merge_recursive_overrule($extConf, $conf); |
|
| 97 | 97 | |
| 98 | - } |
|
| 98 | + } |
|
| 99 | 99 | |
| 100 | - // Read TYPO3_CONF_VARS configuration. |
|
| 101 | - $varsConf = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey]; |
|
| 100 | + // Read TYPO3_CONF_VARS configuration. |
|
| 101 | + $varsConf = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey]; |
|
| 102 | 102 | |
| 103 | - if (is_array($varsConf)) { |
|
| 103 | + if (is_array($varsConf)) { |
|
| 104 | 104 | |
| 105 | - $conf = tx_dlf_helper::array_merge_recursive_overrule($varsConf, $conf); |
|
| 105 | + $conf = tx_dlf_helper::array_merge_recursive_overrule($varsConf, $conf); |
|
| 106 | 106 | |
| 107 | - } |
|
| 107 | + } |
|
| 108 | 108 | |
| 109 | - $this->conf = $conf; |
|
| 109 | + $this->conf = $conf; |
|
| 110 | 110 | |
| 111 | - // Set default plugin variables. |
|
| 112 | - $this->pi_setPiVarDefaults(); |
|
| 111 | + // Set default plugin variables. |
|
| 112 | + $this->pi_setPiVarDefaults(); |
|
| 113 | 113 | |
| 114 | - // Load translation files. |
|
| 115 | - $this->pi_loadLL(); |
|
| 114 | + // Load translation files. |
|
| 115 | + $this->pi_loadLL(); |
|
| 116 | 116 | |
| 117 | - } |
|
| 117 | + } |
|
| 118 | 118 | |
| 119 | - /** |
|
| 120 | - * Loads the current document into $this->doc |
|
| 121 | - * |
|
| 122 | - * @access protected |
|
| 123 | - * |
|
| 124 | - * @return void |
|
| 125 | - */ |
|
| 126 | - protected function loadDocument() { |
|
| 119 | + /** |
|
| 120 | + * Loads the current document into $this->doc |
|
| 121 | + * |
|
| 122 | + * @access protected |
|
| 123 | + * |
|
| 124 | + * @return void |
|
| 125 | + */ |
|
| 126 | + protected function loadDocument() { |
|
| 127 | 127 | |
| 128 | - // Check for required variable. |
|
| 129 | - if (!empty($this->piVars['id']) && !empty($this->conf['pages'])) { |
|
| 128 | + // Check for required variable. |
|
| 129 | + if (!empty($this->piVars['id']) && !empty($this->conf['pages'])) { |
|
| 130 | 130 | |
| 131 | - // Should we exclude documents from other pages than $this->conf['pages']? |
|
| 132 | - $pid = (!empty($this->conf['excludeOther']) ? intval($this->conf['pages']) : 0); |
|
| 131 | + // Should we exclude documents from other pages than $this->conf['pages']? |
|
| 132 | + $pid = (!empty($this->conf['excludeOther']) ? intval($this->conf['pages']) : 0); |
|
| 133 | 133 | |
| 134 | - // Get instance of tx_dlf_document. |
|
| 135 | - $this->doc =& tx_dlf_document::getInstance($this->piVars['id'], $pid); |
|
| 134 | + // Get instance of tx_dlf_document. |
|
| 135 | + $this->doc =& tx_dlf_document::getInstance($this->piVars['id'], $pid); |
|
| 136 | 136 | |
| 137 | - if (!$this->doc->ready) { |
|
| 137 | + if (!$this->doc->ready) { |
|
| 138 | 138 | |
| 139 | - // Destroy the incomplete object. |
|
| 140 | - $this->doc = NULL; |
|
| 139 | + // Destroy the incomplete object. |
|
| 140 | + $this->doc = NULL; |
|
| 141 | 141 | |
| 142 | - if (TYPO3_DLOG) { |
|
| 142 | + if (TYPO3_DLOG) { |
|
| 143 | 143 | |
| 144 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_plugin->loadDocument()] Failed to load document with UID "'.$this->piVars['id'].'"', $this->extKey, SYSLOG_SEVERITY_ERROR); |
|
| 144 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_plugin->loadDocument()] Failed to load document with UID "'.$this->piVars['id'].'"', $this->extKey, SYSLOG_SEVERITY_ERROR); |
|
| 145 | 145 | |
| 146 | - } |
|
| 146 | + } |
|
| 147 | 147 | |
| 148 | - } else { |
|
| 148 | + } else { |
|
| 149 | 149 | |
| 150 | - // Set configuration PID. |
|
| 151 | - $this->doc->cPid = $this->conf['pages']; |
|
| 150 | + // Set configuration PID. |
|
| 151 | + $this->doc->cPid = $this->conf['pages']; |
|
| 152 | 152 | |
| 153 | - } |
|
| 153 | + } |
|
| 154 | 154 | |
| 155 | - } elseif (!empty($this->piVars['recordId'])) { |
|
| 155 | + } elseif (!empty($this->piVars['recordId'])) { |
|
| 156 | 156 | |
| 157 | - // Get UID of document with given record identifier. |
|
| 158 | - $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 159 | - 'tx_dlf_documents.uid', |
|
| 160 | - 'tx_dlf_documents', |
|
| 161 | - 'tx_dlf_documents.record_id='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->piVars['recordId'], 'tx_dlf_documents').tx_dlf_helper::whereClause('tx_dlf_documents'), |
|
| 162 | - '', |
|
| 163 | - '', |
|
| 164 | - '1' |
|
| 165 | - ); |
|
| 157 | + // Get UID of document with given record identifier. |
|
| 158 | + $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 159 | + 'tx_dlf_documents.uid', |
|
| 160 | + 'tx_dlf_documents', |
|
| 161 | + 'tx_dlf_documents.record_id='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->piVars['recordId'], 'tx_dlf_documents').tx_dlf_helper::whereClause('tx_dlf_documents'), |
|
| 162 | + '', |
|
| 163 | + '', |
|
| 164 | + '1' |
|
| 165 | + ); |
|
| 166 | 166 | |
| 167 | - if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) == 1) { |
|
| 167 | + if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) == 1) { |
|
| 168 | 168 | |
| 169 | - list ($this->piVars['id']) = $GLOBALS['TYPO3_DB']->sql_fetch_row($result); |
|
| 169 | + list ($this->piVars['id']) = $GLOBALS['TYPO3_DB']->sql_fetch_row($result); |
|
| 170 | 170 | |
| 171 | - // Set superglobal $_GET array. |
|
| 172 | - $_GET[$this->prefixId]['id'] = $this->piVars['id']; |
|
| 171 | + // Set superglobal $_GET array. |
|
| 172 | + $_GET[$this->prefixId]['id'] = $this->piVars['id']; |
|
| 173 | 173 | |
| 174 | - // Unset variable to avoid infinite looping. |
|
| 175 | - unset ($this->piVars['recordId'], $_GET[$this->prefixId]['recordId']); |
|
| 174 | + // Unset variable to avoid infinite looping. |
|
| 175 | + unset ($this->piVars['recordId'], $_GET[$this->prefixId]['recordId']); |
|
| 176 | 176 | |
| 177 | - // Try to load document. |
|
| 178 | - $this->loadDocument(); |
|
| 177 | + // Try to load document. |
|
| 178 | + $this->loadDocument(); |
|
| 179 | 179 | |
| 180 | - } else { |
|
| 180 | + } else { |
|
| 181 | 181 | |
| 182 | - if (TYPO3_DLOG) { |
|
| 182 | + if (TYPO3_DLOG) { |
|
| 183 | 183 | |
| 184 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_plugin->loadDocument()] Failed to load document with record ID "'.$this->piVars['recordId'].'"', $this->extKey, SYSLOG_SEVERITY_ERROR); |
|
| 184 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_plugin->loadDocument()] Failed to load document with record ID "'.$this->piVars['recordId'].'"', $this->extKey, SYSLOG_SEVERITY_ERROR); |
|
| 185 | 185 | |
| 186 | - } |
|
| 186 | + } |
|
| 187 | 187 | |
| 188 | - } |
|
| 188 | + } |
|
| 189 | 189 | |
| 190 | - } else { |
|
| 190 | + } else { |
|
| 191 | 191 | |
| 192 | - if (TYPO3_DLOG) { |
|
| 192 | + if (TYPO3_DLOG) { |
|
| 193 | 193 | |
| 194 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_plugin->loadDocument()] Invalid UID "'.$this->piVars['id'].'" or PID "'.$this->conf['pages'].'" for document loading', $this->extKey, SYSLOG_SEVERITY_ERROR); |
|
| 194 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_plugin->loadDocument()] Invalid UID "'.$this->piVars['id'].'" or PID "'.$this->conf['pages'].'" for document loading', $this->extKey, SYSLOG_SEVERITY_ERROR); |
|
| 195 | 195 | |
| 196 | - } |
|
| 196 | + } |
|
| 197 | 197 | |
| 198 | - } |
|
| 198 | + } |
|
| 199 | 199 | |
| 200 | - } |
|
| 200 | + } |
|
| 201 | 201 | |
| 202 | - /** |
|
| 203 | - * The main method of the PlugIn |
|
| 204 | - * |
|
| 205 | - * @access public |
|
| 206 | - * |
|
| 207 | - * @param string $content: The PlugIn content |
|
| 208 | - * @param array $conf: The PlugIn configuration |
|
| 209 | - * |
|
| 210 | - * @abstract |
|
| 211 | - * |
|
| 212 | - * @return string The content that is displayed on the website |
|
| 213 | - */ |
|
| 214 | - abstract public function main($content, $conf); |
|
| 202 | + /** |
|
| 203 | + * The main method of the PlugIn |
|
| 204 | + * |
|
| 205 | + * @access public |
|
| 206 | + * |
|
| 207 | + * @param string $content: The PlugIn content |
|
| 208 | + * @param array $conf: The PlugIn configuration |
|
| 209 | + * |
|
| 210 | + * @abstract |
|
| 211 | + * |
|
| 212 | + * @return string The content that is displayed on the website |
|
| 213 | + */ |
|
| 214 | + abstract public function main($content, $conf); |
|
| 215 | 215 | |
| 216 | - /** |
|
| 217 | - * Sets default plugin variables from Typoscript |
|
| 218 | - * (stdWrap backport from TYPO3 6.2) |
|
| 219 | - * @see http://forge.typo3.org/issues/22045 |
|
| 220 | - * |
|
| 221 | - * @access public |
|
| 222 | - * |
|
| 223 | - * @return void |
|
| 224 | - */ |
|
| 225 | - public function pi_setPiVarDefaults() { |
|
| 216 | + /** |
|
| 217 | + * Sets default plugin variables from Typoscript |
|
| 218 | + * (stdWrap backport from TYPO3 6.2) |
|
| 219 | + * @see http://forge.typo3.org/issues/22045 |
|
| 220 | + * |
|
| 221 | + * @access public |
|
| 222 | + * |
|
| 223 | + * @return void |
|
| 224 | + */ |
|
| 225 | + public function pi_setPiVarDefaults() { |
|
| 226 | 226 | |
| 227 | - if (is_array($this->conf['_DEFAULT_PI_VARS.'])) { |
|
| 227 | + if (is_array($this->conf['_DEFAULT_PI_VARS.'])) { |
|
| 228 | 228 | |
| 229 | - foreach ($this->conf['_DEFAULT_PI_VARS.'] as $GPkey => $GPval) { |
|
| 229 | + foreach ($this->conf['_DEFAULT_PI_VARS.'] as $GPkey => $GPval) { |
|
| 230 | 230 | |
| 231 | - if (strpos($GPkey,'.')) { |
|
| 231 | + if (strpos($GPkey,'.')) { |
|
| 232 | 232 | |
| 233 | - $GPkey = substr($GPkey, 0, -1); |
|
| 233 | + $GPkey = substr($GPkey, 0, -1); |
|
| 234 | 234 | |
| 235 | - } |
|
| 235 | + } |
|
| 236 | 236 | |
| 237 | - if (is_array($this->conf['_DEFAULT_PI_VARS.'][$GPkey.'.']['stdWrap.'])) { |
|
| 237 | + if (is_array($this->conf['_DEFAULT_PI_VARS.'][$GPkey.'.']['stdWrap.'])) { |
|
| 238 | 238 | |
| 239 | - $GPval = $GPval ? $GPval : ''; |
|
| 239 | + $GPval = $GPval ? $GPval : ''; |
|
| 240 | 240 | |
| 241 | - $this->conf['_DEFAULT_PI_VARS.'][$GPkey] = $this->cObj->stdWrap($GPval, $this->conf['_DEFAULT_PI_VARS.'][$GPkey.'.']['stdWrap.']); |
|
| 241 | + $this->conf['_DEFAULT_PI_VARS.'][$GPkey] = $this->cObj->stdWrap($GPval, $this->conf['_DEFAULT_PI_VARS.'][$GPkey.'.']['stdWrap.']); |
|
| 242 | 242 | |
| 243 | - unset ($this->conf['_DEFAULT_PI_VARS.'][$GPkey.'.']['stdWrap.']); |
|
| 243 | + unset ($this->conf['_DEFAULT_PI_VARS.'][$GPkey.'.']['stdWrap.']); |
|
| 244 | 244 | |
| 245 | - } |
|
| 245 | + } |
|
| 246 | 246 | |
| 247 | - } |
|
| 247 | + } |
|
| 248 | 248 | |
| 249 | - $this->piVars = tx_dlf_helper::array_merge_recursive_overrule($this->conf['_DEFAULT_PI_VARS.'], is_array($this->piVars) ? $this->piVars : array()); |
|
| 249 | + $this->piVars = tx_dlf_helper::array_merge_recursive_overrule($this->conf['_DEFAULT_PI_VARS.'], is_array($this->piVars) ? $this->piVars : array()); |
|
| 250 | 250 | |
| 251 | - } |
|
| 251 | + } |
|
| 252 | 252 | |
| 253 | - } |
|
| 253 | + } |
|
| 254 | 254 | |
| 255 | - /** |
|
| 256 | - * Wraps the input string in a tag with the class attribute set to the class name |
|
| 257 | - * |
|
| 258 | - * @access public |
|
| 259 | - * |
|
| 260 | - * @param string $content: HTML content to wrap in the div-tags with the "main class" of the plugin |
|
| 261 | - * |
|
| 262 | - * @return string HTML content wrapped, ready to return to the parent object. |
|
| 263 | - */ |
|
| 264 | - public function pi_wrapInBaseClass($content) { |
|
| 255 | + /** |
|
| 256 | + * Wraps the input string in a tag with the class attribute set to the class name |
|
| 257 | + * |
|
| 258 | + * @access public |
|
| 259 | + * |
|
| 260 | + * @param string $content: HTML content to wrap in the div-tags with the "main class" of the plugin |
|
| 261 | + * |
|
| 262 | + * @return string HTML content wrapped, ready to return to the parent object. |
|
| 263 | + */ |
|
| 264 | + public function pi_wrapInBaseClass($content) { |
|
| 265 | 265 | |
| 266 | - if (!$GLOBALS['TSFE']->config['config']['disableWrapInBaseClass']) { |
|
| 267 | - // Use get_class($this) instead of $this->prefixId for content wrapping because $this->prefixId is the same for all plugins. |
|
| 268 | - $content = '<div class="'.str_replace('_', '-', get_class($this)).'">'.$content.'</div>'; |
|
| 266 | + if (!$GLOBALS['TSFE']->config['config']['disableWrapInBaseClass']) { |
|
| 267 | + // Use get_class($this) instead of $this->prefixId for content wrapping because $this->prefixId is the same for all plugins. |
|
| 268 | + $content = '<div class="'.str_replace('_', '-', get_class($this)).'">'.$content.'</div>'; |
|
| 269 | 269 | |
| 270 | - if (!$GLOBALS['TSFE']->config['config']['disablePrefixComment']) { |
|
| 270 | + if (!$GLOBALS['TSFE']->config['config']['disablePrefixComment']) { |
|
| 271 | 271 | |
| 272 | - $content = "\n\n<!-- BEGIN: Content of extension '".$this->extKey."', plugin '".get_class($this)."' -->\n\n".$content."\n\n<!-- END: Content of extension '".$this->extKey."', plugin '".get_class($this)."' -->\n\n"; |
|
| 272 | + $content = "\n\n<!-- BEGIN: Content of extension '".$this->extKey."', plugin '".get_class($this)."' -->\n\n".$content."\n\n<!-- END: Content of extension '".$this->extKey."', plugin '".get_class($this)."' -->\n\n"; |
|
| 273 | 273 | |
| 274 | - } |
|
| 275 | - } |
|
| 274 | + } |
|
| 275 | + } |
|
| 276 | 276 | |
| 277 | - return $content; |
|
| 277 | + return $content; |
|
| 278 | 278 | |
| 279 | - } |
|
| 279 | + } |
|
| 280 | 280 | |
| 281 | - /** |
|
| 282 | - * Parses a string into a Typoscript array |
|
| 283 | - * |
|
| 284 | - * @access protected |
|
| 285 | - * |
|
| 286 | - * @param string $string: The string to parse |
|
| 287 | - * |
|
| 288 | - * @return array The resulting typoscript array |
|
| 289 | - */ |
|
| 290 | - protected function parseTS($string = '') { |
|
| 281 | + /** |
|
| 282 | + * Parses a string into a Typoscript array |
|
| 283 | + * |
|
| 284 | + * @access protected |
|
| 285 | + * |
|
| 286 | + * @param string $string: The string to parse |
|
| 287 | + * |
|
| 288 | + * @return array The resulting typoscript array |
|
| 289 | + */ |
|
| 290 | + protected function parseTS($string = '') { |
|
| 291 | 291 | |
| 292 | - $parser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\Parser\\TypoScriptParser'); |
|
| 292 | + $parser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\Parser\\TypoScriptParser'); |
|
| 293 | 293 | |
| 294 | - $parser->parse($string); |
|
| 294 | + $parser->parse($string); |
|
| 295 | 295 | |
| 296 | - return $parser->setup; |
|
| 296 | + return $parser->setup; |
|
| 297 | 297 | |
| 298 | - } |
|
| 298 | + } |
|
| 299 | 299 | |
| 300 | - /** |
|
| 301 | - * Sets some configuration variables if the plugin is cached. |
|
| 302 | - * |
|
| 303 | - * @access protected |
|
| 304 | - * |
|
| 305 | - * @param boolean $cache: Should the plugin be cached? |
|
| 306 | - * |
|
| 307 | - * @return void |
|
| 308 | - */ |
|
| 309 | - protected function setCache($cache = TRUE) { |
|
| 300 | + /** |
|
| 301 | + * Sets some configuration variables if the plugin is cached. |
|
| 302 | + * |
|
| 303 | + * @access protected |
|
| 304 | + * |
|
| 305 | + * @param boolean $cache: Should the plugin be cached? |
|
| 306 | + * |
|
| 307 | + * @return void |
|
| 308 | + */ |
|
| 309 | + protected function setCache($cache = TRUE) { |
|
| 310 | 310 | |
| 311 | - if ($cache) { |
|
| 311 | + if ($cache) { |
|
| 312 | 312 | |
| 313 | - // Set cObject type to "USER" (default). |
|
| 314 | - $this->pi_USER_INT_obj = FALSE; |
|
| 313 | + // Set cObject type to "USER" (default). |
|
| 314 | + $this->pi_USER_INT_obj = FALSE; |
|
| 315 | 315 | |
| 316 | - $this->pi_checkCHash = TRUE; |
|
| 316 | + $this->pi_checkCHash = TRUE; |
|
| 317 | 317 | |
| 318 | - if (count($this->piVars)) { |
|
| 318 | + if (count($this->piVars)) { |
|
| 319 | 319 | |
| 320 | - // Check cHash or disable caching. |
|
| 321 | - $GLOBALS['TSFE']->reqCHash(); |
|
| 320 | + // Check cHash or disable caching. |
|
| 321 | + $GLOBALS['TSFE']->reqCHash(); |
|
| 322 | 322 | |
| 323 | - } |
|
| 323 | + } |
|
| 324 | 324 | |
| 325 | - } else { |
|
| 325 | + } else { |
|
| 326 | 326 | |
| 327 | - // Set cObject type to "USER_INT". |
|
| 328 | - $this->pi_USER_INT_obj = TRUE; |
|
| 327 | + // Set cObject type to "USER_INT". |
|
| 328 | + $this->pi_USER_INT_obj = TRUE; |
|
| 329 | 329 | |
| 330 | - $this->pi_checkCHash = FALSE; |
|
| 330 | + $this->pi_checkCHash = FALSE; |
|
| 331 | 331 | |
| 332 | - // Plugins are of type "USER" by default, so convert it to "USER_INT". |
|
| 333 | - $this->cObj->convertToUserIntObject(); |
|
| 332 | + // Plugins are of type "USER" by default, so convert it to "USER_INT". |
|
| 333 | + $this->cObj->convertToUserIntObject(); |
|
| 334 | 334 | |
| 335 | - } |
|
| 335 | + } |
|
| 336 | 336 | |
| 337 | - } |
|
| 337 | + } |
|
| 338 | 338 | |
| 339 | 339 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $pid = (!empty($this->conf['excludeOther']) ? intval($this->conf['pages']) : 0); |
| 133 | 133 | |
| 134 | 134 | // Get instance of tx_dlf_document. |
| 135 | - $this->doc =& tx_dlf_document::getInstance($this->piVars['id'], $pid); |
|
| 135 | + $this->doc = & tx_dlf_document::getInstance($this->piVars['id'], $pid); |
|
| 136 | 136 | |
| 137 | 137 | if (!$this->doc->ready) { |
| 138 | 138 | |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | |
| 229 | 229 | foreach ($this->conf['_DEFAULT_PI_VARS.'] as $GPkey => $GPval) { |
| 230 | 230 | |
| 231 | - if (strpos($GPkey,'.')) { |
|
| 231 | + if (strpos($GPkey, '.')) { |
|
| 232 | 232 | |
| 233 | 233 | $GPkey = substr($GPkey, 0, -1); |
| 234 | 234 | |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | - $this->piVars = tx_dlf_helper::array_merge_recursive_overrule($this->conf['_DEFAULT_PI_VARS.'], is_array($this->piVars) ? $this->piVars : array()); |
|
| 249 | + $this->piVars = tx_dlf_helper::array_merge_recursive_overrule($this->conf['_DEFAULT_PI_VARS.'], is_array($this->piVars) ? $this->piVars : array ()); |
|
| 250 | 250 | |
| 251 | 251 | } |
| 252 | 252 | |
@@ -19,860 +19,860 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | class tx_dlf_indexing { |
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * The extension key |
|
| 24 | - * |
|
| 25 | - * @var string |
|
| 26 | - * @access public |
|
| 27 | - */ |
|
| 28 | - public static $extKey = 'dlf'; |
|
| 29 | - |
|
| 30 | - /** |
|
| 31 | - * Array of metadata fields' configuration |
|
| 32 | - * @see loadIndexConf() |
|
| 33 | - * |
|
| 34 | - * @var array |
|
| 35 | - * @access protected |
|
| 36 | - */ |
|
| 37 | - protected static $fields = array ( |
|
| 38 | - 'autocomplete' => array (), |
|
| 39 | - 'facets' => array (), |
|
| 40 | - 'sortables' => array (), |
|
| 41 | - 'indexed' => array (), |
|
| 42 | - 'stored' => array (), |
|
| 43 | - 'tokenized' => array (), |
|
| 44 | - 'fieldboost' => array () |
|
| 45 | - ); |
|
| 22 | + /** |
|
| 23 | + * The extension key |
|
| 24 | + * |
|
| 25 | + * @var string |
|
| 26 | + * @access public |
|
| 27 | + */ |
|
| 28 | + public static $extKey = 'dlf'; |
|
| 29 | + |
|
| 30 | + /** |
|
| 31 | + * Array of metadata fields' configuration |
|
| 32 | + * @see loadIndexConf() |
|
| 33 | + * |
|
| 34 | + * @var array |
|
| 35 | + * @access protected |
|
| 36 | + */ |
|
| 37 | + protected static $fields = array ( |
|
| 38 | + 'autocomplete' => array (), |
|
| 39 | + 'facets' => array (), |
|
| 40 | + 'sortables' => array (), |
|
| 41 | + 'indexed' => array (), |
|
| 42 | + 'stored' => array (), |
|
| 43 | + 'tokenized' => array (), |
|
| 44 | + 'fieldboost' => array () |
|
| 45 | + ); |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * Is the index configuration loaded? |
|
| 49 | - * @see $fields |
|
| 50 | - * |
|
| 51 | - * @var boolean |
|
| 52 | - * @access protected |
|
| 53 | - */ |
|
| 54 | - protected static $fieldsLoaded = FALSE; |
|
| 47 | + /** |
|
| 48 | + * Is the index configuration loaded? |
|
| 49 | + * @see $fields |
|
| 50 | + * |
|
| 51 | + * @var boolean |
|
| 52 | + * @access protected |
|
| 53 | + */ |
|
| 54 | + protected static $fieldsLoaded = FALSE; |
|
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * List of already processed documents |
|
| 58 | - * |
|
| 59 | - * @var array |
|
| 60 | - * @access protected |
|
| 61 | - */ |
|
| 62 | - protected static $processedDocs = array (); |
|
| 56 | + /** |
|
| 57 | + * List of already processed documents |
|
| 58 | + * |
|
| 59 | + * @var array |
|
| 60 | + * @access protected |
|
| 61 | + */ |
|
| 62 | + protected static $processedDocs = array (); |
|
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * Instance of Apache_Solr_Service class |
|
| 66 | - * |
|
| 67 | - * @var Apache_Solr_Service |
|
| 68 | - * @access protected |
|
| 69 | - */ |
|
| 70 | - protected static $solr; |
|
| 64 | + /** |
|
| 65 | + * Instance of Apache_Solr_Service class |
|
| 66 | + * |
|
| 67 | + * @var Apache_Solr_Service |
|
| 68 | + * @access protected |
|
| 69 | + */ |
|
| 70 | + protected static $solr; |
|
| 71 | 71 | |
| 72 | - /** |
|
| 73 | - * Array of toplevel structure elements |
|
| 74 | - * @see loadIndexConf() |
|
| 75 | - * |
|
| 76 | - * @var array |
|
| 77 | - * @access protected |
|
| 78 | - */ |
|
| 79 | - protected static $toplevel = array (); |
|
| 72 | + /** |
|
| 73 | + * Array of toplevel structure elements |
|
| 74 | + * @see loadIndexConf() |
|
| 75 | + * |
|
| 76 | + * @var array |
|
| 77 | + * @access protected |
|
| 78 | + */ |
|
| 79 | + protected static $toplevel = array (); |
|
| 80 | 80 | |
| 81 | - /** |
|
| 82 | - * Insert given document into Solr index |
|
| 83 | - * |
|
| 84 | - * @access public |
|
| 85 | - * |
|
| 86 | - * @param tx_dlf_document &$doc: The document to add |
|
| 87 | - * @param integer $core: UID of the Solr core to use |
|
| 88 | - * |
|
| 89 | - * @return integer 0 on success or 1 on failure |
|
| 90 | - */ |
|
| 91 | - public static function add(tx_dlf_document &$doc, $core = 0) { |
|
| 81 | + /** |
|
| 82 | + * Insert given document into Solr index |
|
| 83 | + * |
|
| 84 | + * @access public |
|
| 85 | + * |
|
| 86 | + * @param tx_dlf_document &$doc: The document to add |
|
| 87 | + * @param integer $core: UID of the Solr core to use |
|
| 88 | + * |
|
| 89 | + * @return integer 0 on success or 1 on failure |
|
| 90 | + */ |
|
| 91 | + public static function add(tx_dlf_document &$doc, $core = 0) { |
|
| 92 | 92 | |
| 93 | - if (in_array($doc->uid, self::$processedDocs)) { |
|
| 93 | + if (in_array($doc->uid, self::$processedDocs)) { |
|
| 94 | 94 | |
| 95 | - return 0; |
|
| 95 | + return 0; |
|
| 96 | 96 | |
| 97 | - } elseif (self::solrConnect($core, $doc->pid)) { |
|
| 97 | + } elseif (self::solrConnect($core, $doc->pid)) { |
|
| 98 | 98 | |
| 99 | - $errors = 0; |
|
| 99 | + $errors = 0; |
|
| 100 | 100 | |
| 101 | - // Handle multi-volume documents. |
|
| 102 | - if ($doc->parentId) { |
|
| 101 | + // Handle multi-volume documents. |
|
| 102 | + if ($doc->parentId) { |
|
| 103 | 103 | |
| 104 | - $parent =& tx_dlf_document::getInstance($doc->parentId, 0, TRUE); |
|
| 104 | + $parent =& tx_dlf_document::getInstance($doc->parentId, 0, TRUE); |
|
| 105 | 105 | |
| 106 | - if ($parent->ready) { |
|
| 106 | + if ($parent->ready) { |
|
| 107 | 107 | |
| 108 | - $errors = self::add($parent, $core); |
|
| 108 | + $errors = self::add($parent, $core); |
|
| 109 | 109 | |
| 110 | - } else { |
|
| 110 | + } else { |
|
| 111 | 111 | |
| 112 | - if (TYPO3_DLOG) { |
|
| 112 | + if (TYPO3_DLOG) { |
|
| 113 | 113 | |
| 114 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->add(['.$doc->uid.'], '.$core.')] Could not load parent document with UID "'.$doc->parentId.'"', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 114 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->add(['.$doc->uid.'], '.$core.')] Could not load parent document with UID "'.$doc->parentId.'"', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 115 | 115 | |
| 116 | - } |
|
| 116 | + } |
|
| 117 | 117 | |
| 118 | - return 1; |
|
| 118 | + return 1; |
|
| 119 | 119 | |
| 120 | - } |
|
| 120 | + } |
|
| 121 | 121 | |
| 122 | - } |
|
| 122 | + } |
|
| 123 | 123 | |
| 124 | - try { |
|
| 124 | + try { |
|
| 125 | 125 | |
| 126 | - // Add document to list of processed documents. |
|
| 127 | - self::$processedDocs[] = $doc->uid; |
|
| 126 | + // Add document to list of processed documents. |
|
| 127 | + self::$processedDocs[] = $doc->uid; |
|
| 128 | 128 | |
| 129 | - // Delete old Solr documents. |
|
| 130 | - self::$solr->service->deleteByQuery('uid:'.$doc->uid); |
|
| 129 | + // Delete old Solr documents. |
|
| 130 | + self::$solr->service->deleteByQuery('uid:'.$doc->uid); |
|
| 131 | 131 | |
| 132 | - // Index every logical unit as separate Solr document. |
|
| 133 | - foreach ($doc->tableOfContents as $logicalUnit) { |
|
| 132 | + // Index every logical unit as separate Solr document. |
|
| 133 | + foreach ($doc->tableOfContents as $logicalUnit) { |
|
| 134 | 134 | |
| 135 | - if (!$errors) { |
|
| 135 | + if (!$errors) { |
|
| 136 | 136 | |
| 137 | - $errors = self::processLogical($doc, $logicalUnit); |
|
| 137 | + $errors = self::processLogical($doc, $logicalUnit); |
|
| 138 | 138 | |
| 139 | - } else { |
|
| 139 | + } else { |
|
| 140 | 140 | |
| 141 | - break; |
|
| 141 | + break; |
|
| 142 | 142 | |
| 143 | - } |
|
| 143 | + } |
|
| 144 | 144 | |
| 145 | - } |
|
| 145 | + } |
|
| 146 | 146 | |
| 147 | - // Index fulltext files if available. |
|
| 148 | - if ($doc->hasFulltext) { |
|
| 147 | + // Index fulltext files if available. |
|
| 148 | + if ($doc->hasFulltext) { |
|
| 149 | 149 | |
| 150 | - foreach ($doc->physicalStructure as $pageNumber => $xmlId) { |
|
| 150 | + foreach ($doc->physicalStructure as $pageNumber => $xmlId) { |
|
| 151 | 151 | |
| 152 | - if (!$errors) { |
|
| 152 | + if (!$errors) { |
|
| 153 | 153 | |
| 154 | - $errors = self::processPhysical($doc, $pageNumber, $doc->physicalStructureInfo[$xmlId]); |
|
| 154 | + $errors = self::processPhysical($doc, $pageNumber, $doc->physicalStructureInfo[$xmlId]); |
|
| 155 | 155 | |
| 156 | - } else { |
|
| 156 | + } else { |
|
| 157 | 157 | |
| 158 | - break; |
|
| 158 | + break; |
|
| 159 | 159 | |
| 160 | - } |
|
| 160 | + } |
|
| 161 | 161 | |
| 162 | - } |
|
| 162 | + } |
|
| 163 | 163 | |
| 164 | - } |
|
| 164 | + } |
|
| 165 | 165 | |
| 166 | - self::$solr->service->commit(); |
|
| 166 | + self::$solr->service->commit(); |
|
| 167 | 167 | |
| 168 | - // Get document title from database. |
|
| 169 | - $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 170 | - 'tx_dlf_documents.title AS title', |
|
| 171 | - 'tx_dlf_documents', |
|
| 172 | - 'tx_dlf_documents.uid='.intval($doc->uid).tx_dlf_helper::whereClause('tx_dlf_documents'), |
|
| 173 | - '', |
|
| 174 | - '', |
|
| 175 | - '1' |
|
| 176 | - ); |
|
| 168 | + // Get document title from database. |
|
| 169 | + $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 170 | + 'tx_dlf_documents.title AS title', |
|
| 171 | + 'tx_dlf_documents', |
|
| 172 | + 'tx_dlf_documents.uid='.intval($doc->uid).tx_dlf_helper::whereClause('tx_dlf_documents'), |
|
| 173 | + '', |
|
| 174 | + '', |
|
| 175 | + '1' |
|
| 176 | + ); |
|
| 177 | 177 | |
| 178 | - $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result); |
|
| 178 | + $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result); |
|
| 179 | 179 | |
| 180 | - if (!defined('TYPO3_cliMode')) { |
|
| 180 | + if (!defined('TYPO3_cliMode')) { |
|
| 181 | 181 | |
| 182 | - if (!$errors) { |
|
| 182 | + if (!$errors) { |
|
| 183 | 183 | |
| 184 | - $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 185 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 186 | - htmlspecialchars(sprintf(tx_dlf_helper::getLL('flash.documentIndexed'), $resArray['title'], $doc->uid)), |
|
| 187 | - tx_dlf_helper::getLL('flash.done', TRUE), |
|
| 188 | - \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 189 | - TRUE |
|
| 190 | - ); |
|
| 184 | + $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 185 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 186 | + htmlspecialchars(sprintf(tx_dlf_helper::getLL('flash.documentIndexed'), $resArray['title'], $doc->uid)), |
|
| 187 | + tx_dlf_helper::getLL('flash.done', TRUE), |
|
| 188 | + \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 189 | + TRUE |
|
| 190 | + ); |
|
| 191 | 191 | |
| 192 | - } else { |
|
| 192 | + } else { |
|
| 193 | 193 | |
| 194 | - $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 195 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 196 | - htmlspecialchars(sprintf(tx_dlf_helper::getLL('flash.documentNotIndexed'), $resArray['title'], $doc->uid)), |
|
| 197 | - tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 198 | - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 199 | - TRUE |
|
| 200 | - ); |
|
| 194 | + $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 195 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 196 | + htmlspecialchars(sprintf(tx_dlf_helper::getLL('flash.documentNotIndexed'), $resArray['title'], $doc->uid)), |
|
| 197 | + tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 198 | + \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 199 | + TRUE |
|
| 200 | + ); |
|
| 201 | 201 | |
| 202 | - } |
|
| 202 | + } |
|
| 203 | 203 | |
| 204 | - tx_dlf_helper::addMessage($message); |
|
| 204 | + tx_dlf_helper::addMessage($message); |
|
| 205 | 205 | |
| 206 | - } |
|
| 206 | + } |
|
| 207 | 207 | |
| 208 | - return $errors; |
|
| 208 | + return $errors; |
|
| 209 | 209 | |
| 210 | - } catch (Exception $e) { |
|
| 210 | + } catch (Exception $e) { |
|
| 211 | 211 | |
| 212 | - if (!defined('TYPO3_cliMode')) { |
|
| 212 | + if (!defined('TYPO3_cliMode')) { |
|
| 213 | 213 | |
| 214 | - $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 215 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 216 | - tx_dlf_helper::getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
|
| 217 | - tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 218 | - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 219 | - TRUE |
|
| 220 | - ); |
|
| 214 | + $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 215 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 216 | + tx_dlf_helper::getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
|
| 217 | + tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 218 | + \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 219 | + TRUE |
|
| 220 | + ); |
|
| 221 | 221 | |
| 222 | - tx_dlf_helper::addMessage($message); |
|
| 222 | + tx_dlf_helper::addMessage($message); |
|
| 223 | 223 | |
| 224 | - } |
|
| 224 | + } |
|
| 225 | 225 | |
| 226 | - if (TYPO3_DLOG) { |
|
| 226 | + if (TYPO3_DLOG) { |
|
| 227 | 227 | |
| 228 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->add(['.$doc->uid.'], '.$core.')] Apache Solr threw exception: "'.$e->getMessage().'"', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 228 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->add(['.$doc->uid.'], '.$core.')] Apache Solr threw exception: "'.$e->getMessage().'"', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 229 | 229 | |
| 230 | - } |
|
| 230 | + } |
|
| 231 | 231 | |
| 232 | - return 1; |
|
| 232 | + return 1; |
|
| 233 | 233 | |
| 234 | - } |
|
| 234 | + } |
|
| 235 | 235 | |
| 236 | - } else { |
|
| 236 | + } else { |
|
| 237 | 237 | |
| 238 | - if (!defined('TYPO3_cliMode')) { |
|
| 238 | + if (!defined('TYPO3_cliMode')) { |
|
| 239 | 239 | |
| 240 | - $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 241 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 242 | - tx_dlf_helper::getLL('flash.solrNoConnection', TRUE), |
|
| 243 | - tx_dlf_helper::getLL('flash.warning', TRUE), |
|
| 244 | - \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING, |
|
| 245 | - TRUE |
|
| 246 | - ); |
|
| 240 | + $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 241 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 242 | + tx_dlf_helper::getLL('flash.solrNoConnection', TRUE), |
|
| 243 | + tx_dlf_helper::getLL('flash.warning', TRUE), |
|
| 244 | + \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING, |
|
| 245 | + TRUE |
|
| 246 | + ); |
|
| 247 | 247 | |
| 248 | - tx_dlf_helper::addMessage($message); |
|
| 248 | + tx_dlf_helper::addMessage($message); |
|
| 249 | 249 | |
| 250 | - } |
|
| 250 | + } |
|
| 251 | 251 | |
| 252 | - if (TYPO3_DLOG) { |
|
| 252 | + if (TYPO3_DLOG) { |
|
| 253 | 253 | |
| 254 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->add(['.$doc->uid.'], '.$core.')] Could not connect to Apache Solr server', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 254 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->add(['.$doc->uid.'], '.$core.')] Could not connect to Apache Solr server', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 255 | 255 | |
| 256 | - } |
|
| 256 | + } |
|
| 257 | 257 | |
| 258 | - return 1; |
|
| 258 | + return 1; |
|
| 259 | 259 | |
| 260 | - } |
|
| 260 | + } |
|
| 261 | 261 | |
| 262 | - } |
|
| 262 | + } |
|
| 263 | 263 | |
| 264 | - /** |
|
| 265 | - * Delete document from Solr index |
|
| 266 | - * |
|
| 267 | - * @access public |
|
| 268 | - * |
|
| 269 | - * @param integer $uid: UID of the document to delete |
|
| 270 | - * |
|
| 271 | - * @return integer 0 on success or 1 on failure |
|
| 272 | - */ |
|
| 273 | - public static function delete($uid) { |
|
| 264 | + /** |
|
| 265 | + * Delete document from Solr index |
|
| 266 | + * |
|
| 267 | + * @access public |
|
| 268 | + * |
|
| 269 | + * @param integer $uid: UID of the document to delete |
|
| 270 | + * |
|
| 271 | + * @return integer 0 on success or 1 on failure |
|
| 272 | + */ |
|
| 273 | + public static function delete($uid) { |
|
| 274 | 274 | |
| 275 | - // Save parameter for logging purposes. |
|
| 276 | - $_uid = $uid; |
|
| 275 | + // Save parameter for logging purposes. |
|
| 276 | + $_uid = $uid; |
|
| 277 | 277 | |
| 278 | - // Sanitize input. |
|
| 279 | - $uid = max(intval($uid), 0); |
|
| 278 | + // Sanitize input. |
|
| 279 | + $uid = max(intval($uid), 0); |
|
| 280 | 280 | |
| 281 | - // Get Solr core for document. |
|
| 282 | - $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 283 | - 'tx_dlf_solrcores.uid AS uid,tx_dlf_documents.title AS title', |
|
| 284 | - 'tx_dlf_solrcores,tx_dlf_documents', |
|
| 285 | - 'tx_dlf_solrcores.uid=tx_dlf_documents.solrcore AND tx_dlf_documents.uid='.$uid.tx_dlf_helper::whereClause('tx_dlf_solrcores'), |
|
| 286 | - '', |
|
| 287 | - '', |
|
| 288 | - '1' |
|
| 289 | - ); |
|
| 281 | + // Get Solr core for document. |
|
| 282 | + $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 283 | + 'tx_dlf_solrcores.uid AS uid,tx_dlf_documents.title AS title', |
|
| 284 | + 'tx_dlf_solrcores,tx_dlf_documents', |
|
| 285 | + 'tx_dlf_solrcores.uid=tx_dlf_documents.solrcore AND tx_dlf_documents.uid='.$uid.tx_dlf_helper::whereClause('tx_dlf_solrcores'), |
|
| 286 | + '', |
|
| 287 | + '', |
|
| 288 | + '1' |
|
| 289 | + ); |
|
| 290 | 290 | |
| 291 | - if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) { |
|
| 291 | + if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) { |
|
| 292 | 292 | |
| 293 | - list ($core, $title) = $GLOBALS['TYPO3_DB']->sql_fetch_row($result); |
|
| 293 | + list ($core, $title) = $GLOBALS['TYPO3_DB']->sql_fetch_row($result); |
|
| 294 | 294 | |
| 295 | - // Establish Solr connection. |
|
| 296 | - if (self::solrConnect($core)) { |
|
| 295 | + // Establish Solr connection. |
|
| 296 | + if (self::solrConnect($core)) { |
|
| 297 | 297 | |
| 298 | - try { |
|
| 298 | + try { |
|
| 299 | 299 | |
| 300 | - // Delete Solr document. |
|
| 301 | - self::$solr->service->deleteByQuery('uid:'.$uid); |
|
| 300 | + // Delete Solr document. |
|
| 301 | + self::$solr->service->deleteByQuery('uid:'.$uid); |
|
| 302 | 302 | |
| 303 | - self::$solr->service->commit(); |
|
| 303 | + self::$solr->service->commit(); |
|
| 304 | 304 | |
| 305 | - } catch (Exception $e) { |
|
| 305 | + } catch (Exception $e) { |
|
| 306 | 306 | |
| 307 | - if (!defined('TYPO3_cliMode')) { |
|
| 307 | + if (!defined('TYPO3_cliMode')) { |
|
| 308 | 308 | |
| 309 | - $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 310 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 311 | - tx_dlf_helper::getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
|
| 312 | - tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 313 | - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 314 | - TRUE |
|
| 315 | - ); |
|
| 309 | + $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 310 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 311 | + tx_dlf_helper::getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
|
| 312 | + tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 313 | + \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 314 | + TRUE |
|
| 315 | + ); |
|
| 316 | 316 | |
| 317 | - tx_dlf_helper::addMessage($message); |
|
| 317 | + tx_dlf_helper::addMessage($message); |
|
| 318 | 318 | |
| 319 | - } |
|
| 319 | + } |
|
| 320 | 320 | |
| 321 | - if (TYPO3_DLOG) { |
|
| 321 | + if (TYPO3_DLOG) { |
|
| 322 | 322 | |
| 323 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->delete('.$_uid.')] Apache Solr threw exception: "'.$e->getMessage().'"', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 323 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->delete('.$_uid.')] Apache Solr threw exception: "'.$e->getMessage().'"', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 324 | 324 | |
| 325 | - } |
|
| 325 | + } |
|
| 326 | 326 | |
| 327 | - return 1; |
|
| 327 | + return 1; |
|
| 328 | 328 | |
| 329 | - } |
|
| 329 | + } |
|
| 330 | 330 | |
| 331 | - } else { |
|
| 331 | + } else { |
|
| 332 | 332 | |
| 333 | - if (!defined('TYPO3_cliMode')) { |
|
| 333 | + if (!defined('TYPO3_cliMode')) { |
|
| 334 | 334 | |
| 335 | - $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 336 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 337 | - tx_dlf_helper::getLL('flash.solrNoConnection', TRUE), |
|
| 338 | - tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 339 | - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 340 | - TRUE |
|
| 341 | - ); |
|
| 335 | + $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 336 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 337 | + tx_dlf_helper::getLL('flash.solrNoConnection', TRUE), |
|
| 338 | + tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 339 | + \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 340 | + TRUE |
|
| 341 | + ); |
|
| 342 | 342 | |
| 343 | - tx_dlf_helper::addMessage($message); |
|
| 343 | + tx_dlf_helper::addMessage($message); |
|
| 344 | 344 | |
| 345 | - } |
|
| 345 | + } |
|
| 346 | 346 | |
| 347 | - if (TYPO3_DLOG) { |
|
| 347 | + if (TYPO3_DLOG) { |
|
| 348 | 348 | |
| 349 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->delete('.$_uid.')] Could not connect to Apache Solr server', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 349 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->delete('.$_uid.')] Could not connect to Apache Solr server', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 350 | 350 | |
| 351 | - } |
|
| 351 | + } |
|
| 352 | 352 | |
| 353 | - return 1; |
|
| 353 | + return 1; |
|
| 354 | 354 | |
| 355 | - } |
|
| 355 | + } |
|
| 356 | 356 | |
| 357 | - if (!defined('TYPO3_cliMode')) { |
|
| 357 | + if (!defined('TYPO3_cliMode')) { |
|
| 358 | 358 | |
| 359 | - $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 360 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 361 | - htmlspecialchars(sprintf(tx_dlf_helper::getLL('flash.documentDeleted'), $title, $uid)), |
|
| 362 | - tx_dlf_helper::getLL('flash.done', TRUE), |
|
| 363 | - \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 364 | - TRUE |
|
| 365 | - ); |
|
| 359 | + $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 360 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 361 | + htmlspecialchars(sprintf(tx_dlf_helper::getLL('flash.documentDeleted'), $title, $uid)), |
|
| 362 | + tx_dlf_helper::getLL('flash.done', TRUE), |
|
| 363 | + \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 364 | + TRUE |
|
| 365 | + ); |
|
| 366 | 366 | |
| 367 | - tx_dlf_helper::addMessage($message); |
|
| 367 | + tx_dlf_helper::addMessage($message); |
|
| 368 | 368 | |
| 369 | - } |
|
| 369 | + } |
|
| 370 | 370 | |
| 371 | - return 0; |
|
| 371 | + return 0; |
|
| 372 | 372 | |
| 373 | - } else { |
|
| 373 | + } else { |
|
| 374 | 374 | |
| 375 | - if (TYPO3_DLOG) { |
|
| 375 | + if (TYPO3_DLOG) { |
|
| 376 | 376 | |
| 377 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->delete('.$_uid.')] Invalid UID "'.$uid.'" for document deletion', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 377 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->delete('.$_uid.')] Invalid UID "'.$uid.'" for document deletion', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 378 | 378 | |
| 379 | - } |
|
| 379 | + } |
|
| 380 | 380 | |
| 381 | - return 1; |
|
| 381 | + return 1; |
|
| 382 | 382 | |
| 383 | - } |
|
| 383 | + } |
|
| 384 | 384 | |
| 385 | - } |
|
| 385 | + } |
|
| 386 | 386 | |
| 387 | - /** |
|
| 388 | - * Returns the dynamic index field name for the given metadata field. |
|
| 389 | - * |
|
| 390 | - * @access public |
|
| 391 | - * |
|
| 392 | - * @param string $index_name: The metadata field's name in database |
|
| 393 | - * @param integer $pid: UID of the configuration page |
|
| 394 | - * |
|
| 395 | - * @return string The field's dynamic index name |
|
| 396 | - */ |
|
| 397 | - public static function getIndexFieldName($index_name, $pid = 0) { |
|
| 387 | + /** |
|
| 388 | + * Returns the dynamic index field name for the given metadata field. |
|
| 389 | + * |
|
| 390 | + * @access public |
|
| 391 | + * |
|
| 392 | + * @param string $index_name: The metadata field's name in database |
|
| 393 | + * @param integer $pid: UID of the configuration page |
|
| 394 | + * |
|
| 395 | + * @return string The field's dynamic index name |
|
| 396 | + */ |
|
| 397 | + public static function getIndexFieldName($index_name, $pid = 0) { |
|
| 398 | 398 | |
| 399 | - // Save parameter for logging purposes. |
|
| 400 | - $_pid = $pid; |
|
| 399 | + // Save parameter for logging purposes. |
|
| 400 | + $_pid = $pid; |
|
| 401 | 401 | |
| 402 | - // Sanitize input. |
|
| 403 | - $pid = max(intval($pid), 0); |
|
| 402 | + // Sanitize input. |
|
| 403 | + $pid = max(intval($pid), 0); |
|
| 404 | 404 | |
| 405 | - if (!$pid) { |
|
| 405 | + if (!$pid) { |
|
| 406 | 406 | |
| 407 | - if (TYPO3_DLOG) { |
|
| 407 | + if (TYPO3_DLOG) { |
|
| 408 | 408 | |
| 409 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->getIndexFieldName('.$index_name.', '.$_pid.')] Invalid PID "'.$pid.'" for metadata configuration', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 409 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->getIndexFieldName('.$index_name.', '.$_pid.')] Invalid PID "'.$pid.'" for metadata configuration', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 410 | 410 | |
| 411 | - } |
|
| 411 | + } |
|
| 412 | 412 | |
| 413 | - return ''; |
|
| 413 | + return ''; |
|
| 414 | 414 | |
| 415 | - } |
|
| 415 | + } |
|
| 416 | 416 | |
| 417 | - // Load metadata configuration. |
|
| 418 | - self::loadIndexConf($pid); |
|
| 417 | + // Load metadata configuration. |
|
| 418 | + self::loadIndexConf($pid); |
|
| 419 | 419 | |
| 420 | - // Build field's suffix. |
|
| 421 | - $suffix = (in_array($index_name, self::$fields['tokenized']) ? 't' : 'u'); |
|
| 420 | + // Build field's suffix. |
|
| 421 | + $suffix = (in_array($index_name, self::$fields['tokenized']) ? 't' : 'u'); |
|
| 422 | 422 | |
| 423 | - $suffix .= (in_array($index_name, self::$fields['stored']) ? 's' : 'u'); |
|
| 423 | + $suffix .= (in_array($index_name, self::$fields['stored']) ? 's' : 'u'); |
|
| 424 | 424 | |
| 425 | - $suffix .= (in_array($index_name, self::$fields['indexed']) ? 'i' : 'u'); |
|
| 425 | + $suffix .= (in_array($index_name, self::$fields['indexed']) ? 'i' : 'u'); |
|
| 426 | 426 | |
| 427 | - $index_name .= '_'.$suffix; |
|
| 427 | + $index_name .= '_'.$suffix; |
|
| 428 | 428 | |
| 429 | - return $index_name; |
|
| 429 | + return $index_name; |
|
| 430 | 430 | |
| 431 | - } |
|
| 431 | + } |
|
| 432 | 432 | |
| 433 | - /** |
|
| 434 | - * Load indexing configuration |
|
| 435 | - * |
|
| 436 | - * @access protected |
|
| 437 | - * |
|
| 438 | - * @param integer $pid: The configuration page's UID |
|
| 439 | - * |
|
| 440 | - * @return void |
|
| 441 | - */ |
|
| 442 | - protected static function loadIndexConf($pid) { |
|
| 433 | + /** |
|
| 434 | + * Load indexing configuration |
|
| 435 | + * |
|
| 436 | + * @access protected |
|
| 437 | + * |
|
| 438 | + * @param integer $pid: The configuration page's UID |
|
| 439 | + * |
|
| 440 | + * @return void |
|
| 441 | + */ |
|
| 442 | + protected static function loadIndexConf($pid) { |
|
| 443 | 443 | |
| 444 | - if (!self::$fieldsLoaded) { |
|
| 444 | + if (!self::$fieldsLoaded) { |
|
| 445 | 445 | |
| 446 | - // Get the list of toplevel structures. |
|
| 447 | - $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 448 | - 'tx_dlf_structures.index_name AS index_name', |
|
| 449 | - 'tx_dlf_structures', |
|
| 450 | - 'tx_dlf_structures.toplevel=1 AND tx_dlf_structures.pid='.intval($pid).tx_dlf_helper::whereClause('tx_dlf_structures'), |
|
| 451 | - '', |
|
| 452 | - '', |
|
| 453 | - '' |
|
| 454 | - ); |
|
| 446 | + // Get the list of toplevel structures. |
|
| 447 | + $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 448 | + 'tx_dlf_structures.index_name AS index_name', |
|
| 449 | + 'tx_dlf_structures', |
|
| 450 | + 'tx_dlf_structures.toplevel=1 AND tx_dlf_structures.pid='.intval($pid).tx_dlf_helper::whereClause('tx_dlf_structures'), |
|
| 451 | + '', |
|
| 452 | + '', |
|
| 453 | + '' |
|
| 454 | + ); |
|
| 455 | 455 | |
| 456 | - while ($toplevel = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
|
| 456 | + while ($toplevel = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
|
| 457 | 457 | |
| 458 | - self::$toplevel[] = $toplevel['index_name']; |
|
| 458 | + self::$toplevel[] = $toplevel['index_name']; |
|
| 459 | 459 | |
| 460 | - } |
|
| 460 | + } |
|
| 461 | 461 | |
| 462 | - // Get the metadata indexing options. |
|
| 463 | - $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 464 | - 'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.index_tokenized AS index_tokenized,tx_dlf_metadata.index_stored AS index_stored,tx_dlf_metadata.index_indexed AS index_indexed,tx_dlf_metadata.is_sortable AS is_sortable,tx_dlf_metadata.is_facet AS is_facet,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.index_autocomplete AS index_autocomplete,tx_dlf_metadata.index_boost AS index_boost', |
|
| 465 | - 'tx_dlf_metadata', |
|
| 466 | - 'tx_dlf_metadata.pid='.intval($pid).tx_dlf_helper::whereClause('tx_dlf_metadata'), |
|
| 467 | - '', |
|
| 468 | - '', |
|
| 469 | - '' |
|
| 470 | - ); |
|
| 462 | + // Get the metadata indexing options. |
|
| 463 | + $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 464 | + 'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.index_tokenized AS index_tokenized,tx_dlf_metadata.index_stored AS index_stored,tx_dlf_metadata.index_indexed AS index_indexed,tx_dlf_metadata.is_sortable AS is_sortable,tx_dlf_metadata.is_facet AS is_facet,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.index_autocomplete AS index_autocomplete,tx_dlf_metadata.index_boost AS index_boost', |
|
| 465 | + 'tx_dlf_metadata', |
|
| 466 | + 'tx_dlf_metadata.pid='.intval($pid).tx_dlf_helper::whereClause('tx_dlf_metadata'), |
|
| 467 | + '', |
|
| 468 | + '', |
|
| 469 | + '' |
|
| 470 | + ); |
|
| 471 | 471 | |
| 472 | - while ($indexing = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
|
| 472 | + while ($indexing = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
|
| 473 | 473 | |
| 474 | - if ($indexing['index_tokenized']) { |
|
| 474 | + if ($indexing['index_tokenized']) { |
|
| 475 | 475 | |
| 476 | - self::$fields['tokenized'][] = $indexing['index_name']; |
|
| 476 | + self::$fields['tokenized'][] = $indexing['index_name']; |
|
| 477 | 477 | |
| 478 | - } |
|
| 478 | + } |
|
| 479 | 479 | |
| 480 | - if ($indexing['index_stored'] || $indexing['is_listed']) { |
|
| 480 | + if ($indexing['index_stored'] || $indexing['is_listed']) { |
|
| 481 | 481 | |
| 482 | - self::$fields['stored'][] = $indexing['index_name']; |
|
| 482 | + self::$fields['stored'][] = $indexing['index_name']; |
|
| 483 | 483 | |
| 484 | - } |
|
| 484 | + } |
|
| 485 | 485 | |
| 486 | - if ($indexing['index_indexed'] || $indexing['index_autocomplete']) { |
|
| 486 | + if ($indexing['index_indexed'] || $indexing['index_autocomplete']) { |
|
| 487 | 487 | |
| 488 | - self::$fields['indexed'][] = $indexing['index_name']; |
|
| 488 | + self::$fields['indexed'][] = $indexing['index_name']; |
|
| 489 | 489 | |
| 490 | - } |
|
| 490 | + } |
|
| 491 | 491 | |
| 492 | - if ($indexing['is_sortable']) { |
|
| 492 | + if ($indexing['is_sortable']) { |
|
| 493 | 493 | |
| 494 | - self::$fields['sortables'][] = $indexing['index_name']; |
|
| 494 | + self::$fields['sortables'][] = $indexing['index_name']; |
|
| 495 | 495 | |
| 496 | - } |
|
| 496 | + } |
|
| 497 | 497 | |
| 498 | - if ($indexing['is_facet']) { |
|
| 498 | + if ($indexing['is_facet']) { |
|
| 499 | 499 | |
| 500 | - self::$fields['facets'][] = $indexing['index_name']; |
|
| 500 | + self::$fields['facets'][] = $indexing['index_name']; |
|
| 501 | 501 | |
| 502 | - } |
|
| 502 | + } |
|
| 503 | 503 | |
| 504 | - if ($indexing['index_autocomplete']) { |
|
| 504 | + if ($indexing['index_autocomplete']) { |
|
| 505 | 505 | |
| 506 | - self::$fields['autocomplete'][] = $indexing['index_name']; |
|
| 506 | + self::$fields['autocomplete'][] = $indexing['index_name']; |
|
| 507 | 507 | |
| 508 | - } |
|
| 508 | + } |
|
| 509 | 509 | |
| 510 | - if ($indexing['index_boost'] > 0.0) { |
|
| 510 | + if ($indexing['index_boost'] > 0.0) { |
|
| 511 | 511 | |
| 512 | - self::$fields['fieldboost'][$indexing['index_name']] = floatval($indexing['index_boost']); |
|
| 512 | + self::$fields['fieldboost'][$indexing['index_name']] = floatval($indexing['index_boost']); |
|
| 513 | 513 | |
| 514 | - } else { |
|
| 514 | + } else { |
|
| 515 | 515 | |
| 516 | - self::$fields['fieldboost'][$indexing['index_name']] = FALSE; |
|
| 516 | + self::$fields['fieldboost'][$indexing['index_name']] = FALSE; |
|
| 517 | 517 | |
| 518 | - } |
|
| 518 | + } |
|
| 519 | 519 | |
| 520 | - } |
|
| 520 | + } |
|
| 521 | 521 | |
| 522 | - self::$fieldsLoaded = TRUE; |
|
| 522 | + self::$fieldsLoaded = TRUE; |
|
| 523 | 523 | |
| 524 | - } |
|
| 524 | + } |
|
| 525 | 525 | |
| 526 | - } |
|
| 526 | + } |
|
| 527 | 527 | |
| 528 | - /** |
|
| 529 | - * Processes a logical unit (and its children) for the Solr index |
|
| 530 | - * |
|
| 531 | - * @access protected |
|
| 532 | - * |
|
| 533 | - * @param tx_dlf_document &$doc: The METS document |
|
| 534 | - * @param array $logicalUnit: Array of the logical unit to process |
|
| 535 | - * |
|
| 536 | - * @return integer 0 on success or 1 on failure |
|
| 537 | - */ |
|
| 538 | - protected static function processLogical(tx_dlf_document &$doc, array $logicalUnit) { |
|
| 528 | + /** |
|
| 529 | + * Processes a logical unit (and its children) for the Solr index |
|
| 530 | + * |
|
| 531 | + * @access protected |
|
| 532 | + * |
|
| 533 | + * @param tx_dlf_document &$doc: The METS document |
|
| 534 | + * @param array $logicalUnit: Array of the logical unit to process |
|
| 535 | + * |
|
| 536 | + * @return integer 0 on success or 1 on failure |
|
| 537 | + */ |
|
| 538 | + protected static function processLogical(tx_dlf_document &$doc, array $logicalUnit) { |
|
| 539 | 539 | |
| 540 | - $errors = 0; |
|
| 540 | + $errors = 0; |
|
| 541 | 541 | |
| 542 | - // Get metadata for logical unit. |
|
| 543 | - $metadata = $doc->metadataArray[$logicalUnit['id']]; |
|
| 542 | + // Get metadata for logical unit. |
|
| 543 | + $metadata = $doc->metadataArray[$logicalUnit['id']]; |
|
| 544 | 544 | |
| 545 | - if (!empty($metadata)) { |
|
| 545 | + if (!empty($metadata)) { |
|
| 546 | 546 | |
| 547 | - // Load class. |
|
| 548 | - if (!class_exists('Apache_Solr_Document')) { |
|
| 547 | + // Load class. |
|
| 548 | + if (!class_exists('Apache_Solr_Document')) { |
|
| 549 | 549 | |
| 550 | - require_once(\TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName('EXT:'.self::$extKey.'/lib/SolrPhpClient/Apache/Solr/Document.php')); |
|
| 550 | + require_once(\TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName('EXT:'.self::$extKey.'/lib/SolrPhpClient/Apache/Solr/Document.php')); |
|
| 551 | 551 | |
| 552 | - } |
|
| 552 | + } |
|
| 553 | 553 | |
| 554 | - // Create new Solr document. |
|
| 555 | - $solrDoc = new Apache_Solr_Document(); |
|
| 554 | + // Create new Solr document. |
|
| 555 | + $solrDoc = new Apache_Solr_Document(); |
|
| 556 | 556 | |
| 557 | - // Create unique identifier from document's UID and unit's XML ID. |
|
| 558 | - $solrDoc->setField('id', $doc->uid.$logicalUnit['id']); |
|
| 557 | + // Create unique identifier from document's UID and unit's XML ID. |
|
| 558 | + $solrDoc->setField('id', $doc->uid.$logicalUnit['id']); |
|
| 559 | 559 | |
| 560 | - $solrDoc->setField('uid', $doc->uid); |
|
| 560 | + $solrDoc->setField('uid', $doc->uid); |
|
| 561 | 561 | |
| 562 | - $solrDoc->setField('pid', $doc->pid); |
|
| 562 | + $solrDoc->setField('pid', $doc->pid); |
|
| 563 | 563 | |
| 564 | - if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($logicalUnit['points'])) { |
|
| 564 | + if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($logicalUnit['points'])) { |
|
| 565 | 565 | |
| 566 | - $solrDoc->setField('page', $logicalUnit['points']); |
|
| 566 | + $solrDoc->setField('page', $logicalUnit['points']); |
|
| 567 | 567 | |
| 568 | - } |
|
| 568 | + } |
|
| 569 | 569 | |
| 570 | - if ($logicalUnit['id'] == $doc->toplevelId) { |
|
| 570 | + if ($logicalUnit['id'] == $doc->toplevelId) { |
|
| 571 | 571 | |
| 572 | - $solrDoc->setField('thumbnail', $doc->thumbnail); |
|
| 572 | + $solrDoc->setField('thumbnail', $doc->thumbnail); |
|
| 573 | 573 | |
| 574 | - } elseif (!empty($logicalUnit['thumbnailId'])) { |
|
| 574 | + } elseif (!empty($logicalUnit['thumbnailId'])) { |
|
| 575 | 575 | |
| 576 | - $solrDoc->setField('thumbnail', $doc->getFileLocation($logicalUnit['thumbnailId'])); |
|
| 576 | + $solrDoc->setField('thumbnail', $doc->getFileLocation($logicalUnit['thumbnailId'])); |
|
| 577 | 577 | |
| 578 | - } |
|
| 578 | + } |
|
| 579 | 579 | |
| 580 | - $solrDoc->setField('partof', $doc->parentId); |
|
| 580 | + $solrDoc->setField('partof', $doc->parentId); |
|
| 581 | 581 | |
| 582 | - $solrDoc->setField('root', $doc->rootId); |
|
| 582 | + $solrDoc->setField('root', $doc->rootId); |
|
| 583 | 583 | |
| 584 | - $solrDoc->setField('sid', $logicalUnit['id']); |
|
| 584 | + $solrDoc->setField('sid', $logicalUnit['id']); |
|
| 585 | 585 | |
| 586 | - $solrDoc->setField('toplevel', in_array($logicalUnit['type'], self::$toplevel)); |
|
| 586 | + $solrDoc->setField('toplevel', in_array($logicalUnit['type'], self::$toplevel)); |
|
| 587 | 587 | |
| 588 | - $solrDoc->setField('type', $logicalUnit['type'], self::$fields['fieldboost']['type']); |
|
| 588 | + $solrDoc->setField('type', $logicalUnit['type'], self::$fields['fieldboost']['type']); |
|
| 589 | 589 | |
| 590 | - $solrDoc->setField('title', $metadata['title'][0], self::$fields['fieldboost']['title']); |
|
| 590 | + $solrDoc->setField('title', $metadata['title'][0], self::$fields['fieldboost']['title']); |
|
| 591 | 591 | |
| 592 | - $solrDoc->setField('volume', $metadata['volume'][0], self::$fields['fieldboost']['volume']); |
|
| 592 | + $solrDoc->setField('volume', $metadata['volume'][0], self::$fields['fieldboost']['volume']); |
|
| 593 | 593 | |
| 594 | - $autocomplete = array (); |
|
| 594 | + $autocomplete = array (); |
|
| 595 | 595 | |
| 596 | - foreach ($metadata as $index_name => $data) { |
|
| 596 | + foreach ($metadata as $index_name => $data) { |
|
| 597 | 597 | |
| 598 | - if (!empty($data) && substr($index_name, -8) !== '_sorting') { |
|
| 598 | + if (!empty($data) && substr($index_name, -8) !== '_sorting') { |
|
| 599 | 599 | |
| 600 | - $solrDoc->setField(self::getIndexFieldName($index_name, $doc->pid), $data, self::$fields['fieldboost'][$index_name]); |
|
| 600 | + $solrDoc->setField(self::getIndexFieldName($index_name, $doc->pid), $data, self::$fields['fieldboost'][$index_name]); |
|
| 601 | 601 | |
| 602 | - if (in_array($index_name, self::$fields['sortables'])) { |
|
| 602 | + if (in_array($index_name, self::$fields['sortables'])) { |
|
| 603 | 603 | |
| 604 | - // Add sortable fields to index. |
|
| 605 | - $solrDoc->setField($index_name.'_sorting', $metadata[$index_name.'_sorting'][0]); |
|
| 604 | + // Add sortable fields to index. |
|
| 605 | + $solrDoc->setField($index_name.'_sorting', $metadata[$index_name.'_sorting'][0]); |
|
| 606 | 606 | |
| 607 | - } |
|
| 607 | + } |
|
| 608 | 608 | |
| 609 | - if (in_array($index_name, self::$fields['facets'])) { |
|
| 609 | + if (in_array($index_name, self::$fields['facets'])) { |
|
| 610 | 610 | |
| 611 | - // Add facets to index. |
|
| 612 | - $solrDoc->setField($index_name.'_faceting', $data); |
|
| 611 | + // Add facets to index. |
|
| 612 | + $solrDoc->setField($index_name.'_faceting', $data); |
|
| 613 | 613 | |
| 614 | - } |
|
| 614 | + } |
|
| 615 | 615 | |
| 616 | - if (in_array($index_name, self::$fields['autocomplete'])) { |
|
| 616 | + if (in_array($index_name, self::$fields['autocomplete'])) { |
|
| 617 | 617 | |
| 618 | - $autocomplete = array_merge($autocomplete, $data); |
|
| 618 | + $autocomplete = array_merge($autocomplete, $data); |
|
| 619 | 619 | |
| 620 | - } |
|
| 620 | + } |
|
| 621 | 621 | |
| 622 | - } |
|
| 622 | + } |
|
| 623 | 623 | |
| 624 | - } |
|
| 624 | + } |
|
| 625 | 625 | |
| 626 | - // Add autocomplete values to index. |
|
| 627 | - if (!empty($autocomplete)) { |
|
| 626 | + // Add autocomplete values to index. |
|
| 627 | + if (!empty($autocomplete)) { |
|
| 628 | 628 | |
| 629 | - $solrDoc->setField('autocomplete', $autocomplete); |
|
| 629 | + $solrDoc->setField('autocomplete', $autocomplete); |
|
| 630 | 630 | |
| 631 | - } |
|
| 631 | + } |
|
| 632 | 632 | |
| 633 | - // Add collection information to logical sub-elements if applicable. |
|
| 634 | - if (in_array('collection', self::$fields['facets']) |
|
| 635 | - && empty($metadata['collection']) |
|
| 636 | - && !empty($doc->metadataArray[$doc->toplevelId]['collection'])) { |
|
| 633 | + // Add collection information to logical sub-elements if applicable. |
|
| 634 | + if (in_array('collection', self::$fields['facets']) |
|
| 635 | + && empty($metadata['collection']) |
|
| 636 | + && !empty($doc->metadataArray[$doc->toplevelId]['collection'])) { |
|
| 637 | 637 | |
| 638 | - $solrDoc->setField('collection_faceting', $doc->metadataArray[$doc->toplevelId]['collection']); |
|
| 638 | + $solrDoc->setField('collection_faceting', $doc->metadataArray[$doc->toplevelId]['collection']); |
|
| 639 | 639 | |
| 640 | - } |
|
| 640 | + } |
|
| 641 | 641 | |
| 642 | - try { |
|
| 642 | + try { |
|
| 643 | 643 | |
| 644 | - self::$solr->service->addDocument($solrDoc); |
|
| 644 | + self::$solr->service->addDocument($solrDoc); |
|
| 645 | 645 | |
| 646 | - } catch (Exception $e) { |
|
| 646 | + } catch (Exception $e) { |
|
| 647 | 647 | |
| 648 | - if (!defined('TYPO3_cliMode')) { |
|
| 648 | + if (!defined('TYPO3_cliMode')) { |
|
| 649 | 649 | |
| 650 | - $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 651 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 652 | - tx_dlf_helper::getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
|
| 653 | - tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 654 | - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 655 | - TRUE |
|
| 656 | - ); |
|
| 650 | + $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 651 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 652 | + tx_dlf_helper::getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
|
| 653 | + tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 654 | + \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 655 | + TRUE |
|
| 656 | + ); |
|
| 657 | 657 | |
| 658 | - tx_dlf_helper::addMessage($message); |
|
| 658 | + tx_dlf_helper::addMessage($message); |
|
| 659 | 659 | |
| 660 | - } |
|
| 660 | + } |
|
| 661 | 661 | |
| 662 | - return 1; |
|
| 662 | + return 1; |
|
| 663 | 663 | |
| 664 | - } |
|
| 664 | + } |
|
| 665 | 665 | |
| 666 | - } |
|
| 666 | + } |
|
| 667 | 667 | |
| 668 | - // Check for child elements... |
|
| 669 | - if (!empty($logicalUnit['children'])) { |
|
| 668 | + // Check for child elements... |
|
| 669 | + if (!empty($logicalUnit['children'])) { |
|
| 670 | 670 | |
| 671 | - foreach ($logicalUnit['children'] as $child) { |
|
| 671 | + foreach ($logicalUnit['children'] as $child) { |
|
| 672 | 672 | |
| 673 | - if (!$errors) { |
|
| 673 | + if (!$errors) { |
|
| 674 | 674 | |
| 675 | - // ...and process them, too. |
|
| 676 | - $errors = self::processLogical($doc, $child); |
|
| 675 | + // ...and process them, too. |
|
| 676 | + $errors = self::processLogical($doc, $child); |
|
| 677 | 677 | |
| 678 | - } else { |
|
| 678 | + } else { |
|
| 679 | 679 | |
| 680 | - break; |
|
| 680 | + break; |
|
| 681 | 681 | |
| 682 | - } |
|
| 682 | + } |
|
| 683 | 683 | |
| 684 | - } |
|
| 684 | + } |
|
| 685 | 685 | |
| 686 | - } |
|
| 686 | + } |
|
| 687 | 687 | |
| 688 | - return $errors; |
|
| 688 | + return $errors; |
|
| 689 | 689 | |
| 690 | - } |
|
| 690 | + } |
|
| 691 | 691 | |
| 692 | - /** |
|
| 693 | - * Processes a physical unit for the Solr index |
|
| 694 | - * |
|
| 695 | - * @access protected |
|
| 696 | - * |
|
| 697 | - * @param tx_dlf_document &$doc: The METS document |
|
| 698 | - * @param integer $page: The page number |
|
| 699 | - * @param array $physicalUnit: Array of the physical unit to process |
|
| 700 | - * |
|
| 701 | - * @return integer 0 on success or 1 on failure |
|
| 702 | - */ |
|
| 703 | - protected static function processPhysical(tx_dlf_document &$doc, $page, array $physicalUnit) { |
|
| 692 | + /** |
|
| 693 | + * Processes a physical unit for the Solr index |
|
| 694 | + * |
|
| 695 | + * @access protected |
|
| 696 | + * |
|
| 697 | + * @param tx_dlf_document &$doc: The METS document |
|
| 698 | + * @param integer $page: The page number |
|
| 699 | + * @param array $physicalUnit: Array of the physical unit to process |
|
| 700 | + * |
|
| 701 | + * @return integer 0 on success or 1 on failure |
|
| 702 | + */ |
|
| 703 | + protected static function processPhysical(tx_dlf_document &$doc, $page, array $physicalUnit) { |
|
| 704 | 704 | |
| 705 | - $errors = 0; |
|
| 705 | + $errors = 0; |
|
| 706 | 706 | |
| 707 | - // Read extension configuration. |
|
| 708 | - $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
|
| 707 | + // Read extension configuration. |
|
| 708 | + $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
|
| 709 | 709 | |
| 710 | - if (!empty($physicalUnit['files'][$extConf['fileGrpFulltext']])) { |
|
| 710 | + if (!empty($physicalUnit['files'][$extConf['fileGrpFulltext']])) { |
|
| 711 | 711 | |
| 712 | - $file = $doc->getFileLocation($physicalUnit['files'][$extConf['fileGrpFulltext']]); |
|
| 712 | + $file = $doc->getFileLocation($physicalUnit['files'][$extConf['fileGrpFulltext']]); |
|
| 713 | 713 | |
| 714 | - // Load XML file. |
|
| 715 | - if (\TYPO3\CMS\Core\Utility\GeneralUtility::isValidUrl($file)) { |
|
| 714 | + // Load XML file. |
|
| 715 | + if (\TYPO3\CMS\Core\Utility\GeneralUtility::isValidUrl($file)) { |
|
| 716 | 716 | |
| 717 | - // Set user-agent to identify self when fetching XML data. |
|
| 718 | - if (!empty($extConf['useragent'])) { |
|
| 717 | + // Set user-agent to identify self when fetching XML data. |
|
| 718 | + if (!empty($extConf['useragent'])) { |
|
| 719 | 719 | |
| 720 | - @ini_set('user_agent', $extConf['useragent']); |
|
| 720 | + @ini_set('user_agent', $extConf['useragent']); |
|
| 721 | 721 | |
| 722 | - } |
|
| 722 | + } |
|
| 723 | 723 | |
| 724 | - // Turn off libxml's error logging. |
|
| 725 | - $libxmlErrors = libxml_use_internal_errors(TRUE); |
|
| 724 | + // Turn off libxml's error logging. |
|
| 725 | + $libxmlErrors = libxml_use_internal_errors(TRUE); |
|
| 726 | 726 | |
| 727 | - // disable entity loading |
|
| 728 | - $previousValueOfEntityLoader = libxml_disable_entity_loader(TRUE); |
|
| 727 | + // disable entity loading |
|
| 728 | + $previousValueOfEntityLoader = libxml_disable_entity_loader(TRUE); |
|
| 729 | 729 | |
| 730 | - // Load XML from file. |
|
| 731 | - $xml = simplexml_load_string(\TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($file)); |
|
| 730 | + // Load XML from file. |
|
| 731 | + $xml = simplexml_load_string(\TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($file)); |
|
| 732 | 732 | |
| 733 | - // reset entity loader setting |
|
| 734 | - libxml_disable_entity_loader($previousValueOfEntityLoader); |
|
| 733 | + // reset entity loader setting |
|
| 734 | + libxml_disable_entity_loader($previousValueOfEntityLoader); |
|
| 735 | 735 | |
| 736 | - // Reset libxml's error logging. |
|
| 737 | - libxml_use_internal_errors($libxmlErrors); |
|
| 736 | + // Reset libxml's error logging. |
|
| 737 | + libxml_use_internal_errors($libxmlErrors); |
|
| 738 | 738 | |
| 739 | - if ($xml === FALSE) { |
|
| 739 | + if ($xml === FALSE) { |
|
| 740 | 740 | |
| 741 | - return 1; |
|
| 741 | + return 1; |
|
| 742 | 742 | |
| 743 | - } |
|
| 743 | + } |
|
| 744 | 744 | |
| 745 | - } else { |
|
| 745 | + } else { |
|
| 746 | 746 | |
| 747 | - return 1; |
|
| 747 | + return 1; |
|
| 748 | 748 | |
| 749 | - } |
|
| 749 | + } |
|
| 750 | 750 | |
| 751 | - // Load class. |
|
| 752 | - if (!class_exists('Apache_Solr_Document')) { |
|
| 751 | + // Load class. |
|
| 752 | + if (!class_exists('Apache_Solr_Document')) { |
|
| 753 | 753 | |
| 754 | - require_once(\TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName('EXT:'.self::$extKey.'/lib/SolrPhpClient/Apache/Solr/Document.php')); |
|
| 754 | + require_once(\TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName('EXT:'.self::$extKey.'/lib/SolrPhpClient/Apache/Solr/Document.php')); |
|
| 755 | 755 | |
| 756 | - } |
|
| 756 | + } |
|
| 757 | 757 | |
| 758 | - // Create new Solr document. |
|
| 759 | - $solrDoc = new Apache_Solr_Document(); |
|
| 758 | + // Create new Solr document. |
|
| 759 | + $solrDoc = new Apache_Solr_Document(); |
|
| 760 | 760 | |
| 761 | - // Create unique identifier from document's UID and unit's XML ID. |
|
| 762 | - $solrDoc->setField('id', $doc->uid.$physicalUnit['id']); |
|
| 761 | + // Create unique identifier from document's UID and unit's XML ID. |
|
| 762 | + $solrDoc->setField('id', $doc->uid.$physicalUnit['id']); |
|
| 763 | 763 | |
| 764 | - $solrDoc->setField('uid', $doc->uid); |
|
| 764 | + $solrDoc->setField('uid', $doc->uid); |
|
| 765 | 765 | |
| 766 | - $solrDoc->setField('pid', $doc->pid); |
|
| 766 | + $solrDoc->setField('pid', $doc->pid); |
|
| 767 | 767 | |
| 768 | - $solrDoc->setField('page', $page); |
|
| 768 | + $solrDoc->setField('page', $page); |
|
| 769 | 769 | |
| 770 | - if (!empty($physicalUnit['files'][$extConf['fileGrpThumbs']])) { |
|
| 770 | + if (!empty($physicalUnit['files'][$extConf['fileGrpThumbs']])) { |
|
| 771 | 771 | |
| 772 | - $solrDoc->setField('thumbnail', $doc->getFileLocation($physicalUnit['files'][$extConf['fileGrpThumbs']])); |
|
| 772 | + $solrDoc->setField('thumbnail', $doc->getFileLocation($physicalUnit['files'][$extConf['fileGrpThumbs']])); |
|
| 773 | 773 | |
| 774 | - } |
|
| 774 | + } |
|
| 775 | 775 | |
| 776 | - $solrDoc->setField('partof', $doc->parentId); |
|
| 776 | + $solrDoc->setField('partof', $doc->parentId); |
|
| 777 | 777 | |
| 778 | - $solrDoc->setField('root', $doc->rootId); |
|
| 778 | + $solrDoc->setField('root', $doc->rootId); |
|
| 779 | 779 | |
| 780 | - $solrDoc->setField('sid', $physicalUnit['id']); |
|
| 780 | + $solrDoc->setField('sid', $physicalUnit['id']); |
|
| 781 | 781 | |
| 782 | - $solrDoc->setField('toplevel', FALSE); |
|
| 782 | + $solrDoc->setField('toplevel', FALSE); |
|
| 783 | 783 | |
| 784 | - $solrDoc->setField('type', $physicalUnit['type'], self::$fields['fieldboost']['type']); |
|
| 784 | + $solrDoc->setField('type', $physicalUnit['type'], self::$fields['fieldboost']['type']); |
|
| 785 | 785 | |
| 786 | - $solrDoc->setField('fulltext', tx_dlf_alto::getRawText($xml)); |
|
| 786 | + $solrDoc->setField('fulltext', tx_dlf_alto::getRawText($xml)); |
|
| 787 | 787 | |
| 788 | - // Add faceting information to physical sub-elements if applicable. |
|
| 789 | - foreach ($doc->metadataArray[$doc->toplevelId] as $index_name => $data) { |
|
| 788 | + // Add faceting information to physical sub-elements if applicable. |
|
| 789 | + foreach ($doc->metadataArray[$doc->toplevelId] as $index_name => $data) { |
|
| 790 | 790 | |
| 791 | - if (!empty($data) && substr($index_name, -8) !== '_sorting') { |
|
| 791 | + if (!empty($data) && substr($index_name, -8) !== '_sorting') { |
|
| 792 | 792 | |
| 793 | - if (in_array($index_name, self::$fields['facets'])) { |
|
| 793 | + if (in_array($index_name, self::$fields['facets'])) { |
|
| 794 | 794 | |
| 795 | - // Add facets to index. |
|
| 796 | - $solrDoc->setField($index_name.'_faceting', $data); |
|
| 795 | + // Add facets to index. |
|
| 796 | + $solrDoc->setField($index_name.'_faceting', $data); |
|
| 797 | 797 | |
| 798 | - } |
|
| 798 | + } |
|
| 799 | 799 | |
| 800 | - } |
|
| 800 | + } |
|
| 801 | 801 | |
| 802 | - } |
|
| 802 | + } |
|
| 803 | 803 | |
| 804 | - try { |
|
| 804 | + try { |
|
| 805 | 805 | |
| 806 | - self::$solr->service->addDocument($solrDoc); |
|
| 806 | + self::$solr->service->addDocument($solrDoc); |
|
| 807 | 807 | |
| 808 | - } catch (Exception $e) { |
|
| 808 | + } catch (Exception $e) { |
|
| 809 | 809 | |
| 810 | - if (!defined('TYPO3_cliMode')) { |
|
| 810 | + if (!defined('TYPO3_cliMode')) { |
|
| 811 | 811 | |
| 812 | - $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 813 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 814 | - tx_dlf_helper::getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
|
| 815 | - tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 816 | - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 817 | - TRUE |
|
| 818 | - ); |
|
| 812 | + $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 813 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 814 | + tx_dlf_helper::getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
|
| 815 | + tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 816 | + \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 817 | + TRUE |
|
| 818 | + ); |
|
| 819 | 819 | |
| 820 | - tx_dlf_helper::addMessage($message); |
|
| 820 | + tx_dlf_helper::addMessage($message); |
|
| 821 | 821 | |
| 822 | - } |
|
| 822 | + } |
|
| 823 | 823 | |
| 824 | - return 1; |
|
| 824 | + return 1; |
|
| 825 | 825 | |
| 826 | - } |
|
| 826 | + } |
|
| 827 | 827 | |
| 828 | - } |
|
| 828 | + } |
|
| 829 | 829 | |
| 830 | - return $errors; |
|
| 830 | + return $errors; |
|
| 831 | 831 | |
| 832 | - } |
|
| 832 | + } |
|
| 833 | 833 | |
| 834 | - /** |
|
| 835 | - * Connects to Solr server. |
|
| 836 | - * |
|
| 837 | - * @access protected |
|
| 838 | - * |
|
| 839 | - * @param integer $core: UID of the Solr core |
|
| 840 | - * @param integer $pid: UID of the configuration page |
|
| 841 | - * |
|
| 842 | - * @return boolean TRUE on success or FALSE on failure |
|
| 843 | - */ |
|
| 844 | - protected static function solrConnect($core, $pid = 0) { |
|
| 834 | + /** |
|
| 835 | + * Connects to Solr server. |
|
| 836 | + * |
|
| 837 | + * @access protected |
|
| 838 | + * |
|
| 839 | + * @param integer $core: UID of the Solr core |
|
| 840 | + * @param integer $pid: UID of the configuration page |
|
| 841 | + * |
|
| 842 | + * @return boolean TRUE on success or FALSE on failure |
|
| 843 | + */ |
|
| 844 | + protected static function solrConnect($core, $pid = 0) { |
|
| 845 | 845 | |
| 846 | - // Get Solr instance. |
|
| 847 | - if (!self::$solr) { |
|
| 846 | + // Get Solr instance. |
|
| 847 | + if (!self::$solr) { |
|
| 848 | 848 | |
| 849 | - // Connect to Solr server. |
|
| 850 | - if (self::$solr = tx_dlf_solr::getInstance($core)) { |
|
| 849 | + // Connect to Solr server. |
|
| 850 | + if (self::$solr = tx_dlf_solr::getInstance($core)) { |
|
| 851 | 851 | |
| 852 | - // Load indexing configuration if needed. |
|
| 853 | - if ($pid) { |
|
| 852 | + // Load indexing configuration if needed. |
|
| 853 | + if ($pid) { |
|
| 854 | 854 | |
| 855 | - self::loadIndexConf($pid); |
|
| 855 | + self::loadIndexConf($pid); |
|
| 856 | 856 | |
| 857 | - } |
|
| 857 | + } |
|
| 858 | 858 | |
| 859 | - } else { |
|
| 859 | + } else { |
|
| 860 | 860 | |
| 861 | - return FALSE; |
|
| 861 | + return FALSE; |
|
| 862 | 862 | |
| 863 | - } |
|
| 863 | + } |
|
| 864 | 864 | |
| 865 | - } |
|
| 865 | + } |
|
| 866 | 866 | |
| 867 | - return TRUE; |
|
| 867 | + return TRUE; |
|
| 868 | 868 | |
| 869 | - } |
|
| 869 | + } |
|
| 870 | 870 | |
| 871 | - /** |
|
| 872 | - * This is a static class, thus no instances should be created |
|
| 873 | - * |
|
| 874 | - * @access private |
|
| 875 | - */ |
|
| 876 | - private function __construct() {} |
|
| 871 | + /** |
|
| 872 | + * This is a static class, thus no instances should be created |
|
| 873 | + * |
|
| 874 | + * @access private |
|
| 875 | + */ |
|
| 876 | + private function __construct() {} |
|
| 877 | 877 | |
| 878 | 878 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | * |
| 89 | 89 | * @return integer 0 on success or 1 on failure |
| 90 | 90 | */ |
| 91 | - public static function add(tx_dlf_document &$doc, $core = 0) { |
|
| 91 | + public static function add(tx_dlf_document & $doc, $core = 0) { |
|
| 92 | 92 | |
| 93 | 93 | if (in_array($doc->uid, self::$processedDocs)) { |
| 94 | 94 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | // Handle multi-volume documents. |
| 102 | 102 | if ($doc->parentId) { |
| 103 | 103 | |
| 104 | - $parent =& tx_dlf_document::getInstance($doc->parentId, 0, TRUE); |
|
| 104 | + $parent = & tx_dlf_document::getInstance($doc->parentId, 0, TRUE); |
|
| 105 | 105 | |
| 106 | 106 | if ($parent->ready) { |
| 107 | 107 | |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | * |
| 536 | 536 | * @return integer 0 on success or 1 on failure |
| 537 | 537 | */ |
| 538 | - protected static function processLogical(tx_dlf_document &$doc, array $logicalUnit) { |
|
| 538 | + protected static function processLogical(tx_dlf_document & $doc, array $logicalUnit) { |
|
| 539 | 539 | |
| 540 | 540 | $errors = 0; |
| 541 | 541 | |
@@ -700,7 +700,7 @@ discard block |
||
| 700 | 700 | * |
| 701 | 701 | * @return integer 0 on success or 1 on failure |
| 702 | 702 | */ |
| 703 | - protected static function processPhysical(tx_dlf_document &$doc, $page, array $physicalUnit) { |
|
| 703 | + protected static function processPhysical(tx_dlf_document & $doc, $page, array $physicalUnit) { |
|
| 704 | 704 | |
| 705 | 705 | $errors = 0; |
| 706 | 706 | |
@@ -10,155 +10,155 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | return array ( |
| 13 | - 'ctrl' => array ( |
|
| 14 | - 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures', |
|
| 15 | - 'label' => 'label', |
|
| 16 | - 'tstamp' => 'tstamp', |
|
| 17 | - 'crdate' => 'crdate', |
|
| 18 | - 'cruser_id' => 'cruser_id', |
|
| 19 | - 'languageField' => 'sys_language_uid', |
|
| 20 | - 'transOrigPointerField' => 'l18n_parent', |
|
| 21 | - 'transOrigDiffSourceField' => 'l18n_diffsource', |
|
| 22 | - 'default_sortby' => 'ORDER BY label', |
|
| 23 | - 'delete' => 'deleted', |
|
| 24 | - 'enablecolumns' => array ( |
|
| 25 | - 'disabled' => 'hidden', |
|
| 26 | - ), |
|
| 27 | - 'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('dlf').'res/icons/txdlfstructures.png', |
|
| 28 | - 'rootLevel' => 0, |
|
| 29 | - 'dividers2tabs' => 2, |
|
| 30 | - 'searchFields' => 'label,index_name,oai_name', |
|
| 31 | - 'requestUpdate' => 'toplevel', |
|
| 32 | - ), |
|
| 33 | - 'feInterface' => array ( |
|
| 34 | - 'fe_admin_fieldList' => '', |
|
| 35 | - ), |
|
| 36 | - 'interface' => array ( |
|
| 37 | - 'showRecordFieldList' => 'label,index_name,oai_name,toplevel', |
|
| 38 | - ), |
|
| 39 | - 'columns' => array ( |
|
| 40 | - 'sys_language_uid' => array ( |
|
| 41 | - 'exclude' => 1, |
|
| 42 | - 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.language', |
|
| 43 | - 'config' => array ( |
|
| 44 | - 'type' => 'select', |
|
| 45 | - 'renderType' => 'selectSingle', |
|
| 46 | - 'foreign_table' => 'sys_language', |
|
| 47 | - 'foreign_table_where' => 'ORDER BY sys_language.title', |
|
| 48 | - 'items' => array ( |
|
| 49 | - array ('LLL:EXT:lang/locallang_general.xml:LGL.allLanguages', -1), |
|
| 50 | - array ('LLL:EXT:lang/locallang_general.xml:LGL.default_value', 0), |
|
| 51 | - ), |
|
| 52 | - 'default' => 0 |
|
| 53 | - ), |
|
| 54 | - ), |
|
| 55 | - 'l18n_parent' => array ( |
|
| 56 | - 'displayCond' => 'FIELD:sys_language_uid:>:0', |
|
| 57 | - 'exclude' => 1, |
|
| 58 | - 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.l18n_parent', |
|
| 59 | - 'config' => array ( |
|
| 60 | - 'type' => 'select', |
|
| 61 | - 'renderType' => 'selectSingle', |
|
| 62 | - 'items' => array ( |
|
| 63 | - array ('', 0), |
|
| 64 | - ), |
|
| 65 | - 'foreign_table' => 'tx_dlf_structures', |
|
| 66 | - 'foreign_table_where' => 'AND tx_dlf_structures.pid=###CURRENT_PID### AND tx_dlf_structures.sys_language_uid IN (-1,0) ORDER BY label ASC', |
|
| 67 | - ), |
|
| 68 | - ), |
|
| 69 | - 'l18n_diffsource' => array ( |
|
| 70 | - 'config' => array ( |
|
| 71 | - 'type' => 'passthrough', |
|
| 72 | - ), |
|
| 73 | - ), |
|
| 74 | - 'hidden' => array ( |
|
| 75 | - 'exclude' => 1, |
|
| 76 | - 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden', |
|
| 77 | - 'config' => array ( |
|
| 78 | - 'type' => 'check', |
|
| 79 | - 'default' => 0, |
|
| 80 | - ), |
|
| 81 | - ), |
|
| 82 | - 'toplevel' => array ( |
|
| 83 | - 'exclude' => 1, |
|
| 84 | - 'l10n_mode' => 'exclude', |
|
| 85 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures.toplevel', |
|
| 86 | - 'config' => array ( |
|
| 87 | - 'type' => 'check', |
|
| 88 | - 'default' => 0, |
|
| 89 | - ), |
|
| 90 | - ), |
|
| 91 | - 'label' => array ( |
|
| 92 | - 'exclude' => 1, |
|
| 93 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures.label', |
|
| 94 | - 'config' => array ( |
|
| 95 | - 'type' => 'input', |
|
| 96 | - 'size' => 30, |
|
| 97 | - 'max' => 255, |
|
| 98 | - 'eval' => 'required,trim', |
|
| 99 | - ), |
|
| 100 | - ), |
|
| 101 | - 'index_name' => array ( |
|
| 102 | - 'exclude' => 1, |
|
| 103 | - 'l10n_mode' => 'exclude', |
|
| 104 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures.index_name', |
|
| 105 | - 'config' => array ( |
|
| 106 | - 'type' => 'input', |
|
| 107 | - 'size' => 30, |
|
| 108 | - 'max' => 255, |
|
| 109 | - 'eval' => 'required,nospace,alphanum_x,uniqueInPid', |
|
| 110 | - ), |
|
| 111 | - ), |
|
| 112 | - 'oai_name' => array ( |
|
| 113 | - 'exclude' => 1, |
|
| 114 | - 'l10n_mode' => 'exclude', |
|
| 115 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures.oai_name', |
|
| 116 | - 'config' => array ( |
|
| 117 | - 'type' => 'input', |
|
| 118 | - 'size' => 30, |
|
| 119 | - 'max' => 255, |
|
| 120 | - 'eval' => 'trim', |
|
| 121 | - ), |
|
| 122 | - ), |
|
| 123 | - 'thumbnail' => array ( |
|
| 124 | - 'exclude' => 1, |
|
| 125 | - 'l10n_mode' => 'exclude', |
|
| 126 | - 'displayCond' => 'FIELD:toplevel:REQ:true', |
|
| 127 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures.thumbnail', |
|
| 128 | - 'config' => array ( |
|
| 129 | - 'type' => 'select', |
|
| 130 | - 'renderType' => 'selectSingle', |
|
| 131 | - 'items' => array ( |
|
| 132 | - array ('LLL:EXT:dlf/locallang.xml:tx_dlf_structures.thumbnail.self', 0), |
|
| 133 | - ), |
|
| 134 | - 'foreign_table' => 'tx_dlf_structures', |
|
| 135 | - 'foreign_table_where' => 'AND tx_dlf_structures.pid=###CURRENT_PID### AND tx_dlf_structures.toplevel=0 AND tx_dlf_structures.sys_language_uid IN (-1,0) ORDER BY tx_dlf_structures.label', |
|
| 136 | - 'size' => 1, |
|
| 137 | - 'minitems' => 0, |
|
| 138 | - 'maxitems' => 1, |
|
| 139 | - 'default' => 0, |
|
| 140 | - ), |
|
| 141 | - ), |
|
| 142 | - 'status' => array ( |
|
| 143 | - 'exclude' => 1, |
|
| 144 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures.status', |
|
| 145 | - 'config' => array ( |
|
| 146 | - 'type' => 'select', |
|
| 147 | - 'renderType' => 'selectSingle', |
|
| 148 | - 'items' => array ( |
|
| 149 | - array ('LLL:EXT:dlf/locallang.xml:tx_dlf_structures.status.default', 0), |
|
| 150 | - ), |
|
| 151 | - 'size' => 1, |
|
| 152 | - 'minitems' => 1, |
|
| 153 | - 'maxitems' => 1, |
|
| 154 | - 'default' => 0, |
|
| 155 | - ), |
|
| 156 | - ), |
|
| 157 | - ), |
|
| 158 | - 'types' => array ( |
|
| 159 | - '0' => array ('showitem' => '--div--;LLL:EXT:dlf/locallang.xml:tx_dlf_structures.tab1, toplevel;;;;1-1-1, label,--palette--;;1, thumbnail, --div--;LLL:EXT:dlf/locallang.xml:tx_dlf_structures.tab2, sys_language_uid;;;;1-1-1, l18n_parent, l18n_diffsource, --div--;LLL:EXT:dlf/locallang.xml:tx_dlf_structures.tab3, hidden;;;;1-1-1, status;;;;2-2-2'), |
|
| 160 | - ), |
|
| 161 | - 'palettes' => array ( |
|
| 162 | - '1' => array ('showitem' => 'index_name, --linebreak--, oai_name', 'canNotCollapse' => 1), |
|
| 163 | - ), |
|
| 13 | + 'ctrl' => array ( |
|
| 14 | + 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures', |
|
| 15 | + 'label' => 'label', |
|
| 16 | + 'tstamp' => 'tstamp', |
|
| 17 | + 'crdate' => 'crdate', |
|
| 18 | + 'cruser_id' => 'cruser_id', |
|
| 19 | + 'languageField' => 'sys_language_uid', |
|
| 20 | + 'transOrigPointerField' => 'l18n_parent', |
|
| 21 | + 'transOrigDiffSourceField' => 'l18n_diffsource', |
|
| 22 | + 'default_sortby' => 'ORDER BY label', |
|
| 23 | + 'delete' => 'deleted', |
|
| 24 | + 'enablecolumns' => array ( |
|
| 25 | + 'disabled' => 'hidden', |
|
| 26 | + ), |
|
| 27 | + 'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('dlf').'res/icons/txdlfstructures.png', |
|
| 28 | + 'rootLevel' => 0, |
|
| 29 | + 'dividers2tabs' => 2, |
|
| 30 | + 'searchFields' => 'label,index_name,oai_name', |
|
| 31 | + 'requestUpdate' => 'toplevel', |
|
| 32 | + ), |
|
| 33 | + 'feInterface' => array ( |
|
| 34 | + 'fe_admin_fieldList' => '', |
|
| 35 | + ), |
|
| 36 | + 'interface' => array ( |
|
| 37 | + 'showRecordFieldList' => 'label,index_name,oai_name,toplevel', |
|
| 38 | + ), |
|
| 39 | + 'columns' => array ( |
|
| 40 | + 'sys_language_uid' => array ( |
|
| 41 | + 'exclude' => 1, |
|
| 42 | + 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.language', |
|
| 43 | + 'config' => array ( |
|
| 44 | + 'type' => 'select', |
|
| 45 | + 'renderType' => 'selectSingle', |
|
| 46 | + 'foreign_table' => 'sys_language', |
|
| 47 | + 'foreign_table_where' => 'ORDER BY sys_language.title', |
|
| 48 | + 'items' => array ( |
|
| 49 | + array ('LLL:EXT:lang/locallang_general.xml:LGL.allLanguages', -1), |
|
| 50 | + array ('LLL:EXT:lang/locallang_general.xml:LGL.default_value', 0), |
|
| 51 | + ), |
|
| 52 | + 'default' => 0 |
|
| 53 | + ), |
|
| 54 | + ), |
|
| 55 | + 'l18n_parent' => array ( |
|
| 56 | + 'displayCond' => 'FIELD:sys_language_uid:>:0', |
|
| 57 | + 'exclude' => 1, |
|
| 58 | + 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.l18n_parent', |
|
| 59 | + 'config' => array ( |
|
| 60 | + 'type' => 'select', |
|
| 61 | + 'renderType' => 'selectSingle', |
|
| 62 | + 'items' => array ( |
|
| 63 | + array ('', 0), |
|
| 64 | + ), |
|
| 65 | + 'foreign_table' => 'tx_dlf_structures', |
|
| 66 | + 'foreign_table_where' => 'AND tx_dlf_structures.pid=###CURRENT_PID### AND tx_dlf_structures.sys_language_uid IN (-1,0) ORDER BY label ASC', |
|
| 67 | + ), |
|
| 68 | + ), |
|
| 69 | + 'l18n_diffsource' => array ( |
|
| 70 | + 'config' => array ( |
|
| 71 | + 'type' => 'passthrough', |
|
| 72 | + ), |
|
| 73 | + ), |
|
| 74 | + 'hidden' => array ( |
|
| 75 | + 'exclude' => 1, |
|
| 76 | + 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden', |
|
| 77 | + 'config' => array ( |
|
| 78 | + 'type' => 'check', |
|
| 79 | + 'default' => 0, |
|
| 80 | + ), |
|
| 81 | + ), |
|
| 82 | + 'toplevel' => array ( |
|
| 83 | + 'exclude' => 1, |
|
| 84 | + 'l10n_mode' => 'exclude', |
|
| 85 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures.toplevel', |
|
| 86 | + 'config' => array ( |
|
| 87 | + 'type' => 'check', |
|
| 88 | + 'default' => 0, |
|
| 89 | + ), |
|
| 90 | + ), |
|
| 91 | + 'label' => array ( |
|
| 92 | + 'exclude' => 1, |
|
| 93 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures.label', |
|
| 94 | + 'config' => array ( |
|
| 95 | + 'type' => 'input', |
|
| 96 | + 'size' => 30, |
|
| 97 | + 'max' => 255, |
|
| 98 | + 'eval' => 'required,trim', |
|
| 99 | + ), |
|
| 100 | + ), |
|
| 101 | + 'index_name' => array ( |
|
| 102 | + 'exclude' => 1, |
|
| 103 | + 'l10n_mode' => 'exclude', |
|
| 104 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures.index_name', |
|
| 105 | + 'config' => array ( |
|
| 106 | + 'type' => 'input', |
|
| 107 | + 'size' => 30, |
|
| 108 | + 'max' => 255, |
|
| 109 | + 'eval' => 'required,nospace,alphanum_x,uniqueInPid', |
|
| 110 | + ), |
|
| 111 | + ), |
|
| 112 | + 'oai_name' => array ( |
|
| 113 | + 'exclude' => 1, |
|
| 114 | + 'l10n_mode' => 'exclude', |
|
| 115 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures.oai_name', |
|
| 116 | + 'config' => array ( |
|
| 117 | + 'type' => 'input', |
|
| 118 | + 'size' => 30, |
|
| 119 | + 'max' => 255, |
|
| 120 | + 'eval' => 'trim', |
|
| 121 | + ), |
|
| 122 | + ), |
|
| 123 | + 'thumbnail' => array ( |
|
| 124 | + 'exclude' => 1, |
|
| 125 | + 'l10n_mode' => 'exclude', |
|
| 126 | + 'displayCond' => 'FIELD:toplevel:REQ:true', |
|
| 127 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures.thumbnail', |
|
| 128 | + 'config' => array ( |
|
| 129 | + 'type' => 'select', |
|
| 130 | + 'renderType' => 'selectSingle', |
|
| 131 | + 'items' => array ( |
|
| 132 | + array ('LLL:EXT:dlf/locallang.xml:tx_dlf_structures.thumbnail.self', 0), |
|
| 133 | + ), |
|
| 134 | + 'foreign_table' => 'tx_dlf_structures', |
|
| 135 | + 'foreign_table_where' => 'AND tx_dlf_structures.pid=###CURRENT_PID### AND tx_dlf_structures.toplevel=0 AND tx_dlf_structures.sys_language_uid IN (-1,0) ORDER BY tx_dlf_structures.label', |
|
| 136 | + 'size' => 1, |
|
| 137 | + 'minitems' => 0, |
|
| 138 | + 'maxitems' => 1, |
|
| 139 | + 'default' => 0, |
|
| 140 | + ), |
|
| 141 | + ), |
|
| 142 | + 'status' => array ( |
|
| 143 | + 'exclude' => 1, |
|
| 144 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures.status', |
|
| 145 | + 'config' => array ( |
|
| 146 | + 'type' => 'select', |
|
| 147 | + 'renderType' => 'selectSingle', |
|
| 148 | + 'items' => array ( |
|
| 149 | + array ('LLL:EXT:dlf/locallang.xml:tx_dlf_structures.status.default', 0), |
|
| 150 | + ), |
|
| 151 | + 'size' => 1, |
|
| 152 | + 'minitems' => 1, |
|
| 153 | + 'maxitems' => 1, |
|
| 154 | + 'default' => 0, |
|
| 155 | + ), |
|
| 156 | + ), |
|
| 157 | + ), |
|
| 158 | + 'types' => array ( |
|
| 159 | + '0' => array ('showitem' => '--div--;LLL:EXT:dlf/locallang.xml:tx_dlf_structures.tab1, toplevel;;;;1-1-1, label,--palette--;;1, thumbnail, --div--;LLL:EXT:dlf/locallang.xml:tx_dlf_structures.tab2, sys_language_uid;;;;1-1-1, l18n_parent, l18n_diffsource, --div--;LLL:EXT:dlf/locallang.xml:tx_dlf_structures.tab3, hidden;;;;1-1-1, status;;;;2-2-2'), |
|
| 160 | + ), |
|
| 161 | + 'palettes' => array ( |
|
| 162 | + '1' => array ('showitem' => 'index_name, --linebreak--, oai_name', 'canNotCollapse' => 1), |
|
| 163 | + ), |
|
| 164 | 164 | ); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | 'ctrl' => array ( |
| 14 | 14 | 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_mail', |
| 15 | 15 | 'label' => 'label', |
| 16 | - 'sortby' => 'sorting', |
|
| 16 | + 'sortby' => 'sorting', |
|
| 17 | 17 | 'delete' => 'deleted', |
| 18 | 18 | 'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('dlf').'res/icons/txdlfemail.png', |
| 19 | 19 | 'rootLevel' => 0, |
@@ -10,328 +10,328 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | return array ( |
| 13 | - 'ctrl' => array ( |
|
| 14 | - 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents', |
|
| 15 | - 'label' => 'title', |
|
| 16 | - 'tstamp' => 'tstamp', |
|
| 17 | - 'crdate' => 'crdate', |
|
| 18 | - 'cruser_id' => 'cruser_id', |
|
| 19 | - 'default_sortby' => 'ORDER BY title_sorting', |
|
| 20 | - 'delete' => 'deleted', |
|
| 21 | - 'enablecolumns' => array ( |
|
| 22 | - 'disabled' => 'hidden', |
|
| 23 | - 'starttime' => 'starttime', |
|
| 24 | - 'endtime' => 'endtime', |
|
| 25 | - 'fe_group' => 'fe_group', |
|
| 26 | - ), |
|
| 27 | - 'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('dlf').'res/icons/txdlfdocuments.png', |
|
| 28 | - 'rootLevel' => 0, |
|
| 29 | - 'dividers2tabs' => 2, |
|
| 30 | - 'searchFields' => 'title,volume,author,year,place,uid,prod_id,location,oai_id,opac_id,union_id,urn', |
|
| 31 | - ), |
|
| 32 | - 'feInterface' => array ( |
|
| 33 | - 'fe_admin_fieldList' => '', |
|
| 34 | - ), |
|
| 35 | - 'interface' => array ( |
|
| 36 | - 'showRecordFieldList' => 'title,volume,author,year,place,uid,prod_id,location,oai_id,opac_id,union_id,urn', |
|
| 37 | - 'maxDBListItems' => 25, |
|
| 38 | - 'maxSingleDBListItems' => 50, |
|
| 39 | - ), |
|
| 40 | - 'columns' => array ( |
|
| 41 | - 'hidden' => array ( |
|
| 42 | - 'exclude' => 1, |
|
| 43 | - 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden', |
|
| 44 | - 'config' => array ( |
|
| 45 | - 'type' => 'check', |
|
| 46 | - 'default' => 0, |
|
| 47 | - ), |
|
| 48 | - ), |
|
| 49 | - 'starttime' => array ( |
|
| 50 | - 'exclude' => 1, |
|
| 51 | - 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.starttime', |
|
| 52 | - 'config' => array ( |
|
| 53 | - 'type' => 'input', |
|
| 54 | - 'size' => '13', |
|
| 55 | - 'max' => '20', |
|
| 56 | - 'eval' => 'datetime', |
|
| 57 | - 'default' => '0', |
|
| 58 | - ), |
|
| 59 | - ), |
|
| 60 | - 'endtime' => array ( |
|
| 61 | - 'exclude' => 1, |
|
| 62 | - 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.endtime', |
|
| 63 | - 'config' => array ( |
|
| 64 | - 'type' => 'input', |
|
| 65 | - 'size' => '13', |
|
| 66 | - 'max' => '20', |
|
| 67 | - 'eval' => 'datetime', |
|
| 68 | - 'default' => '0', |
|
| 69 | - ), |
|
| 70 | - ), |
|
| 71 | - 'fe_group' => array ( |
|
| 72 | - 'exclude' => 1, |
|
| 73 | - 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.fe_group', |
|
| 74 | - 'config' => array ( |
|
| 75 | - 'type' => 'select', |
|
| 76 | - 'renderType' => 'selectMultipleSideBySide', |
|
| 77 | - 'items' => array ( |
|
| 78 | - array ('LLL:EXT:lang/locallang_general.xml:LGL.hide_at_login', -1), |
|
| 79 | - array ('LLL:EXT:lang/locallang_general.xml:LGL.any_login', -2), |
|
| 80 | - array ('LLL:EXT:lang/locallang_general.xml:LGL.usergroups', '--div--'), |
|
| 81 | - ), |
|
| 82 | - 'foreign_table' => 'fe_groups', |
|
| 83 | - 'size' => 5, |
|
| 84 | - 'autoSizeMax' => 15, |
|
| 85 | - 'minitems' => 0, |
|
| 86 | - 'maxitems' => 20, |
|
| 87 | - 'exclusiveKeys' => '-1,-2', |
|
| 88 | - ), |
|
| 89 | - ), |
|
| 90 | - 'prod_id' => array ( |
|
| 91 | - 'exclude' => 1, |
|
| 92 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.prod_id', |
|
| 93 | - 'config' => array ( |
|
| 94 | - 'type' => 'input', |
|
| 95 | - 'size' => 30, |
|
| 96 | - 'max' => 255, |
|
| 97 | - 'eval' => 'nospace', |
|
| 98 | - ), |
|
| 99 | - ), |
|
| 100 | - 'location' => array ( |
|
| 101 | - 'exclude' => 1, |
|
| 102 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.location', |
|
| 103 | - 'config' => array ( |
|
| 104 | - 'type' => 'input', |
|
| 105 | - 'size' => 30, |
|
| 106 | - 'max' => 1024, |
|
| 107 | - 'eval' => 'required,uniqueInPid', |
|
| 108 | - ), |
|
| 109 | - ), |
|
| 110 | - 'record_id' => array ( |
|
| 111 | - 'exclude' => 1, |
|
| 112 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.record_id', |
|
| 113 | - 'config' => array ( |
|
| 114 | - 'type' => 'input', |
|
| 115 | - 'size' => 30, |
|
| 116 | - 'max' => 255, |
|
| 117 | - 'eval' => 'nospace,uniqueInPid', |
|
| 118 | - ), |
|
| 119 | - ), |
|
| 120 | - 'opac_id' => array ( |
|
| 121 | - 'exclude' => 1, |
|
| 122 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.opac_id', |
|
| 123 | - 'config' => array ( |
|
| 124 | - 'type' => 'input', |
|
| 125 | - 'size' => 30, |
|
| 126 | - 'max' => 255, |
|
| 127 | - 'eval' => 'nospace', |
|
| 128 | - ), |
|
| 129 | - ), |
|
| 130 | - 'union_id' => array ( |
|
| 131 | - 'exclude' => 1, |
|
| 132 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.union_id', |
|
| 133 | - 'config' => array ( |
|
| 134 | - 'type' => 'input', |
|
| 135 | - 'size' => 30, |
|
| 136 | - 'max' => 255, |
|
| 137 | - 'eval' => 'nospace', |
|
| 138 | - ), |
|
| 139 | - ), |
|
| 140 | - 'urn' => array ( |
|
| 141 | - 'exclude' => 1, |
|
| 142 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.urn', |
|
| 143 | - 'config' => array ( |
|
| 144 | - 'type' => 'input', |
|
| 145 | - 'size' => 30, |
|
| 146 | - 'max' => 255, |
|
| 147 | - 'eval' => 'nospace', |
|
| 148 | - ), |
|
| 149 | - ), |
|
| 150 | - 'purl' => array ( |
|
| 151 | - 'exclude' => 1, |
|
| 152 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.purl', |
|
| 153 | - 'config' => array ( |
|
| 154 | - 'type' => 'input', |
|
| 155 | - 'size' => 30, |
|
| 156 | - 'max' => 255, |
|
| 157 | - 'eval' => 'nospace', |
|
| 158 | - ), |
|
| 159 | - ), |
|
| 160 | - 'title' => array ( |
|
| 161 | - 'exclude' => 1, |
|
| 162 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.title', |
|
| 163 | - 'config' => array ( |
|
| 164 | - 'type' => 'input', |
|
| 165 | - 'size' => 30, |
|
| 166 | - 'max' => 1024, |
|
| 167 | - 'eval' => 'trim', |
|
| 168 | - ), |
|
| 169 | - ), |
|
| 170 | - 'title_sorting' => array ( |
|
| 171 | - 'exclude' => 1, |
|
| 172 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.title_sorting', |
|
| 173 | - 'config' => array ( |
|
| 174 | - 'type' => 'input', |
|
| 175 | - 'size' => 30, |
|
| 176 | - 'max' => 1024, |
|
| 177 | - 'eval' => 'trim', |
|
| 178 | - ), |
|
| 179 | - ), |
|
| 180 | - 'author' => array ( |
|
| 181 | - 'exclude' => 1, |
|
| 182 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.author', |
|
| 183 | - 'config' => array ( |
|
| 184 | - 'type' => 'input', |
|
| 185 | - 'size' => 30, |
|
| 186 | - 'max' => 255, |
|
| 187 | - 'eval' => 'trim', |
|
| 188 | - ), |
|
| 189 | - ), |
|
| 190 | - 'year' => array ( |
|
| 191 | - 'exclude' => 1, |
|
| 192 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.year', |
|
| 193 | - 'config' => array ( |
|
| 194 | - 'type' => 'input', |
|
| 195 | - 'size' => 30, |
|
| 196 | - 'max' => 255, |
|
| 197 | - 'eval' => 'trim', |
|
| 198 | - ), |
|
| 199 | - ), |
|
| 200 | - 'place' => array ( |
|
| 201 | - 'exclude' => 1, |
|
| 202 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.place', |
|
| 203 | - 'config' => array ( |
|
| 204 | - 'type' => 'input', |
|
| 205 | - 'size' => 30, |
|
| 206 | - 'max' => 255, |
|
| 207 | - 'eval' => 'trim', |
|
| 208 | - ), |
|
| 209 | - ), |
|
| 210 | - 'thumbnail' => array ( |
|
| 211 | - 'exclude' => 1, |
|
| 212 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.thumbnail', |
|
| 213 | - 'config' => array ( |
|
| 214 | - 'type' => 'user', |
|
| 215 | - 'userFunc' => 'EXT:dlf/hooks/class.tx_dlf_tceforms.php:tx_dlf_tceforms->displayThumbnail', |
|
| 216 | - ), |
|
| 217 | - ), |
|
| 218 | - 'metadata' => array ( |
|
| 219 | - 'config' => array ( |
|
| 220 | - 'type' => 'passthrough', |
|
| 221 | - ), |
|
| 222 | - ), |
|
| 223 | - 'metadata_sorting' => array ( |
|
| 224 | - 'config' => array ( |
|
| 225 | - 'type' => 'passthrough', |
|
| 226 | - ), |
|
| 227 | - ), |
|
| 228 | - 'structure' => array ( |
|
| 229 | - 'exclude' => 1, |
|
| 230 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.structure', |
|
| 231 | - 'config' => array ( |
|
| 232 | - 'type' => 'select', |
|
| 233 | - 'renderType' => 'selectSingle', |
|
| 234 | - 'foreign_table' => 'tx_dlf_structures', |
|
| 235 | - 'foreign_table_where' => 'AND tx_dlf_structures.pid=###CURRENT_PID### AND tx_dlf_structures.sys_language_uid IN (-1,0) AND tx_dlf_structures.toplevel=1 ORDER BY tx_dlf_structures.label', |
|
| 236 | - 'size' => 1, |
|
| 237 | - 'minitems' => 1, |
|
| 238 | - 'maxitems' => 1, |
|
| 239 | - ), |
|
| 240 | - ), |
|
| 241 | - 'partof' => array ( |
|
| 242 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.partof', |
|
| 243 | - 'config' => array ( |
|
| 244 | - 'type' => 'group', |
|
| 245 | - 'internal_type' => 'db', |
|
| 246 | - 'allowed' => 'tx_dlf_documents', |
|
| 247 | - 'prepend_tname' => 0, |
|
| 248 | - 'size' => 1, |
|
| 249 | - 'selectedListStyle' => 'width:400px;', |
|
| 250 | - 'minitems' => 0, |
|
| 251 | - 'maxitems' => 1, |
|
| 252 | - 'disable_controls' => 'browser,delete', |
|
| 253 | - 'default' => 0, |
|
| 254 | - 'readOnly' => 1, |
|
| 255 | - ), |
|
| 256 | - ), |
|
| 257 | - 'volume' => array ( |
|
| 258 | - 'exclude' => 1, |
|
| 259 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.volume', |
|
| 260 | - 'config' => array ( |
|
| 261 | - 'type' => 'input', |
|
| 262 | - 'size' => 30, |
|
| 263 | - 'max' => 255, |
|
| 264 | - 'eval' => 'trim', |
|
| 265 | - ), |
|
| 266 | - ), |
|
| 267 | - 'volume_sorting' => array ( |
|
| 268 | - 'exclude' => 1, |
|
| 269 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.volume_sorting', |
|
| 270 | - 'config' => array ( |
|
| 271 | - 'type' => 'input', |
|
| 272 | - 'size' => 30, |
|
| 273 | - 'max' => 255, |
|
| 274 | - 'eval' => 'trim', |
|
| 275 | - ), |
|
| 276 | - ), |
|
| 277 | - 'collections' => array ( |
|
| 278 | - 'exclude' => 1, |
|
| 279 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.collections', |
|
| 280 | - 'config' => array ( |
|
| 281 | - 'type' => 'select', |
|
| 282 | - 'renderType' => 'selectMultipleSideBySide', |
|
| 283 | - 'foreign_table' => 'tx_dlf_collections', |
|
| 284 | - 'foreign_table_where' => 'AND tx_dlf_collections.pid=###CURRENT_PID### AND tx_dlf_collections.sys_language_uid IN (-1,0) ORDER BY tx_dlf_collections.label', |
|
| 285 | - 'size' => 5, |
|
| 286 | - 'autoSizeMax' => 15, |
|
| 287 | - 'minitems' => 1, |
|
| 288 | - 'maxitems' => 1024, |
|
| 289 | - 'MM' => 'tx_dlf_relations', |
|
| 290 | - 'MM_match_fields' => array ( |
|
| 291 | - 'ident' => 'docs_colls', |
|
| 292 | - ), |
|
| 293 | - ), |
|
| 294 | - ), |
|
| 295 | - 'owner' => array ( |
|
| 296 | - 'exclude' => 1, |
|
| 297 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.owner', |
|
| 298 | - 'config' => array ( |
|
| 299 | - 'type' => 'select', |
|
| 300 | - 'renderType' => 'selectSingle', |
|
| 301 | - 'foreign_table' => 'tx_dlf_libraries', |
|
| 302 | - 'foreign_table_where' => 'AND tx_dlf_libraries.sys_language_uid IN (-1,0) ORDER BY tx_dlf_libraries.label', |
|
| 303 | - 'size' => 1, |
|
| 304 | - 'minitems' => 0, |
|
| 305 | - 'maxitems' => 1, |
|
| 306 | - ), |
|
| 307 | - ), |
|
| 308 | - 'solrcore' => array ( |
|
| 309 | - 'config' => array ( |
|
| 310 | - 'type' => 'passthrough', |
|
| 311 | - ), |
|
| 312 | - ), |
|
| 313 | - 'status' => array ( |
|
| 314 | - 'exclude' => 1, |
|
| 315 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.status', |
|
| 316 | - 'config' => array ( |
|
| 317 | - 'type' => 'select', |
|
| 318 | - 'renderType' => 'selectSingle', |
|
| 319 | - 'items' => array ( |
|
| 320 | - array ('LLL:EXT:dlf/locallang.xml:tx_dlf_documents.status.default', 0), |
|
| 321 | - ), |
|
| 322 | - 'size' => 1, |
|
| 323 | - 'minitems' => 1, |
|
| 324 | - 'maxitems' => 1, |
|
| 325 | - 'default' => 0, |
|
| 326 | - ), |
|
| 327 | - ), |
|
| 328 | - ), |
|
| 329 | - 'types' => array ( |
|
| 330 | - '0' => array ('showitem' => '--div--;LLL:EXT:dlf/locallang.xml:tx_dlf_documents.tab1, title,--palette--;;1;;1-1-1, author, year, place, structure,--palette--;;2;;2-2-2, collections;;;;3-3-3, --div--;LLL:EXT:dlf/locallang.xml:tx_dlf_documents.tab2, location;;;;1-1-1, record_id, prod_id;;;;2-2-2, oai_id;;;;3-3-3, opac_id, union_id, urn, purl;;;;4-4-4, --div--;LLL:EXT:dlf/locallang.xml:tx_dlf_documents.tab3, hidden,--palette--;;3;;1-1-1, fe_group;;;;2-2-2, status;;;;3-3-3, owner;;;;4-4-4'), |
|
| 331 | - ), |
|
| 332 | - 'palettes' => array ( |
|
| 333 | - '1' => array ('showitem' => 'title_sorting', 'canNotCollapse' => 1), |
|
| 334 | - '2' => array ('showitem' => 'partof, thumbnail, --linebreak--, volume, volume_sorting', 'canNotCollapse' => 1), |
|
| 335 | - '3' => array ('showitem' => 'starttime, endtime', 'canNotCollapse' => 1), |
|
| 336 | - ) |
|
| 13 | + 'ctrl' => array ( |
|
| 14 | + 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents', |
|
| 15 | + 'label' => 'title', |
|
| 16 | + 'tstamp' => 'tstamp', |
|
| 17 | + 'crdate' => 'crdate', |
|
| 18 | + 'cruser_id' => 'cruser_id', |
|
| 19 | + 'default_sortby' => 'ORDER BY title_sorting', |
|
| 20 | + 'delete' => 'deleted', |
|
| 21 | + 'enablecolumns' => array ( |
|
| 22 | + 'disabled' => 'hidden', |
|
| 23 | + 'starttime' => 'starttime', |
|
| 24 | + 'endtime' => 'endtime', |
|
| 25 | + 'fe_group' => 'fe_group', |
|
| 26 | + ), |
|
| 27 | + 'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('dlf').'res/icons/txdlfdocuments.png', |
|
| 28 | + 'rootLevel' => 0, |
|
| 29 | + 'dividers2tabs' => 2, |
|
| 30 | + 'searchFields' => 'title,volume,author,year,place,uid,prod_id,location,oai_id,opac_id,union_id,urn', |
|
| 31 | + ), |
|
| 32 | + 'feInterface' => array ( |
|
| 33 | + 'fe_admin_fieldList' => '', |
|
| 34 | + ), |
|
| 35 | + 'interface' => array ( |
|
| 36 | + 'showRecordFieldList' => 'title,volume,author,year,place,uid,prod_id,location,oai_id,opac_id,union_id,urn', |
|
| 37 | + 'maxDBListItems' => 25, |
|
| 38 | + 'maxSingleDBListItems' => 50, |
|
| 39 | + ), |
|
| 40 | + 'columns' => array ( |
|
| 41 | + 'hidden' => array ( |
|
| 42 | + 'exclude' => 1, |
|
| 43 | + 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden', |
|
| 44 | + 'config' => array ( |
|
| 45 | + 'type' => 'check', |
|
| 46 | + 'default' => 0, |
|
| 47 | + ), |
|
| 48 | + ), |
|
| 49 | + 'starttime' => array ( |
|
| 50 | + 'exclude' => 1, |
|
| 51 | + 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.starttime', |
|
| 52 | + 'config' => array ( |
|
| 53 | + 'type' => 'input', |
|
| 54 | + 'size' => '13', |
|
| 55 | + 'max' => '20', |
|
| 56 | + 'eval' => 'datetime', |
|
| 57 | + 'default' => '0', |
|
| 58 | + ), |
|
| 59 | + ), |
|
| 60 | + 'endtime' => array ( |
|
| 61 | + 'exclude' => 1, |
|
| 62 | + 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.endtime', |
|
| 63 | + 'config' => array ( |
|
| 64 | + 'type' => 'input', |
|
| 65 | + 'size' => '13', |
|
| 66 | + 'max' => '20', |
|
| 67 | + 'eval' => 'datetime', |
|
| 68 | + 'default' => '0', |
|
| 69 | + ), |
|
| 70 | + ), |
|
| 71 | + 'fe_group' => array ( |
|
| 72 | + 'exclude' => 1, |
|
| 73 | + 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.fe_group', |
|
| 74 | + 'config' => array ( |
|
| 75 | + 'type' => 'select', |
|
| 76 | + 'renderType' => 'selectMultipleSideBySide', |
|
| 77 | + 'items' => array ( |
|
| 78 | + array ('LLL:EXT:lang/locallang_general.xml:LGL.hide_at_login', -1), |
|
| 79 | + array ('LLL:EXT:lang/locallang_general.xml:LGL.any_login', -2), |
|
| 80 | + array ('LLL:EXT:lang/locallang_general.xml:LGL.usergroups', '--div--'), |
|
| 81 | + ), |
|
| 82 | + 'foreign_table' => 'fe_groups', |
|
| 83 | + 'size' => 5, |
|
| 84 | + 'autoSizeMax' => 15, |
|
| 85 | + 'minitems' => 0, |
|
| 86 | + 'maxitems' => 20, |
|
| 87 | + 'exclusiveKeys' => '-1,-2', |
|
| 88 | + ), |
|
| 89 | + ), |
|
| 90 | + 'prod_id' => array ( |
|
| 91 | + 'exclude' => 1, |
|
| 92 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.prod_id', |
|
| 93 | + 'config' => array ( |
|
| 94 | + 'type' => 'input', |
|
| 95 | + 'size' => 30, |
|
| 96 | + 'max' => 255, |
|
| 97 | + 'eval' => 'nospace', |
|
| 98 | + ), |
|
| 99 | + ), |
|
| 100 | + 'location' => array ( |
|
| 101 | + 'exclude' => 1, |
|
| 102 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.location', |
|
| 103 | + 'config' => array ( |
|
| 104 | + 'type' => 'input', |
|
| 105 | + 'size' => 30, |
|
| 106 | + 'max' => 1024, |
|
| 107 | + 'eval' => 'required,uniqueInPid', |
|
| 108 | + ), |
|
| 109 | + ), |
|
| 110 | + 'record_id' => array ( |
|
| 111 | + 'exclude' => 1, |
|
| 112 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.record_id', |
|
| 113 | + 'config' => array ( |
|
| 114 | + 'type' => 'input', |
|
| 115 | + 'size' => 30, |
|
| 116 | + 'max' => 255, |
|
| 117 | + 'eval' => 'nospace,uniqueInPid', |
|
| 118 | + ), |
|
| 119 | + ), |
|
| 120 | + 'opac_id' => array ( |
|
| 121 | + 'exclude' => 1, |
|
| 122 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.opac_id', |
|
| 123 | + 'config' => array ( |
|
| 124 | + 'type' => 'input', |
|
| 125 | + 'size' => 30, |
|
| 126 | + 'max' => 255, |
|
| 127 | + 'eval' => 'nospace', |
|
| 128 | + ), |
|
| 129 | + ), |
|
| 130 | + 'union_id' => array ( |
|
| 131 | + 'exclude' => 1, |
|
| 132 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.union_id', |
|
| 133 | + 'config' => array ( |
|
| 134 | + 'type' => 'input', |
|
| 135 | + 'size' => 30, |
|
| 136 | + 'max' => 255, |
|
| 137 | + 'eval' => 'nospace', |
|
| 138 | + ), |
|
| 139 | + ), |
|
| 140 | + 'urn' => array ( |
|
| 141 | + 'exclude' => 1, |
|
| 142 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.urn', |
|
| 143 | + 'config' => array ( |
|
| 144 | + 'type' => 'input', |
|
| 145 | + 'size' => 30, |
|
| 146 | + 'max' => 255, |
|
| 147 | + 'eval' => 'nospace', |
|
| 148 | + ), |
|
| 149 | + ), |
|
| 150 | + 'purl' => array ( |
|
| 151 | + 'exclude' => 1, |
|
| 152 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.purl', |
|
| 153 | + 'config' => array ( |
|
| 154 | + 'type' => 'input', |
|
| 155 | + 'size' => 30, |
|
| 156 | + 'max' => 255, |
|
| 157 | + 'eval' => 'nospace', |
|
| 158 | + ), |
|
| 159 | + ), |
|
| 160 | + 'title' => array ( |
|
| 161 | + 'exclude' => 1, |
|
| 162 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.title', |
|
| 163 | + 'config' => array ( |
|
| 164 | + 'type' => 'input', |
|
| 165 | + 'size' => 30, |
|
| 166 | + 'max' => 1024, |
|
| 167 | + 'eval' => 'trim', |
|
| 168 | + ), |
|
| 169 | + ), |
|
| 170 | + 'title_sorting' => array ( |
|
| 171 | + 'exclude' => 1, |
|
| 172 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.title_sorting', |
|
| 173 | + 'config' => array ( |
|
| 174 | + 'type' => 'input', |
|
| 175 | + 'size' => 30, |
|
| 176 | + 'max' => 1024, |
|
| 177 | + 'eval' => 'trim', |
|
| 178 | + ), |
|
| 179 | + ), |
|
| 180 | + 'author' => array ( |
|
| 181 | + 'exclude' => 1, |
|
| 182 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.author', |
|
| 183 | + 'config' => array ( |
|
| 184 | + 'type' => 'input', |
|
| 185 | + 'size' => 30, |
|
| 186 | + 'max' => 255, |
|
| 187 | + 'eval' => 'trim', |
|
| 188 | + ), |
|
| 189 | + ), |
|
| 190 | + 'year' => array ( |
|
| 191 | + 'exclude' => 1, |
|
| 192 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.year', |
|
| 193 | + 'config' => array ( |
|
| 194 | + 'type' => 'input', |
|
| 195 | + 'size' => 30, |
|
| 196 | + 'max' => 255, |
|
| 197 | + 'eval' => 'trim', |
|
| 198 | + ), |
|
| 199 | + ), |
|
| 200 | + 'place' => array ( |
|
| 201 | + 'exclude' => 1, |
|
| 202 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.place', |
|
| 203 | + 'config' => array ( |
|
| 204 | + 'type' => 'input', |
|
| 205 | + 'size' => 30, |
|
| 206 | + 'max' => 255, |
|
| 207 | + 'eval' => 'trim', |
|
| 208 | + ), |
|
| 209 | + ), |
|
| 210 | + 'thumbnail' => array ( |
|
| 211 | + 'exclude' => 1, |
|
| 212 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.thumbnail', |
|
| 213 | + 'config' => array ( |
|
| 214 | + 'type' => 'user', |
|
| 215 | + 'userFunc' => 'EXT:dlf/hooks/class.tx_dlf_tceforms.php:tx_dlf_tceforms->displayThumbnail', |
|
| 216 | + ), |
|
| 217 | + ), |
|
| 218 | + 'metadata' => array ( |
|
| 219 | + 'config' => array ( |
|
| 220 | + 'type' => 'passthrough', |
|
| 221 | + ), |
|
| 222 | + ), |
|
| 223 | + 'metadata_sorting' => array ( |
|
| 224 | + 'config' => array ( |
|
| 225 | + 'type' => 'passthrough', |
|
| 226 | + ), |
|
| 227 | + ), |
|
| 228 | + 'structure' => array ( |
|
| 229 | + 'exclude' => 1, |
|
| 230 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.structure', |
|
| 231 | + 'config' => array ( |
|
| 232 | + 'type' => 'select', |
|
| 233 | + 'renderType' => 'selectSingle', |
|
| 234 | + 'foreign_table' => 'tx_dlf_structures', |
|
| 235 | + 'foreign_table_where' => 'AND tx_dlf_structures.pid=###CURRENT_PID### AND tx_dlf_structures.sys_language_uid IN (-1,0) AND tx_dlf_structures.toplevel=1 ORDER BY tx_dlf_structures.label', |
|
| 236 | + 'size' => 1, |
|
| 237 | + 'minitems' => 1, |
|
| 238 | + 'maxitems' => 1, |
|
| 239 | + ), |
|
| 240 | + ), |
|
| 241 | + 'partof' => array ( |
|
| 242 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.partof', |
|
| 243 | + 'config' => array ( |
|
| 244 | + 'type' => 'group', |
|
| 245 | + 'internal_type' => 'db', |
|
| 246 | + 'allowed' => 'tx_dlf_documents', |
|
| 247 | + 'prepend_tname' => 0, |
|
| 248 | + 'size' => 1, |
|
| 249 | + 'selectedListStyle' => 'width:400px;', |
|
| 250 | + 'minitems' => 0, |
|
| 251 | + 'maxitems' => 1, |
|
| 252 | + 'disable_controls' => 'browser,delete', |
|
| 253 | + 'default' => 0, |
|
| 254 | + 'readOnly' => 1, |
|
| 255 | + ), |
|
| 256 | + ), |
|
| 257 | + 'volume' => array ( |
|
| 258 | + 'exclude' => 1, |
|
| 259 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.volume', |
|
| 260 | + 'config' => array ( |
|
| 261 | + 'type' => 'input', |
|
| 262 | + 'size' => 30, |
|
| 263 | + 'max' => 255, |
|
| 264 | + 'eval' => 'trim', |
|
| 265 | + ), |
|
| 266 | + ), |
|
| 267 | + 'volume_sorting' => array ( |
|
| 268 | + 'exclude' => 1, |
|
| 269 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.volume_sorting', |
|
| 270 | + 'config' => array ( |
|
| 271 | + 'type' => 'input', |
|
| 272 | + 'size' => 30, |
|
| 273 | + 'max' => 255, |
|
| 274 | + 'eval' => 'trim', |
|
| 275 | + ), |
|
| 276 | + ), |
|
| 277 | + 'collections' => array ( |
|
| 278 | + 'exclude' => 1, |
|
| 279 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.collections', |
|
| 280 | + 'config' => array ( |
|
| 281 | + 'type' => 'select', |
|
| 282 | + 'renderType' => 'selectMultipleSideBySide', |
|
| 283 | + 'foreign_table' => 'tx_dlf_collections', |
|
| 284 | + 'foreign_table_where' => 'AND tx_dlf_collections.pid=###CURRENT_PID### AND tx_dlf_collections.sys_language_uid IN (-1,0) ORDER BY tx_dlf_collections.label', |
|
| 285 | + 'size' => 5, |
|
| 286 | + 'autoSizeMax' => 15, |
|
| 287 | + 'minitems' => 1, |
|
| 288 | + 'maxitems' => 1024, |
|
| 289 | + 'MM' => 'tx_dlf_relations', |
|
| 290 | + 'MM_match_fields' => array ( |
|
| 291 | + 'ident' => 'docs_colls', |
|
| 292 | + ), |
|
| 293 | + ), |
|
| 294 | + ), |
|
| 295 | + 'owner' => array ( |
|
| 296 | + 'exclude' => 1, |
|
| 297 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.owner', |
|
| 298 | + 'config' => array ( |
|
| 299 | + 'type' => 'select', |
|
| 300 | + 'renderType' => 'selectSingle', |
|
| 301 | + 'foreign_table' => 'tx_dlf_libraries', |
|
| 302 | + 'foreign_table_where' => 'AND tx_dlf_libraries.sys_language_uid IN (-1,0) ORDER BY tx_dlf_libraries.label', |
|
| 303 | + 'size' => 1, |
|
| 304 | + 'minitems' => 0, |
|
| 305 | + 'maxitems' => 1, |
|
| 306 | + ), |
|
| 307 | + ), |
|
| 308 | + 'solrcore' => array ( |
|
| 309 | + 'config' => array ( |
|
| 310 | + 'type' => 'passthrough', |
|
| 311 | + ), |
|
| 312 | + ), |
|
| 313 | + 'status' => array ( |
|
| 314 | + 'exclude' => 1, |
|
| 315 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents.status', |
|
| 316 | + 'config' => array ( |
|
| 317 | + 'type' => 'select', |
|
| 318 | + 'renderType' => 'selectSingle', |
|
| 319 | + 'items' => array ( |
|
| 320 | + array ('LLL:EXT:dlf/locallang.xml:tx_dlf_documents.status.default', 0), |
|
| 321 | + ), |
|
| 322 | + 'size' => 1, |
|
| 323 | + 'minitems' => 1, |
|
| 324 | + 'maxitems' => 1, |
|
| 325 | + 'default' => 0, |
|
| 326 | + ), |
|
| 327 | + ), |
|
| 328 | + ), |
|
| 329 | + 'types' => array ( |
|
| 330 | + '0' => array ('showitem' => '--div--;LLL:EXT:dlf/locallang.xml:tx_dlf_documents.tab1, title,--palette--;;1;;1-1-1, author, year, place, structure,--palette--;;2;;2-2-2, collections;;;;3-3-3, --div--;LLL:EXT:dlf/locallang.xml:tx_dlf_documents.tab2, location;;;;1-1-1, record_id, prod_id;;;;2-2-2, oai_id;;;;3-3-3, opac_id, union_id, urn, purl;;;;4-4-4, --div--;LLL:EXT:dlf/locallang.xml:tx_dlf_documents.tab3, hidden,--palette--;;3;;1-1-1, fe_group;;;;2-2-2, status;;;;3-3-3, owner;;;;4-4-4'), |
|
| 331 | + ), |
|
| 332 | + 'palettes' => array ( |
|
| 333 | + '1' => array ('showitem' => 'title_sorting', 'canNotCollapse' => 1), |
|
| 334 | + '2' => array ('showitem' => 'partof, thumbnail, --linebreak--, volume, volume_sorting', 'canNotCollapse' => 1), |
|
| 335 | + '3' => array ('showitem' => 'starttime, endtime', 'canNotCollapse' => 1), |
|
| 336 | + ) |
|
| 337 | 337 | ); |
@@ -10,67 +10,67 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | return array ( |
| 13 | - 'ctrl' => array ( |
|
| 14 | - 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_formats', |
|
| 15 | - 'label' => 'type', |
|
| 16 | - 'tstamp' => 'tstamp', |
|
| 17 | - 'crdate' => 'crdate', |
|
| 18 | - 'cruser_id' => 'cruser_id', |
|
| 19 | - 'default_sortby' => 'ORDER BY type', |
|
| 20 | - 'delete' => 'deleted', |
|
| 21 | - 'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('dlf').'res/icons/txdlfformats.png', |
|
| 22 | - 'rootLevel' => 1, |
|
| 23 | - 'dividers2tabs' => 2, |
|
| 24 | - 'searchFields' => 'type,class', |
|
| 25 | - ), |
|
| 26 | - 'feInterface' => array ( |
|
| 27 | - 'fe_admin_fieldList' => '', |
|
| 28 | - ), |
|
| 29 | - 'interface' => array ( |
|
| 30 | - 'showRecordFieldList' => 'type,class', |
|
| 31 | - ), |
|
| 32 | - 'columns' => array ( |
|
| 33 | - 'type' => array ( |
|
| 34 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_formats.type', |
|
| 35 | - 'config' => array ( |
|
| 36 | - 'type' => 'input', |
|
| 37 | - 'size' => 30, |
|
| 38 | - 'max' => 255, |
|
| 39 | - 'eval' => 'required,nospace,alphanum_x,unique', |
|
| 40 | - ), |
|
| 41 | - ), |
|
| 42 | - 'root' => array ( |
|
| 43 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_formats.root', |
|
| 44 | - 'config' => array ( |
|
| 45 | - 'type' => 'input', |
|
| 46 | - 'size' => 30, |
|
| 47 | - 'max' => 255, |
|
| 48 | - 'eval' => 'required,nospace,alphanum_x,unique', |
|
| 49 | - ), |
|
| 50 | - ), |
|
| 51 | - 'namespace' => array ( |
|
| 52 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_formats.namespace', |
|
| 53 | - 'config' => array ( |
|
| 54 | - 'type' => 'input', |
|
| 55 | - 'size' => 30, |
|
| 56 | - 'max' => 1024, |
|
| 57 | - 'eval' => 'required,nospace,unique', |
|
| 58 | - ), |
|
| 59 | - ), |
|
| 60 | - 'class' => array ( |
|
| 61 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_formats.class', |
|
| 62 | - 'config' => array ( |
|
| 63 | - 'type' => 'input', |
|
| 64 | - 'size' => 30, |
|
| 65 | - 'max' => 1024, |
|
| 66 | - 'eval' => 'nospace,alphanum_x,unique', |
|
| 67 | - ), |
|
| 68 | - ), |
|
| 69 | - ), |
|
| 70 | - 'types' => array ( |
|
| 71 | - '0' => array ('showitem' => '--div--;LLL:EXT:dlf/locallang.xml:tx_dlf_formats.tab1, type;;;;1-1-1, root;;;;2-2-2, namespace, class;;;;3-3-3'), |
|
| 72 | - ), |
|
| 73 | - 'palettes' => array ( |
|
| 74 | - '1' => array ('showitem' => ''), |
|
| 75 | - ), |
|
| 13 | + 'ctrl' => array ( |
|
| 14 | + 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_formats', |
|
| 15 | + 'label' => 'type', |
|
| 16 | + 'tstamp' => 'tstamp', |
|
| 17 | + 'crdate' => 'crdate', |
|
| 18 | + 'cruser_id' => 'cruser_id', |
|
| 19 | + 'default_sortby' => 'ORDER BY type', |
|
| 20 | + 'delete' => 'deleted', |
|
| 21 | + 'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('dlf').'res/icons/txdlfformats.png', |
|
| 22 | + 'rootLevel' => 1, |
|
| 23 | + 'dividers2tabs' => 2, |
|
| 24 | + 'searchFields' => 'type,class', |
|
| 25 | + ), |
|
| 26 | + 'feInterface' => array ( |
|
| 27 | + 'fe_admin_fieldList' => '', |
|
| 28 | + ), |
|
| 29 | + 'interface' => array ( |
|
| 30 | + 'showRecordFieldList' => 'type,class', |
|
| 31 | + ), |
|
| 32 | + 'columns' => array ( |
|
| 33 | + 'type' => array ( |
|
| 34 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_formats.type', |
|
| 35 | + 'config' => array ( |
|
| 36 | + 'type' => 'input', |
|
| 37 | + 'size' => 30, |
|
| 38 | + 'max' => 255, |
|
| 39 | + 'eval' => 'required,nospace,alphanum_x,unique', |
|
| 40 | + ), |
|
| 41 | + ), |
|
| 42 | + 'root' => array ( |
|
| 43 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_formats.root', |
|
| 44 | + 'config' => array ( |
|
| 45 | + 'type' => 'input', |
|
| 46 | + 'size' => 30, |
|
| 47 | + 'max' => 255, |
|
| 48 | + 'eval' => 'required,nospace,alphanum_x,unique', |
|
| 49 | + ), |
|
| 50 | + ), |
|
| 51 | + 'namespace' => array ( |
|
| 52 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_formats.namespace', |
|
| 53 | + 'config' => array ( |
|
| 54 | + 'type' => 'input', |
|
| 55 | + 'size' => 30, |
|
| 56 | + 'max' => 1024, |
|
| 57 | + 'eval' => 'required,nospace,unique', |
|
| 58 | + ), |
|
| 59 | + ), |
|
| 60 | + 'class' => array ( |
|
| 61 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_formats.class', |
|
| 62 | + 'config' => array ( |
|
| 63 | + 'type' => 'input', |
|
| 64 | + 'size' => 30, |
|
| 65 | + 'max' => 1024, |
|
| 66 | + 'eval' => 'nospace,alphanum_x,unique', |
|
| 67 | + ), |
|
| 68 | + ), |
|
| 69 | + ), |
|
| 70 | + 'types' => array ( |
|
| 71 | + '0' => array ('showitem' => '--div--;LLL:EXT:dlf/locallang.xml:tx_dlf_formats.tab1, type;;;;1-1-1, root;;;;2-2-2, namespace, class;;;;3-3-3'), |
|
| 72 | + ), |
|
| 73 | + 'palettes' => array ( |
|
| 74 | + '1' => array ('showitem' => ''), |
|
| 75 | + ), |
|
| 76 | 76 | ); |
@@ -10,239 +10,239 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | return array ( |
| 13 | - 'ctrl' => array ( |
|
| 14 | - 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata', |
|
| 15 | - 'label' => 'label', |
|
| 16 | - 'tstamp' => 'tstamp', |
|
| 17 | - 'crdate' => 'crdate', |
|
| 18 | - 'cruser_id' => 'cruser_id', |
|
| 19 | - 'languageField' => 'sys_language_uid', |
|
| 20 | - 'transOrigPointerField' => 'l18n_parent', |
|
| 21 | - 'transOrigDiffSourceField' => 'l18n_diffsource', |
|
| 22 | - 'sortby' => 'sorting', |
|
| 23 | - 'delete' => 'deleted', |
|
| 24 | - 'enablecolumns' => array ( |
|
| 25 | - 'disabled' => 'hidden', |
|
| 26 | - ), |
|
| 27 | - 'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('dlf').'res/icons/txdlfmetadata.png', |
|
| 28 | - 'rootLevel' => 0, |
|
| 29 | - 'dividers2tabs' => 2, |
|
| 30 | - 'searchFields' => 'label,index_name', |
|
| 31 | - ), |
|
| 32 | - 'feInterface' => array ( |
|
| 33 | - 'fe_admin_fieldList' => '', |
|
| 34 | - ), |
|
| 35 | - 'interface' => array ( |
|
| 36 | - 'showRecordFieldList' => 'label,index_name,is_sortable,is_facet,is_listed,index_autocomplete', |
|
| 37 | - ), |
|
| 38 | - 'columns' => array ( |
|
| 39 | - 'sys_language_uid' => array ( |
|
| 40 | - 'exclude' => 1, |
|
| 41 | - 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.language', |
|
| 42 | - 'config' => array ( |
|
| 43 | - 'type' => 'select', |
|
| 44 | - 'renderType' => 'selectSingle', |
|
| 45 | - 'foreign_table' => 'sys_language', |
|
| 46 | - 'foreign_table_where' => 'ORDER BY sys_language.title', |
|
| 47 | - 'items' => array ( |
|
| 48 | - array ('LLL:EXT:lang/locallang_general.xml:LGL.allLanguages', -1), |
|
| 49 | - array ('LLL:EXT:lang/locallang_general.xml:LGL.default_value', 0), |
|
| 50 | - ), |
|
| 51 | - 'default' => 0 |
|
| 52 | - ), |
|
| 53 | - ), |
|
| 54 | - 'l18n_parent' => array ( |
|
| 55 | - 'displayCond' => 'FIELD:sys_language_uid:>:0', |
|
| 56 | - 'exclude' => 1, |
|
| 57 | - 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.l18n_parent', |
|
| 58 | - 'config' => array ( |
|
| 59 | - 'type' => 'select', |
|
| 60 | - 'renderType' => 'selectSingle', |
|
| 61 | - 'items' => array ( |
|
| 62 | - array ('', 0), |
|
| 63 | - ), |
|
| 64 | - 'foreign_table' => 'tx_dlf_metadata', |
|
| 65 | - 'foreign_table_where' => 'AND tx_dlf_metadata.pid=###CURRENT_PID### AND tx_dlf_metadata.sys_language_uid IN (-1,0) ORDER BY label ASC', |
|
| 66 | - ), |
|
| 67 | - ), |
|
| 68 | - 'l18n_diffsource' => array ( |
|
| 69 | - 'config' => array ( |
|
| 70 | - 'type' => 'passthrough' |
|
| 71 | - ), |
|
| 72 | - ), |
|
| 73 | - 'hidden' => array ( |
|
| 74 | - 'exclude' => 1, |
|
| 75 | - 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden', |
|
| 76 | - 'config' => array ( |
|
| 77 | - 'type' => 'check', |
|
| 78 | - 'default' => 0, |
|
| 79 | - ), |
|
| 80 | - ), |
|
| 81 | - 'label' => array ( |
|
| 82 | - 'exclude' => 1, |
|
| 83 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.label', |
|
| 84 | - 'config' => array ( |
|
| 85 | - 'type' => 'input', |
|
| 86 | - 'size' => 30, |
|
| 87 | - 'max' => 255, |
|
| 88 | - 'eval' => 'required,trim', |
|
| 89 | - ), |
|
| 90 | - ), |
|
| 91 | - 'index_name' => array ( |
|
| 92 | - 'exclude' => 1, |
|
| 93 | - 'l10n_mode' => 'exclude', |
|
| 94 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.index_name', |
|
| 95 | - 'config' => array ( |
|
| 96 | - 'type' => 'input', |
|
| 97 | - 'size' => 30, |
|
| 98 | - 'max' => 255, |
|
| 99 | - 'eval' => 'required,nospace,alphanum_x,uniqueInPid', |
|
| 100 | - ), |
|
| 101 | - ), |
|
| 102 | - 'format' => array ( |
|
| 103 | - 'exclude' => 1, |
|
| 104 | - 'l10n_mode' => 'exclude', |
|
| 105 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.format', |
|
| 106 | - 'config' => array ( |
|
| 107 | - 'type' => 'inline', |
|
| 108 | - 'foreign_table' => 'tx_dlf_metadataformat', |
|
| 109 | - 'foreign_field' => 'parent_id', |
|
| 110 | - 'foreign_unique' => 'encoded', |
|
| 111 | - 'appearance' => array ( |
|
| 112 | - 'expandSingle' => 1, |
|
| 113 | - 'levelLinksPosition' => 'bottom', |
|
| 114 | - 'enabledControls' => array ( |
|
| 115 | - 'info' => 0, |
|
| 116 | - 'new' => 1, |
|
| 117 | - 'dragdrop' => 0, |
|
| 118 | - 'sort' => 0, |
|
| 119 | - 'hide' => 0, |
|
| 120 | - 'delete' => 1, |
|
| 121 | - 'localize' => 0, |
|
| 122 | - ), |
|
| 123 | - ), |
|
| 124 | - ), |
|
| 125 | - ), |
|
| 126 | - 'default_value' => array ( |
|
| 127 | - 'exclude' => 1, |
|
| 128 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.default_value', |
|
| 129 | - 'config' => array ( |
|
| 130 | - 'type' => 'input', |
|
| 131 | - 'size' => 30, |
|
| 132 | - 'max' => 1024, |
|
| 133 | - 'eval' => 'trim', |
|
| 134 | - ), |
|
| 135 | - ), |
|
| 136 | - 'wrap' => array ( |
|
| 137 | - 'exclude' => 1, |
|
| 138 | - 'l10n_mode' => 'mergeIfNotBlank', |
|
| 139 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.wrap', |
|
| 140 | - 'config' => array ( |
|
| 141 | - 'type' => 'text', |
|
| 142 | - 'cols' => 48, |
|
| 143 | - 'rows' => 20, |
|
| 144 | - 'wrap' => 'off', |
|
| 145 | - 'eval' => 'trim', |
|
| 146 | - 'default' => "key.wrap = <dt>|</dt>\nvalue.required = 1\nvalue.wrap = <dd>|</dd>", |
|
| 147 | - ), |
|
| 148 | - 'defaultExtras' => 'nowrap:fixed-font:enable-tab', |
|
| 149 | - ), |
|
| 150 | - 'index_tokenized' => array ( |
|
| 151 | - 'exclude' => 1, |
|
| 152 | - 'l10n_mode' => 'exclude', |
|
| 153 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.index_tokenized', |
|
| 154 | - 'config' => array ( |
|
| 155 | - 'type' => 'check', |
|
| 156 | - 'default' => 0, |
|
| 157 | - ), |
|
| 158 | - ), |
|
| 159 | - 'index_stored' => array ( |
|
| 160 | - 'exclude' => 1, |
|
| 161 | - 'l10n_mode' => 'exclude', |
|
| 162 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.index_stored', |
|
| 163 | - 'config' => array ( |
|
| 164 | - 'type' => 'check', |
|
| 165 | - 'default' => 0, |
|
| 166 | - ), |
|
| 167 | - ), |
|
| 168 | - 'index_indexed' => array ( |
|
| 169 | - 'exclude' => 1, |
|
| 170 | - 'l10n_mode' => 'exclude', |
|
| 171 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.index_indexed', |
|
| 172 | - 'config' => array ( |
|
| 173 | - 'type' => 'check', |
|
| 174 | - 'default' => 1, |
|
| 175 | - ), |
|
| 176 | - ), |
|
| 177 | - 'index_boost' => array ( |
|
| 178 | - 'exclude' => 1, |
|
| 179 | - 'l10n_mode' => 'exclude', |
|
| 180 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.index_boost', |
|
| 181 | - 'config' => array ( |
|
| 182 | - 'type' => 'input', |
|
| 183 | - 'size' => 5, |
|
| 184 | - 'max' => 64, |
|
| 185 | - 'default' => '1.00', |
|
| 186 | - 'eval' => 'double2', |
|
| 187 | - ), |
|
| 188 | - ), |
|
| 189 | - 'is_sortable' => array ( |
|
| 190 | - 'exclude' => 1, |
|
| 191 | - 'l10n_mode' => 'exclude', |
|
| 192 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.is_sortable', |
|
| 193 | - 'config' => array ( |
|
| 194 | - 'type' => 'check', |
|
| 195 | - 'default' => 0, |
|
| 196 | - ), |
|
| 197 | - ), |
|
| 198 | - 'is_facet' => array ( |
|
| 199 | - 'exclude' => 1, |
|
| 200 | - 'l10n_mode' => 'exclude', |
|
| 201 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.is_facet', |
|
| 202 | - 'config' => array ( |
|
| 203 | - 'type' => 'check', |
|
| 204 | - 'default' => 0, |
|
| 205 | - ), |
|
| 206 | - ), |
|
| 207 | - 'is_listed' => array ( |
|
| 208 | - 'exclude' => 1, |
|
| 209 | - 'l10n_mode' => 'exclude', |
|
| 210 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.is_listed', |
|
| 211 | - 'config' => array ( |
|
| 212 | - 'type' => 'check', |
|
| 213 | - 'default' => 0, |
|
| 214 | - ), |
|
| 215 | - ), |
|
| 216 | - 'index_autocomplete' => array ( |
|
| 217 | - 'exclude' => 1, |
|
| 218 | - 'l10n_mode' => 'exclude', |
|
| 219 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.index_autocomplete', |
|
| 220 | - 'config' => array ( |
|
| 221 | - 'type' => 'check', |
|
| 222 | - 'default' => 0, |
|
| 223 | - ), |
|
| 224 | - ), |
|
| 225 | - 'status' => array ( |
|
| 226 | - 'exclude' => 1, |
|
| 227 | - 'l10n_mode' => 'exclude', |
|
| 228 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.status', |
|
| 229 | - 'config' => array ( |
|
| 230 | - 'type' => 'select', |
|
| 231 | - 'renderType' => 'selectSingle', |
|
| 232 | - 'items' => array ( |
|
| 233 | - array ('LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.status.default', 0), |
|
| 234 | - ), |
|
| 235 | - 'size' => 1, |
|
| 236 | - 'minitems' => 1, |
|
| 237 | - 'maxitems' => 1, |
|
| 238 | - 'default' => 0, |
|
| 239 | - ), |
|
| 240 | - ), |
|
| 241 | - ), |
|
| 242 | - 'types' => array ( |
|
| 243 | - '0' => array ('showitem' => '--div--;LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.tab1, label,--palette--;;1;;1-1-1, format;;;;2-2-2, default_value;;;;3-3-3, wrap, --div--;LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.tab2, sys_language_uid;;;;1-1-1, l18n_parent, l18n_diffsource, --div--;LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.tab3, hidden;;;;1-1-1, status;;;;2-2-2'), |
|
| 244 | - ), |
|
| 245 | - 'palettes' => array ( |
|
| 246 | - '1' => array ('showitem' => 'index_name, --linebreak--, index_tokenized, index_stored, index_indexed, index_boost, --linebreak--, is_sortable, is_facet, is_listed, index_autocomplete', 'canNotCollapse' => 1), |
|
| 247 | - ), |
|
| 13 | + 'ctrl' => array ( |
|
| 14 | + 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata', |
|
| 15 | + 'label' => 'label', |
|
| 16 | + 'tstamp' => 'tstamp', |
|
| 17 | + 'crdate' => 'crdate', |
|
| 18 | + 'cruser_id' => 'cruser_id', |
|
| 19 | + 'languageField' => 'sys_language_uid', |
|
| 20 | + 'transOrigPointerField' => 'l18n_parent', |
|
| 21 | + 'transOrigDiffSourceField' => 'l18n_diffsource', |
|
| 22 | + 'sortby' => 'sorting', |
|
| 23 | + 'delete' => 'deleted', |
|
| 24 | + 'enablecolumns' => array ( |
|
| 25 | + 'disabled' => 'hidden', |
|
| 26 | + ), |
|
| 27 | + 'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('dlf').'res/icons/txdlfmetadata.png', |
|
| 28 | + 'rootLevel' => 0, |
|
| 29 | + 'dividers2tabs' => 2, |
|
| 30 | + 'searchFields' => 'label,index_name', |
|
| 31 | + ), |
|
| 32 | + 'feInterface' => array ( |
|
| 33 | + 'fe_admin_fieldList' => '', |
|
| 34 | + ), |
|
| 35 | + 'interface' => array ( |
|
| 36 | + 'showRecordFieldList' => 'label,index_name,is_sortable,is_facet,is_listed,index_autocomplete', |
|
| 37 | + ), |
|
| 38 | + 'columns' => array ( |
|
| 39 | + 'sys_language_uid' => array ( |
|
| 40 | + 'exclude' => 1, |
|
| 41 | + 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.language', |
|
| 42 | + 'config' => array ( |
|
| 43 | + 'type' => 'select', |
|
| 44 | + 'renderType' => 'selectSingle', |
|
| 45 | + 'foreign_table' => 'sys_language', |
|
| 46 | + 'foreign_table_where' => 'ORDER BY sys_language.title', |
|
| 47 | + 'items' => array ( |
|
| 48 | + array ('LLL:EXT:lang/locallang_general.xml:LGL.allLanguages', -1), |
|
| 49 | + array ('LLL:EXT:lang/locallang_general.xml:LGL.default_value', 0), |
|
| 50 | + ), |
|
| 51 | + 'default' => 0 |
|
| 52 | + ), |
|
| 53 | + ), |
|
| 54 | + 'l18n_parent' => array ( |
|
| 55 | + 'displayCond' => 'FIELD:sys_language_uid:>:0', |
|
| 56 | + 'exclude' => 1, |
|
| 57 | + 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.l18n_parent', |
|
| 58 | + 'config' => array ( |
|
| 59 | + 'type' => 'select', |
|
| 60 | + 'renderType' => 'selectSingle', |
|
| 61 | + 'items' => array ( |
|
| 62 | + array ('', 0), |
|
| 63 | + ), |
|
| 64 | + 'foreign_table' => 'tx_dlf_metadata', |
|
| 65 | + 'foreign_table_where' => 'AND tx_dlf_metadata.pid=###CURRENT_PID### AND tx_dlf_metadata.sys_language_uid IN (-1,0) ORDER BY label ASC', |
|
| 66 | + ), |
|
| 67 | + ), |
|
| 68 | + 'l18n_diffsource' => array ( |
|
| 69 | + 'config' => array ( |
|
| 70 | + 'type' => 'passthrough' |
|
| 71 | + ), |
|
| 72 | + ), |
|
| 73 | + 'hidden' => array ( |
|
| 74 | + 'exclude' => 1, |
|
| 75 | + 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden', |
|
| 76 | + 'config' => array ( |
|
| 77 | + 'type' => 'check', |
|
| 78 | + 'default' => 0, |
|
| 79 | + ), |
|
| 80 | + ), |
|
| 81 | + 'label' => array ( |
|
| 82 | + 'exclude' => 1, |
|
| 83 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.label', |
|
| 84 | + 'config' => array ( |
|
| 85 | + 'type' => 'input', |
|
| 86 | + 'size' => 30, |
|
| 87 | + 'max' => 255, |
|
| 88 | + 'eval' => 'required,trim', |
|
| 89 | + ), |
|
| 90 | + ), |
|
| 91 | + 'index_name' => array ( |
|
| 92 | + 'exclude' => 1, |
|
| 93 | + 'l10n_mode' => 'exclude', |
|
| 94 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.index_name', |
|
| 95 | + 'config' => array ( |
|
| 96 | + 'type' => 'input', |
|
| 97 | + 'size' => 30, |
|
| 98 | + 'max' => 255, |
|
| 99 | + 'eval' => 'required,nospace,alphanum_x,uniqueInPid', |
|
| 100 | + ), |
|
| 101 | + ), |
|
| 102 | + 'format' => array ( |
|
| 103 | + 'exclude' => 1, |
|
| 104 | + 'l10n_mode' => 'exclude', |
|
| 105 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.format', |
|
| 106 | + 'config' => array ( |
|
| 107 | + 'type' => 'inline', |
|
| 108 | + 'foreign_table' => 'tx_dlf_metadataformat', |
|
| 109 | + 'foreign_field' => 'parent_id', |
|
| 110 | + 'foreign_unique' => 'encoded', |
|
| 111 | + 'appearance' => array ( |
|
| 112 | + 'expandSingle' => 1, |
|
| 113 | + 'levelLinksPosition' => 'bottom', |
|
| 114 | + 'enabledControls' => array ( |
|
| 115 | + 'info' => 0, |
|
| 116 | + 'new' => 1, |
|
| 117 | + 'dragdrop' => 0, |
|
| 118 | + 'sort' => 0, |
|
| 119 | + 'hide' => 0, |
|
| 120 | + 'delete' => 1, |
|
| 121 | + 'localize' => 0, |
|
| 122 | + ), |
|
| 123 | + ), |
|
| 124 | + ), |
|
| 125 | + ), |
|
| 126 | + 'default_value' => array ( |
|
| 127 | + 'exclude' => 1, |
|
| 128 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.default_value', |
|
| 129 | + 'config' => array ( |
|
| 130 | + 'type' => 'input', |
|
| 131 | + 'size' => 30, |
|
| 132 | + 'max' => 1024, |
|
| 133 | + 'eval' => 'trim', |
|
| 134 | + ), |
|
| 135 | + ), |
|
| 136 | + 'wrap' => array ( |
|
| 137 | + 'exclude' => 1, |
|
| 138 | + 'l10n_mode' => 'mergeIfNotBlank', |
|
| 139 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.wrap', |
|
| 140 | + 'config' => array ( |
|
| 141 | + 'type' => 'text', |
|
| 142 | + 'cols' => 48, |
|
| 143 | + 'rows' => 20, |
|
| 144 | + 'wrap' => 'off', |
|
| 145 | + 'eval' => 'trim', |
|
| 146 | + 'default' => "key.wrap = <dt>|</dt>\nvalue.required = 1\nvalue.wrap = <dd>|</dd>", |
|
| 147 | + ), |
|
| 148 | + 'defaultExtras' => 'nowrap:fixed-font:enable-tab', |
|
| 149 | + ), |
|
| 150 | + 'index_tokenized' => array ( |
|
| 151 | + 'exclude' => 1, |
|
| 152 | + 'l10n_mode' => 'exclude', |
|
| 153 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.index_tokenized', |
|
| 154 | + 'config' => array ( |
|
| 155 | + 'type' => 'check', |
|
| 156 | + 'default' => 0, |
|
| 157 | + ), |
|
| 158 | + ), |
|
| 159 | + 'index_stored' => array ( |
|
| 160 | + 'exclude' => 1, |
|
| 161 | + 'l10n_mode' => 'exclude', |
|
| 162 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.index_stored', |
|
| 163 | + 'config' => array ( |
|
| 164 | + 'type' => 'check', |
|
| 165 | + 'default' => 0, |
|
| 166 | + ), |
|
| 167 | + ), |
|
| 168 | + 'index_indexed' => array ( |
|
| 169 | + 'exclude' => 1, |
|
| 170 | + 'l10n_mode' => 'exclude', |
|
| 171 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.index_indexed', |
|
| 172 | + 'config' => array ( |
|
| 173 | + 'type' => 'check', |
|
| 174 | + 'default' => 1, |
|
| 175 | + ), |
|
| 176 | + ), |
|
| 177 | + 'index_boost' => array ( |
|
| 178 | + 'exclude' => 1, |
|
| 179 | + 'l10n_mode' => 'exclude', |
|
| 180 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.index_boost', |
|
| 181 | + 'config' => array ( |
|
| 182 | + 'type' => 'input', |
|
| 183 | + 'size' => 5, |
|
| 184 | + 'max' => 64, |
|
| 185 | + 'default' => '1.00', |
|
| 186 | + 'eval' => 'double2', |
|
| 187 | + ), |
|
| 188 | + ), |
|
| 189 | + 'is_sortable' => array ( |
|
| 190 | + 'exclude' => 1, |
|
| 191 | + 'l10n_mode' => 'exclude', |
|
| 192 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.is_sortable', |
|
| 193 | + 'config' => array ( |
|
| 194 | + 'type' => 'check', |
|
| 195 | + 'default' => 0, |
|
| 196 | + ), |
|
| 197 | + ), |
|
| 198 | + 'is_facet' => array ( |
|
| 199 | + 'exclude' => 1, |
|
| 200 | + 'l10n_mode' => 'exclude', |
|
| 201 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.is_facet', |
|
| 202 | + 'config' => array ( |
|
| 203 | + 'type' => 'check', |
|
| 204 | + 'default' => 0, |
|
| 205 | + ), |
|
| 206 | + ), |
|
| 207 | + 'is_listed' => array ( |
|
| 208 | + 'exclude' => 1, |
|
| 209 | + 'l10n_mode' => 'exclude', |
|
| 210 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.is_listed', |
|
| 211 | + 'config' => array ( |
|
| 212 | + 'type' => 'check', |
|
| 213 | + 'default' => 0, |
|
| 214 | + ), |
|
| 215 | + ), |
|
| 216 | + 'index_autocomplete' => array ( |
|
| 217 | + 'exclude' => 1, |
|
| 218 | + 'l10n_mode' => 'exclude', |
|
| 219 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.index_autocomplete', |
|
| 220 | + 'config' => array ( |
|
| 221 | + 'type' => 'check', |
|
| 222 | + 'default' => 0, |
|
| 223 | + ), |
|
| 224 | + ), |
|
| 225 | + 'status' => array ( |
|
| 226 | + 'exclude' => 1, |
|
| 227 | + 'l10n_mode' => 'exclude', |
|
| 228 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.status', |
|
| 229 | + 'config' => array ( |
|
| 230 | + 'type' => 'select', |
|
| 231 | + 'renderType' => 'selectSingle', |
|
| 232 | + 'items' => array ( |
|
| 233 | + array ('LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.status.default', 0), |
|
| 234 | + ), |
|
| 235 | + 'size' => 1, |
|
| 236 | + 'minitems' => 1, |
|
| 237 | + 'maxitems' => 1, |
|
| 238 | + 'default' => 0, |
|
| 239 | + ), |
|
| 240 | + ), |
|
| 241 | + ), |
|
| 242 | + 'types' => array ( |
|
| 243 | + '0' => array ('showitem' => '--div--;LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.tab1, label,--palette--;;1;;1-1-1, format;;;;2-2-2, default_value;;;;3-3-3, wrap, --div--;LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.tab2, sys_language_uid;;;;1-1-1, l18n_parent, l18n_diffsource, --div--;LLL:EXT:dlf/locallang.xml:tx_dlf_metadata.tab3, hidden;;;;1-1-1, status;;;;2-2-2'), |
|
| 244 | + ), |
|
| 245 | + 'palettes' => array ( |
|
| 246 | + '1' => array ('showitem' => 'index_name, --linebreak--, index_tokenized, index_stored, index_indexed, index_boost, --linebreak--, is_sortable, is_facet, is_listed, index_autocomplete', 'canNotCollapse' => 1), |
|
| 247 | + ), |
|
| 248 | 248 | ); |
@@ -10,78 +10,78 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | return array ( |
| 13 | - 'ctrl' => array ( |
|
| 14 | - 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadataformat', |
|
| 15 | - 'label' => 'encoded', |
|
| 16 | - 'tstamp' => 'tstamp', |
|
| 17 | - 'crdate' => 'crdate', |
|
| 18 | - 'cruser_id' => 'cruser_id', |
|
| 19 | - 'default_sortby' => 'ORDER BY encoded', |
|
| 20 | - 'delete' => 'deleted', |
|
| 21 | - 'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('dlf').'res/icons/txdlfmetadata.png', |
|
| 22 | - 'rootLevel' => 0, |
|
| 23 | - 'dividers2tabs' => 2, |
|
| 24 | - 'searchFields' => 'encoded', |
|
| 25 | - 'hideTable' => 1, |
|
| 26 | - ), |
|
| 27 | - 'feInterface' => array ( |
|
| 28 | - 'fe_admin_fieldList' => '', |
|
| 29 | - ), |
|
| 30 | - 'interface' => array ( |
|
| 31 | - 'showRecordFieldList' => 'parent_id,encoded,xpath,xpath_sorting', |
|
| 32 | - ), |
|
| 33 | - 'columns' => array ( |
|
| 34 | - 'parent_id' => array ( |
|
| 35 | - 'config' => array ( |
|
| 36 | - 'type' => 'passthrough', |
|
| 37 | - ), |
|
| 38 | - ), |
|
| 39 | - 'encoded' => array ( |
|
| 40 | - 'exclude' => 1, |
|
| 41 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadataformat.encoded', |
|
| 42 | - 'config' => array ( |
|
| 43 | - 'type' => 'select', |
|
| 44 | - 'renderType' => 'selectSingle', |
|
| 45 | - 'foreign_table' => 'tx_dlf_formats', |
|
| 46 | - 'foreign_table_where' => 'ORDER BY tx_dlf_formats.type', |
|
| 47 | - 'size' => 1, |
|
| 48 | - 'minitems' => 1, |
|
| 49 | - 'maxitems' => 1, |
|
| 50 | - ), |
|
| 51 | - ), |
|
| 52 | - 'xpath' => array ( |
|
| 53 | - 'exclude' => 1, |
|
| 54 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadataformat.xpath', |
|
| 55 | - 'config' => array ( |
|
| 56 | - 'type' => 'input', |
|
| 57 | - 'size' => 30, |
|
| 58 | - 'max' => 1024, |
|
| 59 | - 'eval' => 'required,trim', |
|
| 60 | - ), |
|
| 61 | - ), |
|
| 62 | - 'xpath_sorting' => array ( |
|
| 63 | - 'exclude' => 1, |
|
| 64 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadataformat.xpath_sorting', |
|
| 65 | - 'config' => array ( |
|
| 66 | - 'type' => 'input', |
|
| 67 | - 'size' => 30, |
|
| 68 | - 'max' => 1024, |
|
| 69 | - 'eval' => 'trim', |
|
| 70 | - ), |
|
| 71 | - ), |
|
| 72 | - 'mandatory' => array ( |
|
| 73 | - 'exclude' => 1, |
|
| 74 | - 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadataformat.mandatory', |
|
| 75 | - 'config' => array ( |
|
| 76 | - 'type' => 'check', |
|
| 77 | - 'default' => 0, |
|
| 78 | - ), |
|
| 79 | - ), |
|
| 80 | - ), |
|
| 81 | - 'types' => array ( |
|
| 82 | - '0' => array ('showitem' => '--div--;LLL:EXT:dlf/locallang.xml:tx_dlf_metadataformat.tab1, encoded;;;;1-1-1, xpath;;;;2-2-2, xpath_sorting, mandatory;;;;3-3-3'), |
|
| 83 | - ), |
|
| 84 | - 'palettes' => array ( |
|
| 85 | - '1' => array ('showitem' => ''), |
|
| 86 | - ), |
|
| 13 | + 'ctrl' => array ( |
|
| 14 | + 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadataformat', |
|
| 15 | + 'label' => 'encoded', |
|
| 16 | + 'tstamp' => 'tstamp', |
|
| 17 | + 'crdate' => 'crdate', |
|
| 18 | + 'cruser_id' => 'cruser_id', |
|
| 19 | + 'default_sortby' => 'ORDER BY encoded', |
|
| 20 | + 'delete' => 'deleted', |
|
| 21 | + 'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('dlf').'res/icons/txdlfmetadata.png', |
|
| 22 | + 'rootLevel' => 0, |
|
| 23 | + 'dividers2tabs' => 2, |
|
| 24 | + 'searchFields' => 'encoded', |
|
| 25 | + 'hideTable' => 1, |
|
| 26 | + ), |
|
| 27 | + 'feInterface' => array ( |
|
| 28 | + 'fe_admin_fieldList' => '', |
|
| 29 | + ), |
|
| 30 | + 'interface' => array ( |
|
| 31 | + 'showRecordFieldList' => 'parent_id,encoded,xpath,xpath_sorting', |
|
| 32 | + ), |
|
| 33 | + 'columns' => array ( |
|
| 34 | + 'parent_id' => array ( |
|
| 35 | + 'config' => array ( |
|
| 36 | + 'type' => 'passthrough', |
|
| 37 | + ), |
|
| 38 | + ), |
|
| 39 | + 'encoded' => array ( |
|
| 40 | + 'exclude' => 1, |
|
| 41 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadataformat.encoded', |
|
| 42 | + 'config' => array ( |
|
| 43 | + 'type' => 'select', |
|
| 44 | + 'renderType' => 'selectSingle', |
|
| 45 | + 'foreign_table' => 'tx_dlf_formats', |
|
| 46 | + 'foreign_table_where' => 'ORDER BY tx_dlf_formats.type', |
|
| 47 | + 'size' => 1, |
|
| 48 | + 'minitems' => 1, |
|
| 49 | + 'maxitems' => 1, |
|
| 50 | + ), |
|
| 51 | + ), |
|
| 52 | + 'xpath' => array ( |
|
| 53 | + 'exclude' => 1, |
|
| 54 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadataformat.xpath', |
|
| 55 | + 'config' => array ( |
|
| 56 | + 'type' => 'input', |
|
| 57 | + 'size' => 30, |
|
| 58 | + 'max' => 1024, |
|
| 59 | + 'eval' => 'required,trim', |
|
| 60 | + ), |
|
| 61 | + ), |
|
| 62 | + 'xpath_sorting' => array ( |
|
| 63 | + 'exclude' => 1, |
|
| 64 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadataformat.xpath_sorting', |
|
| 65 | + 'config' => array ( |
|
| 66 | + 'type' => 'input', |
|
| 67 | + 'size' => 30, |
|
| 68 | + 'max' => 1024, |
|
| 69 | + 'eval' => 'trim', |
|
| 70 | + ), |
|
| 71 | + ), |
|
| 72 | + 'mandatory' => array ( |
|
| 73 | + 'exclude' => 1, |
|
| 74 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadataformat.mandatory', |
|
| 75 | + 'config' => array ( |
|
| 76 | + 'type' => 'check', |
|
| 77 | + 'default' => 0, |
|
| 78 | + ), |
|
| 79 | + ), |
|
| 80 | + ), |
|
| 81 | + 'types' => array ( |
|
| 82 | + '0' => array ('showitem' => '--div--;LLL:EXT:dlf/locallang.xml:tx_dlf_metadataformat.tab1, encoded;;;;1-1-1, xpath;;;;2-2-2, xpath_sorting, mandatory;;;;3-3-3'), |
|
| 83 | + ), |
|
| 84 | + 'palettes' => array ( |
|
| 85 | + '1' => array ('showitem' => ''), |
|
| 86 | + ), |
|
| 87 | 87 | ); |