[TASK] Remove superfluous parenthesis in sysexts
[Packages/TYPO3.CMS.git] / typo3 / sysext / indexed_search / Classes / Example / PluginHook.php
1 <?php
2 namespace TYPO3\CMS\IndexedSearch\Example;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 2001-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
8 * All rights reserved
9 *
10 * This script is part of the TYPO3 project. The TYPO3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 * A copy is found in the textfile GPL.txt and important notices to the license
19 * from the author is found in LICENSE.txt distributed with these scripts.
20 *
21 *
22 * This script is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * This copyright notice MUST APPEAR in all copies of the script!
28 ***************************************************************/
29 /**
30 * Index search frontend example hook
31 *
32 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
33 */
34 /**
35 * Index search frontend - EXAMPLE hook for alternative searching / display etc.
36 * Hooks are configured in ext_localconf.php as key => hook-reference pairs in $TYPO3_CONF_VARS['EXTCONF']['indexed_search']['pi1_hooks']. See example in ext_localconf.php for "indexed_search"
37 * Each hook must have an entry, the key must match the hook-key in class.tx_indexed_search.php and generally the key equals the function name in the hook object (a convension used)
38 *
39 * @package TYPO3
40 * @subpackage tx_indexedsearch
41 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
42 */
43 class PluginHook {
44
45 /**
46 * @todo Define visibility
47 */
48 public $pObj;
49
50 // Is set to a reference to the parent object, "pi1/class.indexedsearch.php"
51 /**
52 * EXAMPLE of how you can post process the initialized values in the frontend plugin.
53 * The example reverses the order of elements in the ranking selector box. You can modify other values like this or add / remove items.
54 *
55 * This hook is activated by this key / value pair in ext_localconf.php
56 * 'initialize_postProc' => 'EXT:indexed_search/example/class.pihook.php:&tx_indexedsearch_pihook',
57 *
58 * @return void
59 * @todo Define visibility
60 */
61 public function initialize_postProc() {
62 $this->pObj->optValues['order'] = array_reverse($this->pObj->optValues['order']);
63 }
64
65 /**
66 * Providing an alternative search algorithm!
67 *
68 * @param array Array of search words
69 * @return array Array of first row, result rows, count
70 * @todo Define visibility
71 */
72 public function getResultRows($sWArr) {
73
74 }
75
76 /**
77 * Example of how the content displayed in the result rows can be post processed before rendered into HTML.
78 * This example simply shows how the description field is wrapped in italics and the path is hidden by setting it blank.
79 *
80 * @param array Template Content (generated from result row) being processed.
81 * @param array Result row
82 * @param boolean If set, the result row is a sub-row.
83 * @return array Template Content returned.
84 * @todo Define visibility
85 */
86 public function prepareResultRowTemplateData_postProc($tmplContent, $row, $headerOnly) {
87 $tmplContent['description'] = '<em>' . $tmplContent['description'] . '</em>';
88 $tmplContent['path'] = '';
89 return $tmplContent;
90 }
91
92 }
93
94
95 ?>