Completed
Push — issue/103 ( 39a4ee )
by Tomas Norre
12:28
created
modfunc1/class.tx_crawler_modfunc1.php 2 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1054,8 +1054,9 @@  discard block
 block discarded – undo
1054 1054
 		$isAvailable = false;
1055 1055
 		$userArray = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField('be_users', 'username', '_cli_crawler');
1056 1056
 
1057
-		if (is_array($userArray))
1058
-			$isAvailable = true;
1057
+		if (is_array($userArray)) {
1058
+					$isAvailable = true;
1059
+		}
1059 1060
 
1060 1061
 		return $isAvailable;
1061 1062
 	}
@@ -1073,8 +1074,9 @@  discard block
 block discarded – undo
1073 1074
 		$isAvailable = false;
1074 1075
 		$userArray = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField('be_users', 'username', '_cli_crawler');
1075 1076
 
1076
-		if (is_array($userArray) && $userArray[0]['admin'] == 0)
1077
-			$isAvailable = true;
1077
+		if (is_array($userArray) && $userArray[0]['admin'] == 0) {
1078
+					$isAvailable = true;
1079
+		}
1078 1080
 
1079 1081
 		return $isAvailable;
1080 1082
 	}
Please login to merge, or discard this patch.
Indentation   +916 added lines, -916 removed lines patch added patch discarded remove patch
@@ -40,126 +40,126 @@  discard block
 block discarded – undo
40 40
  * @subpackage tx_crawler
41 41
  */
42 42
 class tx_crawler_modfunc1 extends \TYPO3\CMS\Backend\Module\AbstractFunctionModule {
43
-		// Internal, dynamic:
44
-	var $duplicateTrack = array();
45
-	var $submitCrawlUrls = FALSE;
46
-	var $downloadCrawlUrls = FALSE;
43
+        // Internal, dynamic:
44
+    var $duplicateTrack = array();
45
+    var $submitCrawlUrls = FALSE;
46
+    var $downloadCrawlUrls = FALSE;
47 47
 
48
-	var $scheduledTime = 0;
49
-	var $reqMinute = 0;
48
+    var $scheduledTime = 0;
49
+    var $reqMinute = 0;
50 50
 
51
-	/**
52
-	 * @var array holds the selection of configuration from the configuration selector box
53
-	 */
54
-	var $incomingConfigurationSelection = array();
51
+    /**
52
+     * @var array holds the selection of configuration from the configuration selector box
53
+     */
54
+    var $incomingConfigurationSelection = array();
55 55
 
56
-	/**
57
-	 * @var tx_crawler_lib
58
-	 */
59
-	var $crawlerObj;
56
+    /**
57
+     * @var tx_crawler_lib
58
+     */
59
+    var $crawlerObj;
60 60
 
61
-	var $CSVaccu = array();
61
+    var $CSVaccu = array();
62 62
 
63
-	/**
64
-	 * If true the user requested a CSV export of the queue
65
-	 *
66
-	 * @var boolean
67
-	 */
68
-	var $CSVExport = FALSE;
69
-
70
-	var $downloadUrls = array();
63
+    /**
64
+     * If true the user requested a CSV export of the queue
65
+     *
66
+     * @var boolean
67
+     */
68
+    var $CSVExport = FALSE;
71 69
 
72
-	/**
73
-	 * Holds the configuration from ext_conf_template loaded by loadExtensionSettings()
74
-	 *
75
-	 * @var array
76
-	 */
77
-	protected $extensionSettings = array();
70
+    var $downloadUrls = array();
78 71
 
79
-	/**
80
-	 * Indicate that an flash message with an error is present.
81
-	 *
82
-	 * @var boolean
83
-	 */
84
-	protected $isErrorDetected = false;
85
-
86
-	/**
87
-	 * the constructor
88
-	 */
89
-	public function __construct() {
90
-		$this->processManager = new tx_crawler_domain_process_manager();
91
-	}
92
-
93
-	/**
94
-	 * Additions to the function menu array
95
-	 *
96
-	 * @return	array		Menu array
97
-	 */
98
-	function modMenu()	{
99
-		global $LANG;
100
-
101
-		return array (
102
-			'depth' => array(
103
-				0 => $LANG->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_0'),
104
-				1 => $LANG->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_1'),
105
-				2 => $LANG->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_2'),
106
-				3 => $LANG->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_3'),
107
-				4 => $LANG->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_4'),
108
-				99 => $LANG->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_infi'),
109
-			),
110
-			'crawlaction' => array(
111
-				'start' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.start'),
112
-				'log' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.log'),
113
-				'multiprocess' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.multiprocess')
114
-			),
115
-			'log_resultLog' => '',
116
-			'log_feVars' => '',
117
-			'processListMode' => '',
118
-			'log_display' => array(
119
-				'all' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.all'),
120
-				'pending' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.pending'),
121
-				'finished' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.finished')
122
-			),
123
-			'itemsPerPage' => array(
124
-				'5' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage.5'),
125
-				'10' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage.10'),
126
-				'50' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage.50'),
127
-				'0' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage.0')
128
-			)
129
-		);
130
-	}
72
+    /**
73
+     * Holds the configuration from ext_conf_template loaded by loadExtensionSettings()
74
+     *
75
+     * @var array
76
+     */
77
+    protected $extensionSettings = array();
131 78
 
132
-	/**
133
-	 * Load extension settings
134
-	 *
135
-	 * @param void
136
-	 * @return void
137
-	 */
138
-	protected function loadExtensionSettings() {
139
-		$this->extensionSettings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['crawler']);
140
-	}
141
-
142
-	/**
143
-	 * Main function
144
-	 *
145
-	 * @return	string		HTML output
146
-	 */
147
-	function main() {
148
-		global $LANG, $BACK_PATH;
79
+    /**
80
+     * Indicate that an flash message with an error is present.
81
+     *
82
+     * @var boolean
83
+     */
84
+    protected $isErrorDetected = false;
85
+
86
+    /**
87
+     * the constructor
88
+     */
89
+    public function __construct() {
90
+        $this->processManager = new tx_crawler_domain_process_manager();
91
+    }
92
+
93
+    /**
94
+     * Additions to the function menu array
95
+     *
96
+     * @return	array		Menu array
97
+     */
98
+    function modMenu()	{
99
+        global $LANG;
100
+
101
+        return array (
102
+            'depth' => array(
103
+                0 => $LANG->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_0'),
104
+                1 => $LANG->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_1'),
105
+                2 => $LANG->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_2'),
106
+                3 => $LANG->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_3'),
107
+                4 => $LANG->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_4'),
108
+                99 => $LANG->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_infi'),
109
+            ),
110
+            'crawlaction' => array(
111
+                'start' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.start'),
112
+                'log' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.log'),
113
+                'multiprocess' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.multiprocess')
114
+            ),
115
+            'log_resultLog' => '',
116
+            'log_feVars' => '',
117
+            'processListMode' => '',
118
+            'log_display' => array(
119
+                'all' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.all'),
120
+                'pending' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.pending'),
121
+                'finished' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.finished')
122
+            ),
123
+            'itemsPerPage' => array(
124
+                '5' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage.5'),
125
+                '10' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage.10'),
126
+                '50' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage.50'),
127
+                '0' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage.0')
128
+            )
129
+        );
130
+    }
131
+
132
+    /**
133
+     * Load extension settings
134
+     *
135
+     * @param void
136
+     * @return void
137
+     */
138
+    protected function loadExtensionSettings() {
139
+        $this->extensionSettings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['crawler']);
140
+    }
141
+
142
+    /**
143
+     * Main function
144
+     *
145
+     * @return	string		HTML output
146
+     */
147
+    function main() {
148
+        global $LANG, $BACK_PATH;
149 149
 
150
-		$this->incLocalLang();
150
+        $this->incLocalLang();
151 151
 
152
-		$this->loadExtensionSettings();
153
-		if (empty($this->pObj->MOD_SETTINGS['processListMode'])) {
154
-			$this->pObj->MOD_SETTINGS['processListMode'] = 'simple';
155
-		}
152
+        $this->loadExtensionSettings();
153
+        if (empty($this->pObj->MOD_SETTINGS['processListMode'])) {
154
+            $this->pObj->MOD_SETTINGS['processListMode'] = 'simple';
155
+        }
156 156
 
157
-			// Set CSS styles specific for this document:
158
-		$this->pObj->content = str_replace('/*###POSTCSSMARKER###*/','
157
+            // Set CSS styles specific for this document:
158
+        $this->pObj->content = str_replace('/*###POSTCSSMARKER###*/','
159 159
 			TABLE.c-list TR TD { white-space: nowrap; vertical-align: top; }
160 160
 		',$this->pObj->content);
161 161
 
162
-		$this->pObj->content .= '<style type="text/css"><!--
162
+        $this->pObj->content .= '<style type="text/css"><!--
163 163
 			table.url-table,
164 164
 			table.param-expanded,
165 165
 			table.crawlerlog {
@@ -177,16 +177,16 @@  discard block
 block discarded – undo
177 177
 		<link rel="stylesheet" type="text/css" href="'.$BACK_PATH.'../typo3conf/ext/crawler/template/res.css" />
178 178
 		';
179 179
 
180
-			// Type function menu:
181
-		$h_func = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu(
182
-			$this->pObj->id,
183
-			'SET[crawlaction]',
184
-			$this->pObj->MOD_SETTINGS['crawlaction'],
185
-			$this->pObj->MOD_MENU['crawlaction'],
186
-			'index.php'
187
-		);
180
+            // Type function menu:
181
+        $h_func = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu(
182
+            $this->pObj->id,
183
+            'SET[crawlaction]',
184
+            $this->pObj->MOD_SETTINGS['crawlaction'],
185
+            $this->pObj->MOD_MENU['crawlaction'],
186
+            'index.php'
187
+        );
188 188
 
189
-		/*
189
+        /*
190 190
 			// Showing depth-menu in certain cases:
191 191
 		if ($this->pObj->MOD_SETTINGS['crawlaction']!=='cli' && $this->pObj->MOD_SETTINGS['crawlaction']!== 'multiprocess' && ($this->pObj->MOD_SETTINGS['crawlaction']!=='log' || $this->pObj->id))	{
192 192
 			$h_func .= \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu(
@@ -199,62 +199,62 @@  discard block
 block discarded – undo
199 199
 		}
200 200
 		*/
201 201
 
202
-			// Additional menus for the log type:
203
-		if ($this->pObj->MOD_SETTINGS['crawlaction']==='log')	{
204
-			$h_func .= \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu(
205
-				$this->pObj->id,
206
-				'SET[depth]',
207
-				$this->pObj->MOD_SETTINGS['depth'],
208
-				$this->pObj->MOD_MENU['depth'],
209
-				'index.php'
210
-			);
202
+            // Additional menus for the log type:
203
+        if ($this->pObj->MOD_SETTINGS['crawlaction']==='log')	{
204
+            $h_func .= \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu(
205
+                $this->pObj->id,
206
+                'SET[depth]',
207
+                $this->pObj->MOD_SETTINGS['depth'],
208
+                $this->pObj->MOD_MENU['depth'],
209
+                'index.php'
210
+            );
211
+
212
+            $quiPart = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details') ? '&qid_details=' . intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) : '';
213
+
214
+            $setId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID'));
215
+
216
+            $h_func.= '<hr/>'.
217
+                    $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.display').': '.\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->pObj->id,'SET[log_display]',$this->pObj->MOD_SETTINGS['log_display'],$this->pObj->MOD_MENU['log_display'],'index.php','&setID='.$setId) . ' - ' .
218
+                    $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showresultlog').': '.\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id,'SET[log_resultLog]',$this->pObj->MOD_SETTINGS['log_resultLog'],'index.php','&setID='.$setId . $quiPart) . ' - ' .
219
+                    $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showfevars').': '.\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id,'SET[log_feVars]',$this->pObj->MOD_SETTINGS['log_feVars'],'index.php','&setID='.$setId . $quiPart) . ' - ' .
220
+                    $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage').': ' .
221
+                    \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu(
222
+                        $this->pObj->id,
223
+                        'SET[itemsPerPage]',
224
+                        $this->pObj->MOD_SETTINGS['itemsPerPage'],
225
+                        $this->pObj->MOD_MENU['itemsPerPage'],
226
+                        'index.php'
227
+                    );
228
+        }
211 229
 
212
-			$quiPart = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details') ? '&qid_details=' . intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) : '';
213
-
214
-			$setId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID'));
215
-
216
-			$h_func.= '<hr/>'.
217
-					$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.display').': '.\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->pObj->id,'SET[log_display]',$this->pObj->MOD_SETTINGS['log_display'],$this->pObj->MOD_MENU['log_display'],'index.php','&setID='.$setId) . ' - ' .
218
-					$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showresultlog').': '.\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id,'SET[log_resultLog]',$this->pObj->MOD_SETTINGS['log_resultLog'],'index.php','&setID='.$setId . $quiPart) . ' - ' .
219
-					$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showfevars').': '.\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id,'SET[log_feVars]',$this->pObj->MOD_SETTINGS['log_feVars'],'index.php','&setID='.$setId . $quiPart) . ' - ' .
220
-					$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage').': ' .
221
-					\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu(
222
-						$this->pObj->id,
223
-						'SET[itemsPerPage]',
224
-						$this->pObj->MOD_SETTINGS['itemsPerPage'],
225
-						$this->pObj->MOD_MENU['itemsPerPage'],
226
-						'index.php'
227
-					);
228
-		}
230
+        $theOutput = $this->pObj->doc->section($LANG->getLL('title'), $h_func, 0, 1);
229 231
 
230
-		$theOutput = $this->pObj->doc->section($LANG->getLL('title'), $h_func, 0, 1);
231
-
232
-			// Branch based on type:
233
-		switch ((string)$this->pObj->MOD_SETTINGS['crawlaction']) {
234
-			case 'start':
235
-				if (empty($this->pObj->id)) {
236
-					$this->addErrorMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noPageSelected'));
237
-				} else {
238
-					$theOutput .= $this->pObj->doc->section('', $this->drawURLs(), 0, 1);
239
-				}
240
-				break;
241
-			case 'log':
242
-				if (empty($this->pObj->id)) {
243
-					$this->addErrorMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noPageSelected'));
244
-				} else {
245
-					$theOutput .= $this->pObj->doc->section('', $this->drawLog(), 0, 1);
246
-				}
247
-				break;
248
-			case 'cli':
249
-				$theOutput .= $this->pObj->doc->section('', $this->drawCLIstatus(), 0, 1);
250
-				break;
251
-			case 'multiprocess':
252
-				$theOutput .= $this->pObj->doc->section('', $this->drawProcessOverviewAction(), 0, 1);
253
-				break;
254
-		}
232
+            // Branch based on type:
233
+        switch ((string)$this->pObj->MOD_SETTINGS['crawlaction']) {
234
+            case 'start':
235
+                if (empty($this->pObj->id)) {
236
+                    $this->addErrorMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noPageSelected'));
237
+                } else {
238
+                    $theOutput .= $this->pObj->doc->section('', $this->drawURLs(), 0, 1);
239
+                }
240
+                break;
241
+            case 'log':
242
+                if (empty($this->pObj->id)) {
243
+                    $this->addErrorMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noPageSelected'));
244
+                } else {
245
+                    $theOutput .= $this->pObj->doc->section('', $this->drawLog(), 0, 1);
246
+                }
247
+                break;
248
+            case 'cli':
249
+                $theOutput .= $this->pObj->doc->section('', $this->drawCLIstatus(), 0, 1);
250
+                break;
251
+            case 'multiprocess':
252
+                $theOutput .= $this->pObj->doc->section('', $this->drawProcessOverviewAction(), 0, 1);
253
+                break;
254
+        }
255 255
 
256
-		return $theOutput;
257
-	}
256
+        return $theOutput;
257
+    }
258 258
 
259 259
 
260 260
 
@@ -267,176 +267,176 @@  discard block
 block discarded – undo
267 267
 
268 268
 
269 269
 
270
-	/*******************************
270
+    /*******************************
271 271
 	 *
272 272
 	 * Generate URLs for crawling:
273 273
 	 *
274 274
 	 ******************************/
275 275
 
276
-	/**
277
-	 * Produces a table with overview of the URLs to be crawled for each page
278
-	 *
279
-	 * @return	string		HTML output
280
-	 */
281
-	function drawURLs()	{
282
-		global $BACK_PATH, $BE_USER;
283
-
284
-			// Init:
285
-		$this->duplicateTrack = array();
286
-		$this->submitCrawlUrls = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('_crawl');
287
-		$this->downloadCrawlUrls = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('_download');
288
-		$this->makeCrawlerProcessableChecks();
289
-
290
-		switch((string)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('tstamp'))	{
291
-			case 'midnight':
292
-				$this->scheduledTime = mktime(0,0,0);
293
-			break;
294
-			case '04:00':
295
-				$this->scheduledTime = mktime(0,0,0)+4*3600;
296
-			break;
297
-			case 'now':
298
-			default:
299
-				$this->scheduledTime = time();
300
-			break;
301
-		}
302
-		// $this->reqMinute = \TYPO3\CMS\Core\Utility\GeneralUtility::intInRange(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('perminute'),1,10000);
303
-		// TODO: check relevance
304
-		$this->reqMinute = 1000;
276
+    /**
277
+     * Produces a table with overview of the URLs to be crawled for each page
278
+     *
279
+     * @return	string		HTML output
280
+     */
281
+    function drawURLs()	{
282
+        global $BACK_PATH, $BE_USER;
283
+
284
+            // Init:
285
+        $this->duplicateTrack = array();
286
+        $this->submitCrawlUrls = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('_crawl');
287
+        $this->downloadCrawlUrls = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('_download');
288
+        $this->makeCrawlerProcessableChecks();
289
+
290
+        switch((string)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('tstamp'))	{
291
+            case 'midnight':
292
+                $this->scheduledTime = mktime(0,0,0);
293
+            break;
294
+            case '04:00':
295
+                $this->scheduledTime = mktime(0,0,0)+4*3600;
296
+            break;
297
+            case 'now':
298
+            default:
299
+                $this->scheduledTime = time();
300
+            break;
301
+        }
302
+        // $this->reqMinute = \TYPO3\CMS\Core\Utility\GeneralUtility::intInRange(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('perminute'),1,10000);
303
+        // TODO: check relevance
304
+        $this->reqMinute = 1000;
305 305
 
306 306
 
307
-		$this->incomingConfigurationSelection = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('configurationSelection');
308
-		$this->incomingConfigurationSelection = is_array($this->incomingConfigurationSelection) ? $this->incomingConfigurationSelection : array('');
307
+        $this->incomingConfigurationSelection = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('configurationSelection');
308
+        $this->incomingConfigurationSelection = is_array($this->incomingConfigurationSelection) ? $this->incomingConfigurationSelection : array('');
309 309
 
310
-		$this->crawlerObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_lib');
311
-		$this->crawlerObj->setAccessMode('gui');
312
-		$this->crawlerObj->setID = \TYPO3\CMS\Core\Utility\GeneralUtility::md5int(microtime());
310
+        $this->crawlerObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_lib');
311
+        $this->crawlerObj->setAccessMode('gui');
312
+        $this->crawlerObj->setID = \TYPO3\CMS\Core\Utility\GeneralUtility::md5int(microtime());
313 313
 
314
-		if (empty($this->incomingConfigurationSelection)
315
-			|| (count($this->incomingConfigurationSelection)==1 && empty($this->incomingConfigurationSelection[0]))
316
-			) {
317
-			$code= '
314
+        if (empty($this->incomingConfigurationSelection)
315
+            || (count($this->incomingConfigurationSelection)==1 && empty($this->incomingConfigurationSelection[0]))
316
+            ) {
317
+            $code= '
318 318
 			<tr>
319 319
 				<td colspan="7"><b>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noConfigSelected').'</b></td>
320 320
 			</tr>';
321
-		} else {
322
-			if($this->submitCrawlUrls){
323
-				$reason = new tx_crawler_domain_reason();
324
-				$reason->setReason(tx_crawler_domain_reason::REASON_GUI_SUBMIT);
321
+        } else {
322
+            if($this->submitCrawlUrls){
323
+                $reason = new tx_crawler_domain_reason();
324
+                $reason->setReason(tx_crawler_domain_reason::REASON_GUI_SUBMIT);
325
+
326
+                if($BE_USER instanceof \TYPO3\CMS\Core\Authentication\BackendUserAuthentication){ $username = $BE_USER->user['username']; }
327
+                $reason->setDetailText('The user '.$username.' added pages to the crawler queue manually ');
328
+
329
+                tx_crawler_domain_events_dispatcher::getInstance()->post(	'invokeQueueChange',
330
+                                                                            $this->findCrawler()->setID,
331
+                                                                            array(	'reason' => $reason ));
332
+            }
333
+
334
+            $code = $this->crawlerObj->getPageTreeAndUrls(
335
+                $this->pObj->id,
336
+                $this->pObj->MOD_SETTINGS['depth'],
337
+                $this->scheduledTime,
338
+                $this->reqMinute,
339
+                $this->submitCrawlUrls,
340
+                $this->downloadCrawlUrls,
341
+                array(), // Do not filter any processing instructions
342
+                $this->incomingConfigurationSelection
343
+            );
325 344
 
326
-				if($BE_USER instanceof \TYPO3\CMS\Core\Authentication\BackendUserAuthentication){ $username = $BE_USER->user['username']; }
327
-				$reason->setDetailText('The user '.$username.' added pages to the crawler queue manually ');
328 345
 
329
-				tx_crawler_domain_events_dispatcher::getInstance()->post(	'invokeQueueChange',
330
-																			$this->findCrawler()->setID,
331
-																			array(	'reason' => $reason ));
332
-			}
333
-
334
-			$code = $this->crawlerObj->getPageTreeAndUrls(
335
-				$this->pObj->id,
336
-				$this->pObj->MOD_SETTINGS['depth'],
337
-				$this->scheduledTime,
338
-				$this->reqMinute,
339
-				$this->submitCrawlUrls,
340
-				$this->downloadCrawlUrls,
341
-				array(), // Do not filter any processing instructions
342
-				$this->incomingConfigurationSelection
343
-			);
344
-
345
-
346
-		}
346
+        }
347 347
 
348
-		$this->downloadUrls = $this->crawlerObj->downloadUrls;
349
-		$this->duplicateTrack = $this->crawlerObj->duplicateTrack;
348
+        $this->downloadUrls = $this->crawlerObj->downloadUrls;
349
+        $this->duplicateTrack = $this->crawlerObj->duplicateTrack;
350 350
 
351
-		$output = '';
352
-		if ($code)	{
351
+        $output = '';
352
+        if ($code)	{
353 353
 
354
-			$output .= '<h3>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.configuration').':</h3>';
355
-			$output .= '<input type="hidden" name="id" value="'.intval($this->pObj->id).'" />';
354
+            $output .= '<h3>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.configuration').':</h3>';
355
+            $output .= '<input type="hidden" name="id" value="'.intval($this->pObj->id).'" />';
356 356
 
357
-			if (!$this->submitCrawlUrls)	{
358
-				$output .= $this->drawURLs_cfgSelectors().'<br />';
359
-				$output .= '<input type="submit" name="_update" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerUpdate').'" /> ';
360
-				$output .= '<input type="submit" name="_crawl" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerCrawl').'" /> ';
361
-				$output .= '<input type="submit" name="_download" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerDownload').'" /><br /><br />';
362
-				$output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.count').': '.count(array_keys($this->duplicateTrack)).'<br />';
363
-				$output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime').': '.date('H:i:s',time()).'<br />';
364
-				$output .= '<br />
357
+            if (!$this->submitCrawlUrls)	{
358
+                $output .= $this->drawURLs_cfgSelectors().'<br />';
359
+                $output .= '<input type="submit" name="_update" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerUpdate').'" /> ';
360
+                $output .= '<input type="submit" name="_crawl" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerCrawl').'" /> ';
361
+                $output .= '<input type="submit" name="_download" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerDownload').'" /><br /><br />';
362
+                $output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.count').': '.count(array_keys($this->duplicateTrack)).'<br />';
363
+                $output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime').': '.date('H:i:s',time()).'<br />';
364
+                $output .= '<br />
365 365
 					<table class="lrPadding c-list url-table">'.
366
-						$this->drawURLs_printTableHeader().
367
-						$code.
368
-					'</table>';
369
-			} else {
370
-				$output .= count(array_keys($this->duplicateTrack)).' '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.submitted').'. <br /><br />';
371
-				$output .= '<input type="submit" name="_" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.continue').'" />';
372
-				$output .= '<input type="submit" onclick="this.form.elements[\'SET[crawlaction]\'].value=\'log\';" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.continueinlog').'" />';
373
-			}
374
-		}
375
-
376
-			// Download Urls to crawl:
377
-		if ($this->downloadCrawlUrls)	{
378
-
379
-				// Creating output header:
380
-			$mimeType = 'application/octet-stream';
381
-			Header('Content-Type: '.$mimeType);
382
-			Header('Content-Disposition: attachment; filename=CrawlerUrls.txt');
383
-
384
-				// Printing the content of the CSV lines:
385
-			echo implode(chr(13).chr(10),$this->downloadUrls);
366
+                        $this->drawURLs_printTableHeader().
367
+                        $code.
368
+                    '</table>';
369
+            } else {
370
+                $output .= count(array_keys($this->duplicateTrack)).' '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.submitted').'. <br /><br />';
371
+                $output .= '<input type="submit" name="_" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.continue').'" />';
372
+                $output .= '<input type="submit" onclick="this.form.elements[\'SET[crawlaction]\'].value=\'log\';" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.continueinlog').'" />';
373
+            }
374
+        }
386 375
 
387
-				// Exits:
388
-			exit;
389
-		}
376
+            // Download Urls to crawl:
377
+        if ($this->downloadCrawlUrls)	{
390 378
 
391
-			// Return output:
392
-		return 	$output;
393
-	}
379
+                // Creating output header:
380
+            $mimeType = 'application/octet-stream';
381
+            Header('Content-Type: '.$mimeType);
382
+            Header('Content-Disposition: attachment; filename=CrawlerUrls.txt');
394 383
 
395
-	/**
396
-	 * Draws the configuration selectors for compiling URLs:
397
-	 *
398
-	 * @return	string		HTML table
399
-	 */
400
-	function drawURLs_cfgSelectors()	{
384
+                // Printing the content of the CSV lines:
385
+            echo implode(chr(13).chr(10),$this->downloadUrls);
401 386
 
402
-			// depth
403
-		$cell[] = $this->selectorBox(
404
-			array(
405
-				0 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_0'),
406
-				1 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_1'),
407
-				2 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_2'),
408
-				3 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_3'),
409
-				4 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_4'),
410
-				99 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_infi'),
411
-			),
412
-			'SET[depth]',
413
-			$this->pObj->MOD_SETTINGS['depth'],
414
-			0
415
-		);
416
-		$availableConfigurations = $this->crawlerObj->getConfigurationsForBranch($this->pObj->id, $this->pObj->MOD_SETTINGS['depth']?$this->pObj->MOD_SETTINGS['depth']:0 );
417
-
418
-			// Configurations
419
-		$cell[] = $this->selectorBox(
420
-			empty($availableConfigurations)?array():array_combine($availableConfigurations, $availableConfigurations),
421
-			'configurationSelection',
422
-			$this->incomingConfigurationSelection,
423
-			1
424
-		);
387
+                // Exits:
388
+            exit;
389
+        }
425 390
 
426
-			// Scheduled time:
427
-		$cell[] = $this->selectorBox(
428
-			array(
429
-				'now' => $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.time.now'),
430
-				'midnight' => $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.time.midnight'),
431
-				'04:00' => $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.time.4am'),
432
-			),
433
-			'tstamp',
434
-			\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('tstamp'),
435
-			0
436
-		);
391
+            // Return output:
392
+        return 	$output;
393
+    }
437 394
 
438
-		// TODO: check relevance
439
-		/*
395
+    /**
396
+     * Draws the configuration selectors for compiling URLs:
397
+     *
398
+     * @return	string		HTML table
399
+     */
400
+    function drawURLs_cfgSelectors()	{
401
+
402
+            // depth
403
+        $cell[] = $this->selectorBox(
404
+            array(
405
+                0 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_0'),
406
+                1 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_1'),
407
+                2 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_2'),
408
+                3 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_3'),
409
+                4 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_4'),
410
+                99 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_infi'),
411
+            ),
412
+            'SET[depth]',
413
+            $this->pObj->MOD_SETTINGS['depth'],
414
+            0
415
+        );
416
+        $availableConfigurations = $this->crawlerObj->getConfigurationsForBranch($this->pObj->id, $this->pObj->MOD_SETTINGS['depth']?$this->pObj->MOD_SETTINGS['depth']:0 );
417
+
418
+            // Configurations
419
+        $cell[] = $this->selectorBox(
420
+            empty($availableConfigurations)?array():array_combine($availableConfigurations, $availableConfigurations),
421
+            'configurationSelection',
422
+            $this->incomingConfigurationSelection,
423
+            1
424
+        );
425
+
426
+            // Scheduled time:
427
+        $cell[] = $this->selectorBox(
428
+            array(
429
+                'now' => $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.time.now'),
430
+                'midnight' => $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.time.midnight'),
431
+                '04:00' => $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.time.4am'),
432
+            ),
433
+            'tstamp',
434
+            \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('tstamp'),
435
+            0
436
+        );
437
+
438
+        // TODO: check relevance
439
+        /*
440 440
 			// Requests per minute:
441 441
 		$cell[] = $this->selectorBox(
442 442
 			array(
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 		);
458 458
 		*/
459 459
 
460
-		$output = '
460
+        $output = '
461 461
 			<table class="lrPadding c-list">
462 462
 				<tr class="bgColor5 tableheader">
463 463
 					<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.depth').':</td>
@@ -470,17 +470,17 @@  discard block
 block discarded – undo
470 470
 				</tr>
471 471
 			</table>';
472 472
 
473
-		return $output;
474
-	}
473
+        return $output;
474
+    }
475 475
 
476
-	/**
477
-	 * Create Table header row for URL display
478
-	 *
479
-	 * @return	string		Table header
480
-	 */
481
-	function drawURLs_printTableHeader()	{
476
+    /**
477
+     * Create Table header row for URL display
478
+     *
479
+     * @return	string		Table header
480
+     */
481
+    function drawURLs_printTableHeader()	{
482 482
 
483
-		$content = '
483
+        $content = '
484 484
 			<tr class="bgColor5 tableheader">
485 485
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.pagetitle').':</td>
486 486
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.key').':</td>
@@ -491,8 +491,8 @@  discard block
 block discarded – undo
491 491
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.parameters').':</td>
492 492
 			</tr>';
493 493
 
494
-		return $content;
495
-	}
494
+        return $content;
495
+    }
496 496
 
497 497
 
498 498
 
@@ -505,75 +505,75 @@  discard block
 block discarded – undo
505 505
 
506 506
 
507 507
 
508
-	/*******************************
508
+    /*******************************
509 509
 	 *
510 510
 	 * Shows log of indexed URLs
511 511
 	 *
512 512
 	 ******************************/
513 513
 
514
-	/**
515
-	 * Shows the log of indexed URLs
516
-	 *
517
-	 * @return	string		HTML output
518
-	 */
519
-	function drawLog()	{
520
-		global $BACK_PATH;
521
-		$output = '';
522
-
523
-			// Init:
524
-		$this->crawlerObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_lib');
525
-		$this->crawlerObj->setAccessMode('gui');
526
-		$this->crawlerObj->setID = \TYPO3\CMS\Core\Utility\GeneralUtility::md5int(microtime());
527
-
528
-		$this->CSVExport = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_csv');
529
-
530
-			// Read URL:
531
-		if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_read')) {
532
-			$this->crawlerObj->readUrl(intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_read')),TRUE);
533
-		}
514
+    /**
515
+     * Shows the log of indexed URLs
516
+     *
517
+     * @return	string		HTML output
518
+     */
519
+    function drawLog()	{
520
+        global $BACK_PATH;
521
+        $output = '';
522
+
523
+            // Init:
524
+        $this->crawlerObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_lib');
525
+        $this->crawlerObj->setAccessMode('gui');
526
+        $this->crawlerObj->setID = \TYPO3\CMS\Core\Utility\GeneralUtility::md5int(microtime());
527
+
528
+        $this->CSVExport = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_csv');
529
+
530
+            // Read URL:
531
+        if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_read')) {
532
+            $this->crawlerObj->readUrl(intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_read')),TRUE);
533
+        }
534 534
 
535
-			// Look for set ID sent - if it is, we will display contents of that set:
536
-		$showSetId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID'));
535
+            // Look for set ID sent - if it is, we will display contents of that set:
536
+        $showSetId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID'));
537 537
 
538
-			// Show details:
539
-		if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details'))	{
538
+            // Show details:
539
+        if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details'))	{
540 540
 
541
-				// Get entry record:
542
-			list($q_entry) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*','tx_crawler_queue','qid='.intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')));
541
+                // Get entry record:
542
+            list($q_entry) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*','tx_crawler_queue','qid='.intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')));
543 543
 
544
-				// Explode values:
545
-				$resStatus = $this->getResStatus($q_entry);
546
-			$q_entry['parameters'] = unserialize($q_entry['parameters']);
547
-			$q_entry['result_data'] = unserialize($q_entry['result_data']);
548
-			if (is_array($q_entry['result_data']))	{
549
-				$q_entry['result_data']['content'] = unserialize($q_entry['result_data']['content']);
550
-			}
544
+                // Explode values:
545
+                $resStatus = $this->getResStatus($q_entry);
546
+            $q_entry['parameters'] = unserialize($q_entry['parameters']);
547
+            $q_entry['result_data'] = unserialize($q_entry['result_data']);
548
+            if (is_array($q_entry['result_data']))	{
549
+                $q_entry['result_data']['content'] = unserialize($q_entry['result_data']['content']);
550
+            }
551 551
 
552
-			if(!$this->pObj->MOD_SETTINGS['log_resultLog']) {
553
-				unset($q_entry['result_data']['content']['log']);
554
-			}
552
+            if(!$this->pObj->MOD_SETTINGS['log_resultLog']) {
553
+                unset($q_entry['result_data']['content']['log']);
554
+            }
555 555
 
556
-				// Print rudimentary details:
557
-			$output .= '
556
+                // Print rudimentary details:
557
+            $output .= '
558 558
 				<br /><br />
559 559
 				<input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.back') . '" name="_back" />
560 560
 				<input type="hidden" value="' . $this->pObj->id . '" name="id" />
561 561
 				<input type="hidden" value="' . $showSetId . '" name="setID" />
562 562
 				<br />
563 563
 				Current server time: ' . date('H:i:s', time()) . '<br />' .
564
-				'Status: ' . $resStatus . '<br />' .
565
-				\TYPO3\CMS\Core\Utility\DebugUtility::viewArray($q_entry);
566
-		} else {	// Show list:
567
-
568
-				// If either id or set id, show list:
569
-			if ($this->pObj->id || $showSetId)	{
570
-				if ($this->pObj->id)	{
571
-						// Drawing tree:
572
-					$tree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Backend\Tree\View\PageTreeView');
573
-					$perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
574
-					$tree->init('AND '.$perms_clause);
575
-
576
-						// Set root row:
564
+                'Status: ' . $resStatus . '<br />' .
565
+                \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($q_entry);
566
+        } else {	// Show list:
567
+
568
+                // If either id or set id, show list:
569
+            if ($this->pObj->id || $showSetId)	{
570
+                if ($this->pObj->id)	{
571
+                        // Drawing tree:
572
+                    $tree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Backend\Tree\View\PageTreeView');
573
+                    $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
574
+                    $tree->init('AND '.$perms_clause);
575
+
576
+                        // Set root row:
577 577
                     if (VersionNumberUtility::convertVersionNumberToInteger(VersionNumberUtility::getCurrentTypo3Version()) < 8000000) {
578 578
                         $HTML = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord(
579 579
                             'pages',
@@ -583,39 +583,39 @@  discard block
 block discarded – undo
583 583
                         $iconFactory = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Imaging\\IconFactory');
584 584
                         $HTML = $iconFactory->getIconForRecord('pages', $this->pObj->pageinfo, Icon::SIZE_SMALL)->render();
585 585
                     }
586
-					$tree->tree[] = Array(
587
-						'row' => $this->pObj->pageinfo,
588
-						'HTML' => $HTML
589
-					);
590
-
591
-						// Get branch beneath:
592
-					if ($this->pObj->MOD_SETTINGS['depth'])	{
593
-						$tree->getTree($this->pObj->id, $this->pObj->MOD_SETTINGS['depth'], '');
594
-					}
595
-
596
-						// Traverse page tree:
597
-					$code = ''; $count = 0;
598
-					foreach($tree->tree as $data)	{
599
-						$code .= $this->drawLog_addRows(
600
-									$data['row'],
601
-									$data['HTML'] . \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages',$data['row'],TRUE),
602
-									intval($this->pObj->MOD_SETTINGS['itemsPerPage'])
603
-								);
604
-						if (++$count == 1000) {
605
-							break;
606
-						}
607
-					}
608
-				} else {
609
-					$code = '';
610
-					$code.= $this->drawLog_addRows(
611
-								$showSetId,
612
-								'Set ID: '.$showSetId
613
-							);
614
-				}
615
-
616
-				if ($code)	{
617
-
618
-					$output .= '
586
+                    $tree->tree[] = Array(
587
+                        'row' => $this->pObj->pageinfo,
588
+                        'HTML' => $HTML
589
+                    );
590
+
591
+                        // Get branch beneath:
592
+                    if ($this->pObj->MOD_SETTINGS['depth'])	{
593
+                        $tree->getTree($this->pObj->id, $this->pObj->MOD_SETTINGS['depth'], '');
594
+                    }
595
+
596
+                        // Traverse page tree:
597
+                    $code = ''; $count = 0;
598
+                    foreach($tree->tree as $data)	{
599
+                        $code .= $this->drawLog_addRows(
600
+                                    $data['row'],
601
+                                    $data['HTML'] . \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages',$data['row'],TRUE),
602
+                                    intval($this->pObj->MOD_SETTINGS['itemsPerPage'])
603
+                                );
604
+                        if (++$count == 1000) {
605
+                            break;
606
+                        }
607
+                    }
608
+                } else {
609
+                    $code = '';
610
+                    $code.= $this->drawLog_addRows(
611
+                                $showSetId,
612
+                                'Set ID: '.$showSetId
613
+                            );
614
+                }
615
+
616
+                if ($code)	{
617
+
618
+                    $output .= '
619 619
 						<br /><br />
620 620
 						<input type="submit" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.reloadlist').'" name="_reload" />
621 621
 						<input type="submit" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.downloadcsv').'" name="_csv" />
@@ -629,20 +629,20 @@  discard block
 block discarded – undo
629 629
 
630 630
 
631 631
 						<table class="lrPadding c-list crawlerlog">'.
632
-							$this->drawLog_printTableHeader().
633
-							$code.
634
-						'</table>';
635
-				}
636
-			} else {	// Otherwise show available sets:
637
-				$setList = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
638
-								'set_id, count(*) as count_value, scheduled',
639
-								'tx_crawler_queue',
640
-								'',
641
-								'set_id, scheduled',
642
-								'scheduled DESC'
643
-							);
644
-
645
-				$code = '
632
+                            $this->drawLog_printTableHeader().
633
+                            $code.
634
+                        '</table>';
635
+                }
636
+            } else {	// Otherwise show available sets:
637
+                $setList = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
638
+                                'set_id, count(*) as count_value, scheduled',
639
+                                'tx_crawler_queue',
640
+                                '',
641
+                                'set_id, scheduled',
642
+                                'scheduled DESC'
643
+                            );
644
+
645
+                $code = '
646 646
 					<tr class="bgColor5 tableheader">
647 647
 						<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.setid').':</td>
648 648
 						<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.count').'t:</td>
@@ -650,9 +650,9 @@  discard block
 block discarded – undo
650 650
 					</tr>
651 651
 				';
652 652
 
653
-				$cc=0;
654
-				foreach($setList as $set)	{
655
-					$code.= '
653
+                $cc=0;
654
+                foreach($setList as $set)	{
655
+                    $code.= '
656 656
 						<tr class="bgColor'.($cc%2 ? '-20':'-10').'">
657 657
 							<td><a href="'.htmlspecialchars('index.php?setID='.$set['set_id']).'">'.$set['set_id'].'</a></td>
658 658
 							<td>'.$set['count_value'].'</td>
@@ -660,218 +660,218 @@  discard block
 block discarded – undo
660 660
 						</tr>
661 661
 					';
662 662
 
663
-					$cc++;
664
-				}
663
+                    $cc++;
664
+                }
665 665
 
666
-				$output .= '
666
+                $output .= '
667 667
 					<br /><br />
668 668
 					<table class="lrPadding c-list">'.
669
-						$code.
670
-					'</table>';
671
-			}
672
-		}
669
+                        $code.
670
+                    '</table>';
671
+            }
672
+        }
673 673
 
674
-		if($this->CSVExport) {
675
-			$this->outputCsvFile();
676
-		}
674
+        if($this->CSVExport) {
675
+            $this->outputCsvFile();
676
+        }
677 677
 
678
-			// Return output
679
-		return 	$output;
680
-	}
678
+            // Return output
679
+        return 	$output;
680
+    }
681 681
 
682
-	/**
683
-	 * Outputs the CSV file and sets the correct headers
684
-	 */
685
-	protected function outputCsvFile() {
682
+    /**
683
+     * Outputs the CSV file and sets the correct headers
684
+     */
685
+    protected function outputCsvFile() {
686 686
 
687
-		if (!count($this->CSVaccu)) {
688
-			$this->addWarningMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.canNotExportEmptyQueueToCsvText'));
689
-			return;
690
-		}
687
+        if (!count($this->CSVaccu)) {
688
+            $this->addWarningMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.canNotExportEmptyQueueToCsvText'));
689
+            return;
690
+        }
691 691
 
692
-		$csvLines = array();
692
+        $csvLines = array();
693 693
 
694
-			// Field names:
695
-		reset($this->CSVaccu);
696
-		$fieldNames = array_keys(current($this->CSVaccu));
697
-		$csvLines[] = \TYPO3\CMS\Core\Utility\GeneralUtility::csvValues($fieldNames);
694
+            // Field names:
695
+        reset($this->CSVaccu);
696
+        $fieldNames = array_keys(current($this->CSVaccu));
697
+        $csvLines[] = \TYPO3\CMS\Core\Utility\GeneralUtility::csvValues($fieldNames);
698 698
 
699
-			// Data:
700
-		foreach($this->CSVaccu as $row)	{
701
-			$csvLines[] = \TYPO3\CMS\Core\Utility\GeneralUtility::csvValues($row);
702
-		}
699
+            // Data:
700
+        foreach($this->CSVaccu as $row)	{
701
+            $csvLines[] = \TYPO3\CMS\Core\Utility\GeneralUtility::csvValues($row);
702
+        }
703 703
 
704
-			// Creating output header:
705
-		$mimeType = 'application/octet-stream';
706
-		Header('Content-Type: '.$mimeType);
707
-		Header('Content-Disposition: attachment; filename=CrawlerLog.csv');
704
+            // Creating output header:
705
+        $mimeType = 'application/octet-stream';
706
+        Header('Content-Type: '.$mimeType);
707
+        Header('Content-Disposition: attachment; filename=CrawlerLog.csv');
708 708
 
709
-			// Printing the content of the CSV lines:
710
-		echo implode(chr(13).chr(10),$csvLines);
709
+            // Printing the content of the CSV lines:
710
+        echo implode(chr(13).chr(10),$csvLines);
711 711
 
712
-			// Exits:
713
-		exit;
714
-	}
712
+            // Exits:
713
+        exit;
714
+    }
715 715
 
716
-	/**
717
-	 * Create the rows for display of the page tree
718
-	 * For each page a number of rows are shown displaying GET variable configuration
719
-	 *
720
-	 * @param array $pageRow_setId Page row or set-id
721
-	 * @param string $titleString Title string
722
-	 * @param int $itemsPerPage Items per Page setting
716
+    /**
717
+     * Create the rows for display of the page tree
718
+     * For each page a number of rows are shown displaying GET variable configuration
723 719
      *
724
-	 * @return string HTML <tr> content (one or more)
725
-	 */
726
-	function drawLog_addRows($pageRow_setId, $titleString, $itemsPerPage=10) {
727
-
728
-			// If Flush button is pressed, flush tables instead of selecting entries:
729
-
730
-		if(\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_flush')) {
731
-			$doFlush = true;
732
-			$doFullFlush = false;
733
-		} elseif(\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_flush_all')) {
734
-			$doFlush = true;
735
-			$doFullFlush = true;
736
-		} else {
737
-			$doFlush = false;
738
-			$doFullFlush = false;
739
-		}
720
+     * @param array $pageRow_setId Page row or set-id
721
+     * @param string $titleString Title string
722
+     * @param int $itemsPerPage Items per Page setting
723
+     *
724
+     * @return string HTML <tr> content (one or more)
725
+     */
726
+    function drawLog_addRows($pageRow_setId, $titleString, $itemsPerPage=10) {
727
+
728
+            // If Flush button is pressed, flush tables instead of selecting entries:
729
+
730
+        if(\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_flush')) {
731
+            $doFlush = true;
732
+            $doFullFlush = false;
733
+        } elseif(\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_flush_all')) {
734
+            $doFlush = true;
735
+            $doFullFlush = true;
736
+        } else {
737
+            $doFlush = false;
738
+            $doFullFlush = false;
739
+        }
740 740
 
741
-			// Get result:
742
-		if (is_array($pageRow_setId))	{
743
-			$res = $this->crawlerObj->getLogEntriesForPageId($pageRow_setId['uid'], $this->pObj->MOD_SETTINGS['log_display'], $doFlush, $doFullFlush, intval($itemsPerPage));
744
-		} else {
745
-			$res = $this->crawlerObj->getLogEntriesForSetId($pageRow_setId, $this->pObj->MOD_SETTINGS['log_display'], $doFlush, $doFullFlush, intval($itemsPerPage));
746
-		}
741
+            // Get result:
742
+        if (is_array($pageRow_setId))	{
743
+            $res = $this->crawlerObj->getLogEntriesForPageId($pageRow_setId['uid'], $this->pObj->MOD_SETTINGS['log_display'], $doFlush, $doFullFlush, intval($itemsPerPage));
744
+        } else {
745
+            $res = $this->crawlerObj->getLogEntriesForSetId($pageRow_setId, $this->pObj->MOD_SETTINGS['log_display'], $doFlush, $doFullFlush, intval($itemsPerPage));
746
+        }
747
+
748
+            // Init var:
749
+        $colSpan = 9
750
+                + ($this->pObj->MOD_SETTINGS['log_resultLog'] ? -1 : 0)
751
+                + ($this->pObj->MOD_SETTINGS['log_feVars'] ? 3 : 0);
752
+
753
+        if (count($res))	{
754
+                // Traverse parameter combinations:
755
+            $c = 0;
756
+            $content='';
757
+            foreach($res as $kk => $vv)	{
758
+
759
+                    // Title column:
760
+                if (!$c)	{
761
+                    $titleClm = '<td rowspan="'.count($res).'">'.$titleString.'</td>';
762
+                } else {
763
+                    $titleClm = '';
764
+                }
765
+
766
+                    // Result:
767
+                $resLog = $this->getResultLog($vv);
768
+
769
+                $resStatus = $this->getResStatus($vv);
770
+                $resFeVars = $this->getResFeVars($vv);
771
+
772
+                    // Compile row:
773
+                $parameters = unserialize($vv['parameters']);
774
+
775
+                    // Put data into array:
776
+                $rowData = array();
777
+                if ($this->pObj->MOD_SETTINGS['log_resultLog'])	{
778
+                    $rowData['result_log'] = $resLog;
779
+                } else {
780
+                    $rowData['scheduled'] = ($vv['scheduled']> 0) ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']) : ' '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.immediate');
781
+                    $rowData['exec_time'] = $vv['exec_time'] ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['exec_time']) : '-';
782
+                }
783
+                $rowData['result_status'] = \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($resStatus,50);
784
+                $rowData['url'] = '<a href="'.htmlspecialchars($parameters['url']).'" target="_newWIndow">'.htmlspecialchars($parameters['url']).'</a>';
785
+                $rowData['feUserGroupList'] = $parameters['feUserGroupList'];
786
+                $rowData['procInstructions'] = is_array($parameters['procInstructions']) ? implode('; ',$parameters['procInstructions']) : '';
787
+                $rowData['set_id'] = $vv['set_id'];
788
+
789
+                if ($this->pObj->MOD_SETTINGS['log_feVars']) {
790
+                    $rowData['tsfe_id'] = $resFeVars['id'];
791
+                    $rowData['tsfe_gr_list'] = $resFeVars['gr_list'];
792
+                    $rowData['tsfe_no_cache'] = $resFeVars['no_cache'];
793
+                }
747 794
 
748
-			// Init var:
749
-		$colSpan = 9
750
-				+ ($this->pObj->MOD_SETTINGS['log_resultLog'] ? -1 : 0)
751
-				+ ($this->pObj->MOD_SETTINGS['log_feVars'] ? 3 : 0);
752
-
753
-		if (count($res))	{
754
-				// Traverse parameter combinations:
755
-			$c = 0;
756
-			$content='';
757
-			foreach($res as $kk => $vv)	{
758
-
759
-					// Title column:
760
-				if (!$c)	{
761
-					$titleClm = '<td rowspan="'.count($res).'">'.$titleString.'</td>';
762
-				} else {
763
-					$titleClm = '';
764
-				}
765
-
766
-					// Result:
767
-				$resLog = $this->getResultLog($vv);
768
-
769
-				$resStatus = $this->getResStatus($vv);
770
-				$resFeVars = $this->getResFeVars($vv);
771
-
772
-					// Compile row:
773
-				$parameters = unserialize($vv['parameters']);
774
-
775
-					// Put data into array:
776
-				$rowData = array();
777
-				if ($this->pObj->MOD_SETTINGS['log_resultLog'])	{
778
-					$rowData['result_log'] = $resLog;
779
-				} else {
780
-					$rowData['scheduled'] = ($vv['scheduled']> 0) ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']) : ' '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.immediate');
781
-					$rowData['exec_time'] = $vv['exec_time'] ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['exec_time']) : '-';
782
-				}
783
-				$rowData['result_status'] = \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($resStatus,50);
784
-				$rowData['url'] = '<a href="'.htmlspecialchars($parameters['url']).'" target="_newWIndow">'.htmlspecialchars($parameters['url']).'</a>';
785
-				$rowData['feUserGroupList'] = $parameters['feUserGroupList'];
786
-				$rowData['procInstructions'] = is_array($parameters['procInstructions']) ? implode('; ',$parameters['procInstructions']) : '';
787
-				$rowData['set_id'] = $vv['set_id'];
788
-
789
-				if ($this->pObj->MOD_SETTINGS['log_feVars']) {
790
-					$rowData['tsfe_id'] = $resFeVars['id'];
791
-					$rowData['tsfe_gr_list'] = $resFeVars['gr_list'];
792
-					$rowData['tsfe_no_cache'] = $resFeVars['no_cache'];
793
-				}
794
-
795
-				$setId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID'));
796
-
797
-				$refreshIcon = $GLOBALS['BACK_PATH'] . 'gfx/refresh_n.gif';
798
-				if (version_compare(TYPO3_version,'7.0','>=')) {
799
-					$refreshIcon = $GLOBALS['BACK_PATH'] . 'sysext/t3skin/extjs/images/grid/refresh.gif';
800
-				}
801
-
802
-					// Put rows together:
803
-				$content.= '
795
+                $setId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID'));
796
+
797
+                $refreshIcon = $GLOBALS['BACK_PATH'] . 'gfx/refresh_n.gif';
798
+                if (version_compare(TYPO3_version,'7.0','>=')) {
799
+                    $refreshIcon = $GLOBALS['BACK_PATH'] . 'sysext/t3skin/extjs/images/grid/refresh.gif';
800
+                }
801
+
802
+                    // Put rows together:
803
+                $content.= '
804 804
 					<tr class="bgColor'.($c%2 ? '-20':'-10').'">
805 805
 						'.$titleClm.'
806 806
 						<td><a href="' . $this->getModuleUrl(array('qid_details' => $vv['qid'], 'setID' => $setId)) . '">'.htmlspecialchars($vv['qid']).'</a></td>
807 807
 						<td><a href="' . $this->getModuleUrl(array('qid_read' => $vv['qid'], 'setID' => $setId)) . '"><img src="' . $refreshIcon . '" width="14" hspace="1" vspace="2" height="14" border="0" title="'.htmlspecialchars('Read').'" alt="" /></a></td>';
808
-				foreach($rowData as $fKey => $value) {
808
+                foreach($rowData as $fKey => $value) {
809 809
 
810
-					if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('url',$fKey))	{
811
-						$content.= '
810
+                    if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('url',$fKey))	{
811
+                        $content.= '
812 812
 						<td>'.$value.'</td>';
813
-					} else {
814
-						$content.= '
813
+                    } else {
814
+                        $content.= '
815 815
 						<td>'.nl2br(htmlspecialchars($value)).'</td>';
816
-					}
817
-				}
818
-				$content.= '
816
+                    }
817
+                }
818
+                $content.= '
819 819
 					</tr>';
820
-				$c++;
821
-
822
-				if ($this->CSVExport)	{
823
-						// Only for CSV (adding qid and scheduled/exec_time if needed):
824
-					$rowData['result_log'] = implode('// ',explode(chr(10),$resLog));
825
-					$rowData['qid'] = $vv['qid'];
826
-					$rowData['scheduled'] = \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']);
827
-					$rowData['exec_time'] = $vv['exec_time'] ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['exec_time']) : '-';
828
-					$this->CSVaccu[] = $rowData;
829
-				}
830
-			}
831
-		} else {
820
+                $c++;
821
+
822
+                if ($this->CSVExport)	{
823
+                        // Only for CSV (adding qid and scheduled/exec_time if needed):
824
+                    $rowData['result_log'] = implode('// ',explode(chr(10),$resLog));
825
+                    $rowData['qid'] = $vv['qid'];
826
+                    $rowData['scheduled'] = \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']);
827
+                    $rowData['exec_time'] = $vv['exec_time'] ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['exec_time']) : '-';
828
+                    $this->CSVaccu[] = $rowData;
829
+                }
830
+            }
831
+        } else {
832 832
 
833
-				// Compile row:
834
-			$content = '
833
+                // Compile row:
834
+            $content = '
835 835
 				<tr class="bgColor-20">
836 836
 					<td>'.$titleString.'</td>
837 837
 					<td colspan="'.$colSpan.'"><em>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noentries').'</em></td>
838 838
 				</tr>';
839
-		}
839
+        }
840 840
 
841
-		return $content;
842
-	}
841
+        return $content;
842
+    }
843 843
 
844
-	/**
845
-	 * Find Fe vars
846
-	 *
847
-	 * @param array $row
848
-	 * @return array
849
-	 */
850
-	function getResFeVars($row) {
851
-		$feVars = array();
852
-
853
-		if ($row['result_data']) {
854
-			$resultData = unserialize($row['result_data']);
855
-			$requestResult = unserialize($resultData['content']);
856
-			$feVars = $requestResult['vars'];
857
-		}
844
+    /**
845
+     * Find Fe vars
846
+     *
847
+     * @param array $row
848
+     * @return array
849
+     */
850
+    function getResFeVars($row) {
851
+        $feVars = array();
852
+
853
+        if ($row['result_data']) {
854
+            $resultData = unserialize($row['result_data']);
855
+            $requestResult = unserialize($resultData['content']);
856
+            $feVars = $requestResult['vars'];
857
+        }
858 858
 
859
-		return $feVars;
860
-	}
859
+        return $feVars;
860
+    }
861 861
 
862
-	/**
863
-	 * Create Table header row (log)
864
-	 *
865
-	 * @return	string		Table header
866
-	 */
867
-	function drawLog_printTableHeader()	{
862
+    /**
863
+     * Create Table header row (log)
864
+     *
865
+     * @return	string		Table header
866
+     */
867
+    function drawLog_printTableHeader()	{
868 868
 
869
-		$content = '
869
+        $content = '
870 870
 			<tr class="bgColor5 tableheader">
871 871
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.pagetitle').':</td>
872 872
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.qid').':</td>
873 873
 				<td>&nbsp;</td>'.
874
-				($this->pObj->MOD_SETTINGS['log_resultLog'] ? '
874
+                ($this->pObj->MOD_SETTINGS['log_resultLog'] ? '
875 875
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.resultlog').':</td>' : '
876 876
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.scheduledtime').':</td>
877 877
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.runtime').':</td>').'
@@ -880,14 +880,14 @@  discard block
 block discarded – undo
880 880
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.groups').':</td>
881 881
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.procinstr').':</td>
882 882
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.setid').':</td>'.
883
-				($this->pObj->MOD_SETTINGS['log_feVars'] ? '
883
+                ($this->pObj->MOD_SETTINGS['log_feVars'] ? '
884 884
 				<td>'.htmlspecialchars('TSFE->id').'</td>
885 885
 				<td>'.htmlspecialchars('TSFE->gr_list').'</td>
886 886
 				<td>'.htmlspecialchars('TSFE->no_cache').'</td>' : '').'
887 887
 			</tr>';
888 888
 
889
-		return $content;
890
-	}
889
+        return $content;
890
+    }
891 891
 
892 892
         /**
893 893
          * Extract the log information from the current row and retrive it as formatted string.
@@ -914,25 +914,25 @@  discard block
 block discarded – undo
914 914
                 return $content;
915 915
         }
916 916
 
917
-	function getResStatus($vv) {
918
-		if ($vv['result_data'])	{
919
-			$requestContent = unserialize($vv['result_data']);
920
-			$requestResult = unserialize($requestContent['content']);
921
-			if (is_array($requestResult)) {
922
-				if (empty($requestResult['errorlog'])) {
923
-					$resStatus = 'OK';
924
-				} else {
925
-					$resStatus = implode("\n", $requestResult['errorlog']);
926
-				}
927
-				$resLog = is_array($requestResult['log']) ?  implode(chr(10),$requestResult['log']) : '';
928
-			} else {
929
-				$resStatus = 'Error: '.substr(preg_replace('/\s+/',' ',strip_tags($requestContent['content'])),0,10000).'...';
930
-			}
931
-		} else {
932
-			$resStatus = '-';
933
-		}
934
-		return $resStatus;
935
-	}
917
+    function getResStatus($vv) {
918
+        if ($vv['result_data'])	{
919
+            $requestContent = unserialize($vv['result_data']);
920
+            $requestResult = unserialize($requestContent['content']);
921
+            if (is_array($requestResult)) {
922
+                if (empty($requestResult['errorlog'])) {
923
+                    $resStatus = 'OK';
924
+                } else {
925
+                    $resStatus = implode("\n", $requestResult['errorlog']);
926
+                }
927
+                $resLog = is_array($requestResult['log']) ?  implode(chr(10),$requestResult['log']) : '';
928
+            } else {
929
+                $resStatus = 'Error: '.substr(preg_replace('/\s+/',' ',strip_tags($requestContent['content'])),0,10000).'...';
930
+            }
931
+        } else {
932
+            $resStatus = '-';
933
+        }
934
+        return $resStatus;
935
+    }
936 936
 
937 937
 
938 938
 
@@ -941,344 +941,344 @@  discard block
 block discarded – undo
941 941
 
942 942
 
943 943
 
944
-	/*****************************
944
+    /*****************************
945 945
 	 *
946 946
 	 * CLI status display
947 947
 	 *
948 948
 	 *****************************/
949 949
 
950
-	/**
951
-	 * This method is used to show an overview about the active an the finished crawling processes
952
-	 *
953
-	 * @author Timo Schmidt
954
-	 * @param void
955
-	 * @return string
956
-	 */
957
-	protected function drawProcessOverviewAction(){
958
-
959
-		$this->runRefreshHooks();
960
-
961
-		global $BACK_PATH;
962
-		$this->makeCrawlerProcessableChecks();
963
-
964
-		$crawler = $this->findCrawler();
965
-		try {
966
-			$this->handleProcessOverviewActions();
967
-		} catch (Exception $e) {
968
-			$this->addErrorMessage($e->getMessage());
969
-		}
950
+    /**
951
+     * This method is used to show an overview about the active an the finished crawling processes
952
+     *
953
+     * @author Timo Schmidt
954
+     * @param void
955
+     * @return string
956
+     */
957
+    protected function drawProcessOverviewAction(){
958
+
959
+        $this->runRefreshHooks();
960
+
961
+        global $BACK_PATH;
962
+        $this->makeCrawlerProcessableChecks();
963
+
964
+        $crawler = $this->findCrawler();
965
+        try {
966
+            $this->handleProcessOverviewActions();
967
+        } catch (Exception $e) {
968
+            $this->addErrorMessage($e->getMessage());
969
+        }
970 970
 
971
-		$offset 	= intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('offset'));
972
-		$perpage 	= 20;
971
+        $offset 	= intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('offset'));
972
+        $perpage 	= 20;
973 973
 
974
-		$processRepository	= new tx_crawler_domain_process_repository();
975
-		$queueRepository	= new tx_crawler_domain_queue_repository();
974
+        $processRepository	= new tx_crawler_domain_process_repository();
975
+        $queueRepository	= new tx_crawler_domain_queue_repository();
976 976
 
977
-		$mode = $this->pObj->MOD_SETTINGS['processListMode'];
978
-		if ($mode == 'detail') {
979
-			$where = '';
980
-		} elseif($mode == 'simple') {
981
-			$where = 'active = 1';
982
-		}
977
+        $mode = $this->pObj->MOD_SETTINGS['processListMode'];
978
+        if ($mode == 'detail') {
979
+            $where = '';
980
+        } elseif($mode == 'simple') {
981
+            $where = 'active = 1';
982
+        }
983 983
 
984
-		$allProcesses 		= $processRepository->findAll('ttl','DESC', $perpage, $offset,$where);
985
-		$allCount			= $processRepository->countAll($where);
986
-
987
-		$listView			= new tx_crawler_view_process_list();
988
-		$listView->setPageId($this->pObj->id);
989
-		$listView->setIconPath($BACK_PATH.'../typo3conf/ext/crawler/template/process/res/img/');
990
-		$listView->setProcessCollection($allProcesses);
991
-		$listView->setCliPath($this->processManager->getCrawlerCliPath());
992
-		$listView->setIsCrawlerEnabled(!$crawler->getDisabled() && !$this->isErrorDetected);
993
-		$listView->setTotalUnprocessedItemCount($queueRepository->countAllPendingItems());
994
-		$listView->setAssignedUnprocessedItemCount($queueRepository->countAllAssignedPendingItems());
995
-		$listView->setActiveProcessCount($processRepository->countActive());
996
-		$listView->setMaxActiveProcessCount(\TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->extensionSettings['processLimit'],1,99,1));
997
-		$listView->setMode($mode);
998
-
999
-		$paginationView		= new tx_crawler_view_pagination();
1000
-		$paginationView->setCurrentOffset($offset);
1001
-		$paginationView->setPerPage($perpage);
1002
-		$paginationView->setTotalItemCount($allCount);
1003
-
1004
-		$output = $listView->render();
1005
-
1006
-		if ($paginationView->getTotalPagesCount() > 1) {
1007
-			$output .= ' <br />'.$paginationView->render();
1008
-		}
984
+        $allProcesses 		= $processRepository->findAll('ttl','DESC', $perpage, $offset,$where);
985
+        $allCount			= $processRepository->countAll($where);
986
+
987
+        $listView			= new tx_crawler_view_process_list();
988
+        $listView->setPageId($this->pObj->id);
989
+        $listView->setIconPath($BACK_PATH.'../typo3conf/ext/crawler/template/process/res/img/');
990
+        $listView->setProcessCollection($allProcesses);
991
+        $listView->setCliPath($this->processManager->getCrawlerCliPath());
992
+        $listView->setIsCrawlerEnabled(!$crawler->getDisabled() && !$this->isErrorDetected);
993
+        $listView->setTotalUnprocessedItemCount($queueRepository->countAllPendingItems());
994
+        $listView->setAssignedUnprocessedItemCount($queueRepository->countAllAssignedPendingItems());
995
+        $listView->setActiveProcessCount($processRepository->countActive());
996
+        $listView->setMaxActiveProcessCount(\TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->extensionSettings['processLimit'],1,99,1));
997
+        $listView->setMode($mode);
998
+
999
+        $paginationView		= new tx_crawler_view_pagination();
1000
+        $paginationView->setCurrentOffset($offset);
1001
+        $paginationView->setPerPage($perpage);
1002
+        $paginationView->setTotalItemCount($allCount);
1003
+
1004
+        $output = $listView->render();
1005
+
1006
+        if ($paginationView->getTotalPagesCount() > 1) {
1007
+            $output .= ' <br />'.$paginationView->render();
1008
+        }
1009 1009
 
1010
-		return $output;
1011
-	}
1010
+        return $output;
1011
+    }
1012 1012
 
1013
-	/**
1014
-	 * Verify that the crawler is exectuable.
1015
-	 *
1016
-	 * @access protected
1017
-	 * @return void
1018
-	 *
1019
-	 * @author Michael Klapper <[email protected]>
1020
-	 */
1021
-	protected function makeCrawlerProcessableChecks() {
1022
-		global $LANG;
1023
-
1024
-		if ($this->isCrawlerUserAvailable() === false) {
1025
-			$this->addErrorMessage($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.noBeUserAvailable'));
1026
-		} elseif ($this->isCrawlerUserNotAdmin() === false) {
1027
-			$this->addErrorMessage($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.beUserIsAdmin'));
1028
-		}
1013
+    /**
1014
+     * Verify that the crawler is exectuable.
1015
+     *
1016
+     * @access protected
1017
+     * @return void
1018
+     *
1019
+     * @author Michael Klapper <[email protected]>
1020
+     */
1021
+    protected function makeCrawlerProcessableChecks() {
1022
+        global $LANG;
1023
+
1024
+        if ($this->isCrawlerUserAvailable() === false) {
1025
+            $this->addErrorMessage($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.noBeUserAvailable'));
1026
+        } elseif ($this->isCrawlerUserNotAdmin() === false) {
1027
+            $this->addErrorMessage($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.beUserIsAdmin'));
1028
+        }
1029 1029
 
1030
-		if ($this->isPhpForkAvailable() === false) {
1031
-			$this->addErrorMessage($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.noPhpForkAvailable'));
1032
-		}
1030
+        if ($this->isPhpForkAvailable() === false) {
1031
+            $this->addErrorMessage($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.noPhpForkAvailable'));
1032
+        }
1033 1033
 
1034
-		$exitCode = 0;
1035
-		$out = array();
1036
-		exec(escapeshellcmd($this->extensionSettings['phpPath'] . ' -v'), $out, $exitCode);
1037
-		if ($exitCode > 0) {
1038
-			$this->addErrorMessage(sprintf($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.phpBinaryNotFound'), htmlspecialchars($this->extensionSettings['phpPath'])));
1039
-		}
1040
-	}
1034
+        $exitCode = 0;
1035
+        $out = array();
1036
+        exec(escapeshellcmd($this->extensionSettings['phpPath'] . ' -v'), $out, $exitCode);
1037
+        if ($exitCode > 0) {
1038
+            $this->addErrorMessage(sprintf($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.phpBinaryNotFound'), htmlspecialchars($this->extensionSettings['phpPath'])));
1039
+        }
1040
+    }
1041 1041
 
1042
-	/**
1043
-	 * Indicate that the required PHP method "popen" is
1044
-	 * available in the system.
1045
-	 *
1046
-	 * @access protected
1047
-	 * @return boolean
1048
-	 *
1049
-	 * @author Michael Klapper <[email protected]>
1050
-	 */
1051
-	protected function isPhpForkAvailable() {
1052
-		return function_exists('popen');
1053
-	}
1054
-
1055
-	/**
1056
-	 * Indicate that the required be_user "_cli_crawler" is
1057
-	 * global available in the system.
1058
-	 *
1059
-	 * @access protected
1060
-	 * @return boolean
1061
-	 *
1062
-	 * @author Michael Klapper <[email protected]>
1063
-	 */
1064
-	protected function isCrawlerUserAvailable() {
1065
-		$isAvailable = false;
1066
-		$userArray = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField('be_users', 'username', '_cli_crawler');
1042
+    /**
1043
+     * Indicate that the required PHP method "popen" is
1044
+     * available in the system.
1045
+     *
1046
+     * @access protected
1047
+     * @return boolean
1048
+     *
1049
+     * @author Michael Klapper <[email protected]>
1050
+     */
1051
+    protected function isPhpForkAvailable() {
1052
+        return function_exists('popen');
1053
+    }
1054
+
1055
+    /**
1056
+     * Indicate that the required be_user "_cli_crawler" is
1057
+     * global available in the system.
1058
+     *
1059
+     * @access protected
1060
+     * @return boolean
1061
+     *
1062
+     * @author Michael Klapper <[email protected]>
1063
+     */
1064
+    protected function isCrawlerUserAvailable() {
1065
+        $isAvailable = false;
1066
+        $userArray = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField('be_users', 'username', '_cli_crawler');
1067 1067
 
1068
-		if (is_array($userArray))
1069
-			$isAvailable = true;
1068
+        if (is_array($userArray))
1069
+            $isAvailable = true;
1070 1070
 
1071
-		return $isAvailable;
1072
-	}
1071
+        return $isAvailable;
1072
+    }
1073 1073
 
1074
-	/**
1075
-	 * Indicate that the required be_user "_cli_crawler" is
1076
-	 * has no admin rights.
1077
-	 *
1078
-	 * @access protected
1079
-	 * @return boolean
1080
-	 *
1081
-	 * @author Michael Klapper <[email protected]>
1082
-	 */
1083
-	protected function isCrawlerUserNotAdmin() {
1084
-		$isAvailable = false;
1085
-		$userArray = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField('be_users', 'username', '_cli_crawler');
1074
+    /**
1075
+     * Indicate that the required be_user "_cli_crawler" is
1076
+     * has no admin rights.
1077
+     *
1078
+     * @access protected
1079
+     * @return boolean
1080
+     *
1081
+     * @author Michael Klapper <[email protected]>
1082
+     */
1083
+    protected function isCrawlerUserNotAdmin() {
1084
+        $isAvailable = false;
1085
+        $userArray = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField('be_users', 'username', '_cli_crawler');
1086 1086
 
1087
-		if (is_array($userArray) && $userArray[0]['admin'] == 0)
1088
-			$isAvailable = true;
1087
+        if (is_array($userArray) && $userArray[0]['admin'] == 0)
1088
+            $isAvailable = true;
1089 1089
 
1090
-		return $isAvailable;
1091
-	}
1090
+        return $isAvailable;
1091
+    }
1092 1092
 
1093
-	/**
1094
-	 * Method to handle incomming actions of the process overview
1095
-	 *
1096
-	 * @param void
1097
-	 * @return void
1098
-	 */
1099
-	protected function handleProcessOverviewActions(){
1100
-
1101
-		$crawler = $this->findCrawler();
1102
-
1103
-		switch (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('action')) {
1104
-			case 'stopCrawling' :
1105
-				//set the cli status to disable (all processes will be terminated)
1106
-				$crawler->setDisabled(true);
1107
-				break;
1108
-			case 'resumeCrawling' :
1109
-				//set the cli status to end (all processes will be terminated)
1110
-				$crawler->setDisabled(false);
1111
-				break;
1112
-			case 'addProcess' :
1113
-				$handle = $this->processManager->startProcess();
1114
-				if ($handle === false) {
1115
-					throw new Exception($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.newprocesserror'));
1116
-				}
1117
-				$this->addNoticeMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.newprocess'));
1118
-				break;
1119
-		}
1120
-	}
1093
+    /**
1094
+     * Method to handle incomming actions of the process overview
1095
+     *
1096
+     * @param void
1097
+     * @return void
1098
+     */
1099
+    protected function handleProcessOverviewActions(){
1100
+
1101
+        $crawler = $this->findCrawler();
1102
+
1103
+        switch (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('action')) {
1104
+            case 'stopCrawling' :
1105
+                //set the cli status to disable (all processes will be terminated)
1106
+                $crawler->setDisabled(true);
1107
+                break;
1108
+            case 'resumeCrawling' :
1109
+                //set the cli status to end (all processes will be terminated)
1110
+                $crawler->setDisabled(false);
1111
+                break;
1112
+            case 'addProcess' :
1113
+                $handle = $this->processManager->startProcess();
1114
+                if ($handle === false) {
1115
+                    throw new Exception($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.newprocesserror'));
1116
+                }
1117
+                $this->addNoticeMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.newprocess'));
1118
+                break;
1119
+        }
1120
+    }
1121 1121
 
1122 1122
 
1123 1123
 
1124 1124
 
1125
-	/**
1126
-	 * Returns the singleton instance of the crawler.
1127
-	 *
1128
-	 * @param void
1129
-	 * @return tx_crawler_lib crawler object
1130
-	 * @author Timo Schmidt <[email protected]>
1131
-	 */
1132
-	protected function findCrawler(){
1133
-		if(!$this->crawlerObj instanceof tx_crawler_lib){
1134
-			$this->crawlerObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_lib');
1135
-		}
1136
-		return $this->crawlerObj;
1137
-	}
1125
+    /**
1126
+     * Returns the singleton instance of the crawler.
1127
+     *
1128
+     * @param void
1129
+     * @return tx_crawler_lib crawler object
1130
+     * @author Timo Schmidt <[email protected]>
1131
+     */
1132
+    protected function findCrawler(){
1133
+        if(!$this->crawlerObj instanceof tx_crawler_lib){
1134
+            $this->crawlerObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_lib');
1135
+        }
1136
+        return $this->crawlerObj;
1137
+    }
1138 1138
 
1139 1139
 
1140 1140
 
1141
-	/*****************************
1141
+    /*****************************
1142 1142
 	 *
1143 1143
 	 * General Helper Functions
1144 1144
 	 *
1145 1145
 	 *****************************/
1146 1146
 
1147
-	/**
1148
-	 * This method is used to add a message to the internal queue
1149
-	 *
1150
-	 * NOTE:
1151
-	 * This method is basesd on TYPO3 4.3 or higher!
1152
-	 *
1153
-	 * @param  string  the message itself
1154
-	 * @param  integer message level (-1 = success (default), 0 = info, 1 = notice, 2 = warning, 3 = error)
1155
-	 *
1156
-	 * @access private
1157
-	 * @return void
1158
-	 */
1159
-	private function addMessage($message, $severity = \TYPO3\CMS\Core\Messaging\FlashMessage::OK) {
1160
-		$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
1161
-			'TYPO3\CMS\Core\Messaging\FlashMessage',
1162
-			$message,
1163
-			'',
1164
-			$severity
1165
-		);
1166
-
1167
-		// TODO:
1168
-		/** @var \TYPO3\CMS\Core\Messaging\FlashMessageService $flashMessageService */
1169
-		$flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
1170
-		$flashMessageService->getMessageQueueByIdentifier()->addMessage($message);
1171
-	}
1172
-
1173
-	/**
1174
-	 * Add notice message to the user interface.
1175
-	 *
1176
-	 * NOTE:
1177
-	 * This method is basesd on TYPO3 4.3 or higher!
1178
-	 *
1179
-	 * @param string The message
1180
-	 *
1181
-	 * @access protected
1182
-	 * @return void
1183
-	 *
1184
-	 * @author Michael Klapper <[email protected]>
1185
-	 */
1186
-	protected function addNoticeMessage($message) {
1187
-		$this->addMessage($message, \TYPO3\CMS\Core\Messaging\FlashMessage::NOTICE);
1188
-	}
1189
-
1190
-	/**
1191
-	 * Add error message to the user interface.
1192
-	 *
1193
-	 * NOTE:
1194
-	 * This method is basesd on TYPO3 4.3 or higher!
1195
-	 *
1196
-	 * @param string The message
1197
-	 *
1198
-	 * @access protected
1199
-	 * @return void
1200
-	 *
1201
-	 * @author Michael Klapper <[email protected]>
1202
-	 */
1203
-	protected function addErrorMessage($message) {
1204
-		$this->isErrorDetected = TRUE;
1205
-		$this->addMessage($message, \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
1206
-	}
1207
-
1208
-	/**
1209
-	 * Add error message to the user interface.
1210
-	 *
1211
-	 * NOTE:
1212
-	 * This method is basesd on TYPO3 4.3 or higher!
1213
-	 *
1214
-	 * @param string The message
1215
-	 *
1216
-	 * @access protected
1217
-	 * @return void
1218
-	 *
1219
-	 * @author Michael Klapper <[email protected]>
1220
-	 */
1221
-	protected function addWarningMessage($message) {
1222
-		$this->addMessage($message, \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING);
1223
-	}
1224
-
1225
-	/**
1226
-	 * Create selector box
1227
-	 *
1228
-	 * @param	array		$optArray Options key(value) => label pairs
1229
-	 * @param	string		$name Selector box name
1230
-	 * @param	string		$value Selector box value (array for multiple...)
1231
-	 * @param	boolean		$multiple If set, will draw multiple box.
1147
+    /**
1148
+     * This method is used to add a message to the internal queue
1149
+     *
1150
+     * NOTE:
1151
+     * This method is basesd on TYPO3 4.3 or higher!
1232 1152
      *
1233
-	 * @return	string		HTML select element
1234
-	 */
1235
-	function selectorBox($optArray, $name, $value, $multiple)	{
1153
+     * @param  string  the message itself
1154
+     * @param  integer message level (-1 = success (default), 0 = info, 1 = notice, 2 = warning, 3 = error)
1155
+     *
1156
+     * @access private
1157
+     * @return void
1158
+     */
1159
+    private function addMessage($message, $severity = \TYPO3\CMS\Core\Messaging\FlashMessage::OK) {
1160
+        $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
1161
+            'TYPO3\CMS\Core\Messaging\FlashMessage',
1162
+            $message,
1163
+            '',
1164
+            $severity
1165
+        );
1166
+
1167
+        // TODO:
1168
+        /** @var \TYPO3\CMS\Core\Messaging\FlashMessageService $flashMessageService */
1169
+        $flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
1170
+        $flashMessageService->getMessageQueueByIdentifier()->addMessage($message);
1171
+    }
1172
+
1173
+    /**
1174
+     * Add notice message to the user interface.
1175
+     *
1176
+     * NOTE:
1177
+     * This method is basesd on TYPO3 4.3 or higher!
1178
+     *
1179
+     * @param string The message
1180
+     *
1181
+     * @access protected
1182
+     * @return void
1183
+     *
1184
+     * @author Michael Klapper <[email protected]>
1185
+     */
1186
+    protected function addNoticeMessage($message) {
1187
+        $this->addMessage($message, \TYPO3\CMS\Core\Messaging\FlashMessage::NOTICE);
1188
+    }
1189
+
1190
+    /**
1191
+     * Add error message to the user interface.
1192
+     *
1193
+     * NOTE:
1194
+     * This method is basesd on TYPO3 4.3 or higher!
1195
+     *
1196
+     * @param string The message
1197
+     *
1198
+     * @access protected
1199
+     * @return void
1200
+     *
1201
+     * @author Michael Klapper <[email protected]>
1202
+     */
1203
+    protected function addErrorMessage($message) {
1204
+        $this->isErrorDetected = TRUE;
1205
+        $this->addMessage($message, \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
1206
+    }
1207
+
1208
+    /**
1209
+     * Add error message to the user interface.
1210
+     *
1211
+     * NOTE:
1212
+     * This method is basesd on TYPO3 4.3 or higher!
1213
+     *
1214
+     * @param string The message
1215
+     *
1216
+     * @access protected
1217
+     * @return void
1218
+     *
1219
+     * @author Michael Klapper <[email protected]>
1220
+     */
1221
+    protected function addWarningMessage($message) {
1222
+        $this->addMessage($message, \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING);
1223
+    }
1224
+
1225
+    /**
1226
+     * Create selector box
1227
+     *
1228
+     * @param	array		$optArray Options key(value) => label pairs
1229
+     * @param	string		$name Selector box name
1230
+     * @param	string		$value Selector box value (array for multiple...)
1231
+     * @param	boolean		$multiple If set, will draw multiple box.
1232
+     *
1233
+     * @return	string		HTML select element
1234
+     */
1235
+    function selectorBox($optArray, $name, $value, $multiple)	{
1236 1236
 
1237
-		$options = array();
1238
-		foreach($optArray as $key => $val)	{
1239
-			$options[] = '
1237
+        $options = array();
1238
+        foreach($optArray as $key => $val)	{
1239
+            $options[] = '
1240 1240
 				<option value="'.htmlspecialchars($key).'"'.((!$multiple && !strcmp($value,$key)) || ($multiple && in_array($key,(array)$value))?' selected="selected"':'').'>'.htmlspecialchars($val).'</option>';
1241
-		}
1241
+        }
1242 1242
 
1243
-		$output = '<select name="'.htmlspecialchars($name.($multiple?'[]':'')).'"'.($multiple ? ' multiple="multiple" size="'.count($options).'"' : '').'>'.implode('',$options).'</select>';
1243
+        $output = '<select name="'.htmlspecialchars($name.($multiple?'[]':'')).'"'.($multiple ? ' multiple="multiple" size="'.count($options).'"' : '').'>'.implode('',$options).'</select>';
1244 1244
 
1245
-		return $output;
1246
-	}
1245
+        return $output;
1246
+    }
1247 1247
 
1248
-	/**
1249
-	 * Activate hooks
1250
-	 *
1251
-	 * @return	void
1252
-	 */
1253
-	function runRefreshHooks() {
1254
-		$crawlerLib = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_lib');
1255
-		if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['crawler']['refresh_hooks'])) {
1256
-			foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['crawler']['refresh_hooks'] as $objRef) {
1257
-				$hookObj = &\TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($objRef);
1258
-				if (is_object($hookObj)) {
1259
-					$hookObj->crawler_init($crawlerLib);
1260
-				}
1261
-			}
1262
-		}
1248
+    /**
1249
+     * Activate hooks
1250
+     *
1251
+     * @return	void
1252
+     */
1253
+    function runRefreshHooks() {
1254
+        $crawlerLib = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_lib');
1255
+        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['crawler']['refresh_hooks'])) {
1256
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['crawler']['refresh_hooks'] as $objRef) {
1257
+                $hookObj = &\TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($objRef);
1258
+                if (is_object($hookObj)) {
1259
+                    $hookObj->crawler_init($crawlerLib);
1260
+                }
1261
+            }
1262
+        }
1263 1263
 
1264
-	}
1264
+    }
1265 1265
 
1266
-	/**
1267
-	 * Returns the URL to the current module, including $_GET['id'].
1268
-	 *
1269
-	 * @param array $urlParameters optional parameters to add to the URL
1270
-	 * @return string
1271
-	 */
1272
-	protected function getModuleUrl(array $urlParameters = array()) {
1273
-	    if ($this->pObj->id) {
1274
-	        $urlParameters = array_merge($urlParameters, array(
1266
+    /**
1267
+     * Returns the URL to the current module, including $_GET['id'].
1268
+     *
1269
+     * @param array $urlParameters optional parameters to add to the URL
1270
+     * @return string
1271
+     */
1272
+    protected function getModuleUrl(array $urlParameters = array()) {
1273
+        if ($this->pObj->id) {
1274
+            $urlParameters = array_merge($urlParameters, array(
1275 1275
                 'id' => $this->pObj->id
1276 1276
             ));
1277
-	    }
1277
+        }
1278 1278
         return \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('M'), $urlParameters);
1279
-	}
1279
+    }
1280 1280
 }
1281 1281
 
1282 1282
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/modfunc1/class.tx_crawler_modfunc1.php'])	{
1283
-	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/modfunc1/class.tx_crawler_modfunc1.php']);
1283
+    include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/modfunc1/class.tx_crawler_modfunc1.php']);
1284 1284
 }
Please login to merge, or discard this patch.
template/pagination.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,7 @@
 block discarded – undo
1
-<?php if (!defined('TYPO3_MODE')) die ('Access denied.'); ?>
1
+<?php if (!defined('TYPO3_MODE')) {
2
+    die ('Access denied.');
3
+}
4
+?>
2 5
 
3 6
 Page:
4 7
 <?php for($currentPageOffset 	= 0; $currentPageOffset < $this->getTotalPagesCount(); $currentPageOffset++ ){  ?>
Please login to merge, or discard this patch.
template/process/list.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -5,11 +5,11 @@
 block discarded – undo
5 5
 	<?php echo $this->getRefreshLink(); ?>
6 6
 	<?php echo $this->getEnableDisableLink(); ?>
7 7
 	<?php
8
-		// Check if ActiveProcess is reached
9
-		if (\TYPO3\CMS\Core\Utility\MathUtility::convertToPositiveInteger($this->getActiveProcessCount()) < \TYPO3\CMS\Core\Utility\MathUtility::convertToPositiveInteger($this->getMaxActiveProcessCount())) {
10
-			echo $this->getAddLink();
11
-		}
12
-	?>
8
+        // Check if ActiveProcess is reached
9
+        if (\TYPO3\CMS\Core\Utility\MathUtility::convertToPositiveInteger($this->getActiveProcessCount()) < \TYPO3\CMS\Core\Utility\MathUtility::convertToPositiveInteger($this->getMaxActiveProcessCount())) {
10
+            echo $this->getAddLink();
11
+        }
12
+    ?>
13 13
 	<?php echo $this->getModeLink(); ?>
14 14
 </div>
15 15
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,7 @@  discard block
 block discarded – undo
1
-<?php if (!defined('TYPO3_MODE')) die ('Access denied.'); ?>
1
+<?php if (!defined('TYPO3_MODE')) {
2
+    die ('Access denied.');
3
+}
4
+?>
2 5
 
3 6
 <br />
4 7
 <div id="controll-panel">
@@ -69,8 +72,11 @@  discard block
 block discarded – undo
69 72
 					</div>
70 73
 				<?php elseif ($process->getState() == 'cancelled'): ?>
71 74
 					<?php echo $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.process.cancelled'); ?>
72
-				<?php else: ?>
73
-					<?php echo $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.process.success'); ?>
75
+				<?php else {
76
+    : ?>
77
+					<?php echo $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.process.success');
78
+}
79
+?>
74 80
 				<?php endif; ?>
75 81
 				</td>
76 82
 			</tr>
Please login to merge, or discard this patch.
ext_autoload.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,24 +1,24 @@
 block discarded – undo
1 1
 <?php
2 2
 $extensionPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('crawler');
3 3
 return array(
4
-	'tx_crawler_lib' => $extensionPath . 'class.tx_crawler_lib.php',
5
-	'tx_crawler_cli_flush' => $extensionPath . 'cli/class.tx_crawler_cli_flush.php',
6
-	'tx_crawler_cli' => $extensionPath . 'cli/class.tx_crawler_cli.php',
7
-	'tx_crawler_cli_im' => $extensionPath . 'cli/class.tx_crawler_cli_im.php',
8
-	'tx_crawler_domain_events_dispatcher' => $extensionPath . 'domain/events/class.tx_crawler_domain_events_dispatcher.php',
9
-	'tx_crawler_domain_events_observer' => $extensionPath . 'domain/events/interface.tx_crawler_domain_events_observer.php',
10
-	'tx_crawler_domain_lib_abstract_dbobject' => $extensionPath . 'domain/lib/class.tx_crawler_domain_lib_abstract_dbobject.php',
11
-	'tx_crawler_domain_process_manager' => $extensionPath . 'domain/process/class.tx_crawler_domain_process_manager.php',
12
-	'tx_crawler_domain_process' => $extensionPath . 'domain/process/class.tx_crawler_domain_process.php',
13
-	'tx_crawler_domain_process_collection' => $extensionPath . 'domain/process/class.tx_crawler_domain_process_collection.php',
14
-	'tx_crawler_domain_process_repository' => $extensionPath . 'domain/process/class.tx_crawler_domain_process_repository.php',
15
-	'tx_crawler_domain_queue_entry' => $extensionPath . 'domain/queue/class.tx_crawler_domain_queue_entry.php',
16
-	'tx_crawler_domain_queue_repository' => $extensionPath . 'domain/queue/class.tx_crawler_domain_queue_repository.php',
17
-	'tx_crawler_domain_reason' => $extensionPath . 'domain/reason/class.tx_crawler_domain_reason.php',
18
-	'tx_crawler_hooks_tsfe' => $extensionPath . 'hooks/class.tx_crawler_hooks_tsfe.php',
19
-	'tx_crawler_hooks_staticFileCacheCreateUri' => $extensionPath . 'hooks/class.tx_crawler_hooks_staticFileCacheCreateUri.php',
20
-	'tx_crawler_hooks_processCleanUp' => $extensionPath . 'hooks/class.tx_crawler_hooks_processCleanUp.php',
21
-	'tx_crawler_modfunc1' => $extensionPath . 'modfunc1/class.tx_crawler_modfunc1.php',
22
-	'tx_crawler_view_pagination' => $extensionPath . 'view/class.tx_crawler_view_pagination.php',
23
-	'tx_crawler_view_process_list' => $extensionPath . 'view/process/class.tx_crawler_view_process_list.php',
4
+    'tx_crawler_lib' => $extensionPath . 'class.tx_crawler_lib.php',
5
+    'tx_crawler_cli_flush' => $extensionPath . 'cli/class.tx_crawler_cli_flush.php',
6
+    'tx_crawler_cli' => $extensionPath . 'cli/class.tx_crawler_cli.php',
7
+    'tx_crawler_cli_im' => $extensionPath . 'cli/class.tx_crawler_cli_im.php',
8
+    'tx_crawler_domain_events_dispatcher' => $extensionPath . 'domain/events/class.tx_crawler_domain_events_dispatcher.php',
9
+    'tx_crawler_domain_events_observer' => $extensionPath . 'domain/events/interface.tx_crawler_domain_events_observer.php',
10
+    'tx_crawler_domain_lib_abstract_dbobject' => $extensionPath . 'domain/lib/class.tx_crawler_domain_lib_abstract_dbobject.php',
11
+    'tx_crawler_domain_process_manager' => $extensionPath . 'domain/process/class.tx_crawler_domain_process_manager.php',
12
+    'tx_crawler_domain_process' => $extensionPath . 'domain/process/class.tx_crawler_domain_process.php',
13
+    'tx_crawler_domain_process_collection' => $extensionPath . 'domain/process/class.tx_crawler_domain_process_collection.php',
14
+    'tx_crawler_domain_process_repository' => $extensionPath . 'domain/process/class.tx_crawler_domain_process_repository.php',
15
+    'tx_crawler_domain_queue_entry' => $extensionPath . 'domain/queue/class.tx_crawler_domain_queue_entry.php',
16
+    'tx_crawler_domain_queue_repository' => $extensionPath . 'domain/queue/class.tx_crawler_domain_queue_repository.php',
17
+    'tx_crawler_domain_reason' => $extensionPath . 'domain/reason/class.tx_crawler_domain_reason.php',
18
+    'tx_crawler_hooks_tsfe' => $extensionPath . 'hooks/class.tx_crawler_hooks_tsfe.php',
19
+    'tx_crawler_hooks_staticFileCacheCreateUri' => $extensionPath . 'hooks/class.tx_crawler_hooks_staticFileCacheCreateUri.php',
20
+    'tx_crawler_hooks_processCleanUp' => $extensionPath . 'hooks/class.tx_crawler_hooks_processCleanUp.php',
21
+    'tx_crawler_modfunc1' => $extensionPath . 'modfunc1/class.tx_crawler_modfunc1.php',
22
+    'tx_crawler_view_pagination' => $extensionPath . 'view/class.tx_crawler_view_pagination.php',
23
+    'tx_crawler_view_process_list' => $extensionPath . 'view/process/class.tx_crawler_view_process_list.php',
24 24
 );
Please login to merge, or discard this patch.
cli/class.tx_crawler_cli.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -37,29 +37,29 @@
 block discarded – undo
37 37
  */
38 38
 class tx_crawler_cli extends \TYPO3\CMS\Core\Controller\CommandLineController {
39 39
 
40
-	/**
41
-	 * Constructor
42
-	 *
43
-	 * @return	void
44
-	 */
45
-	function __construct() {
46
-		parent::__construct();
40
+    /**
41
+     * Constructor
42
+     *
43
+     * @return	void
44
+     */
45
+    function __construct() {
46
+        parent::__construct();
47 47
 
48
-		$this->cli_options[] = array('-h', 'Show the help', '');
49
-		$this->cli_options[] = array('--help', 'Same as -h', '');
50
-		$this->cli_options[] = array('--countInARun count', 'Amount of pages', 'How many pages should be crawled during that run.');
51
-		$this->cli_options[] = array('--sleepTime milliseconds', 'Millisecounds to relax system during crawls', 'Amount of millisecounds which the system should use to relax between crawls.');
52
-		$this->cli_options[] = array('--sleepAfterFinish seconds', 'Secounds to relax system after all crawls.', 'Amount of secounds which the system should use to relax after all crawls are done.');
48
+        $this->cli_options[] = array('-h', 'Show the help', '');
49
+        $this->cli_options[] = array('--help', 'Same as -h', '');
50
+        $this->cli_options[] = array('--countInARun count', 'Amount of pages', 'How many pages should be crawled during that run.');
51
+        $this->cli_options[] = array('--sleepTime milliseconds', 'Millisecounds to relax system during crawls', 'Amount of millisecounds which the system should use to relax between crawls.');
52
+        $this->cli_options[] = array('--sleepAfterFinish seconds', 'Secounds to relax system after all crawls.', 'Amount of secounds which the system should use to relax after all crawls are done.');
53 53
 
54
-		// Setting help texts:
55
-		$this->cli_help['name'] = 'crawler CLI interface -- Crawling the URLs from the queue';
56
-		$this->cli_help['synopsis'] = '###OPTIONS###';
57
-		$this->cli_help['description'] = "";
58
-		$this->cli_help['examples'] = "/.../cli_dispatch.phpsh crawler\nWill trigger the crawler which starts to process the queue entires\n";
59
-		$this->cli_help['author'] = 'Kasper Skaarhoj, Daniel Poetzinger, Fabrizio Branca, Tolleiv Nietsch, Timo Schmidt - AOE media 2010';
60
-	}
54
+        // Setting help texts:
55
+        $this->cli_help['name'] = 'crawler CLI interface -- Crawling the URLs from the queue';
56
+        $this->cli_help['synopsis'] = '###OPTIONS###';
57
+        $this->cli_help['description'] = "";
58
+        $this->cli_help['examples'] = "/.../cli_dispatch.phpsh crawler\nWill trigger the crawler which starts to process the queue entires\n";
59
+        $this->cli_help['author'] = 'Kasper Skaarhoj, Daniel Poetzinger, Fabrizio Branca, Tolleiv Nietsch, Timo Schmidt - AOE media 2010';
60
+    }
61 61
 }
62 62
 
63 63
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/cli/class.tx_crawler_cli.php']) {
64
-	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/cli/class.tx_crawler_cli.php']);
64
+    include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/cli/class.tx_crawler_cli.php']);
65 65
 }
Please login to merge, or discard this patch.
cli/class.tx_crawler_cli_im.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -37,41 +37,41 @@
 block discarded – undo
37 37
  */
38 38
 class tx_crawler_cli_im extends \TYPO3\CMS\Core\Controller\CommandLineController {
39 39
 
40
-	/**
41
-	 * Constructor
42
-	 *
43
-	 * @return	void
44
-	 */
45
-	function __construct() {
46
-		parent::__construct();
40
+    /**
41
+     * Constructor
42
+     *
43
+     * @return	void
44
+     */
45
+    function __construct() {
46
+        parent::__construct();
47 47
 
48
-		// Adding options to help archive:
49
-		/**
50
-		* We removed the "proc" option as it seemd not to be working any more. But as the complete handling of the crawler has changed regarding the configuration
51
-		* this is completely ok. Since configuration records were introduced to configure "what should be done" additionally to page ts the way to setup jobs
52
-		* has drifted from selecting filtering processing instructions to selecting/filtering configuration keys (you can configure the processing instructions there).
53
-		* This is also reflected in the backend modules and allows you a much clearer and powerful way to work with the crawler extension.
54
-		*/
55
-		// $this->cli_options[] = array('-proc listOfProcInstr', 'Comma list of processing instructions. These are the "actions" carried out when crawling and you must specify at least one. Depends on third-party extensions. Examples are "tx_cachemgm_recache" from "cachemgm" extension (will recache pages), "tx_staticpub_publish" from "staticpub" (publishing pages to static files) or "tx_indexedsearch_reindex" from "indexed_search" (indexes pages).');
56
-		// TODO: cleanup here!
57
-		$this->cli_options[] = array('-d depth', 'Tree depth, 0-99', "How many levels under the 'page_id' to include.");
58
-		$this->cli_options[] = array('-o mode', 'Output mode: "url", "exec", "queue"', "Specifies output modes\nurl : Will list URLs which wget could use as input.\nqueue: Will put entries in queue table.\nexec: Will execute all entries right away!");
59
-		$this->cli_options[] = array('-n number', 'Number of items per minute.', 'Specifies how many items are put in the queue per minute. Only valid for output mode "queue"');
60
-		$this->cli_options[] = array('-conf configurationkeys','List of Configuration Keys','A commaseperated list of crawler configurations');
61
-		#		$this->cli_options[] = array('-v level', 'Verbosity level 0-3', "The value of level can be:\n  0 = all output\n  1 = info and greater (default)\n  2 = warnings and greater\n  3 = errors");
48
+        // Adding options to help archive:
49
+        /**
50
+         * We removed the "proc" option as it seemd not to be working any more. But as the complete handling of the crawler has changed regarding the configuration
51
+         * this is completely ok. Since configuration records were introduced to configure "what should be done" additionally to page ts the way to setup jobs
52
+         * has drifted from selecting filtering processing instructions to selecting/filtering configuration keys (you can configure the processing instructions there).
53
+         * This is also reflected in the backend modules and allows you a much clearer and powerful way to work with the crawler extension.
54
+         */
55
+        // $this->cli_options[] = array('-proc listOfProcInstr', 'Comma list of processing instructions. These are the "actions" carried out when crawling and you must specify at least one. Depends on third-party extensions. Examples are "tx_cachemgm_recache" from "cachemgm" extension (will recache pages), "tx_staticpub_publish" from "staticpub" (publishing pages to static files) or "tx_indexedsearch_reindex" from "indexed_search" (indexes pages).');
56
+        // TODO: cleanup here!
57
+        $this->cli_options[] = array('-d depth', 'Tree depth, 0-99', "How many levels under the 'page_id' to include.");
58
+        $this->cli_options[] = array('-o mode', 'Output mode: "url", "exec", "queue"', "Specifies output modes\nurl : Will list URLs which wget could use as input.\nqueue: Will put entries in queue table.\nexec: Will execute all entries right away!");
59
+        $this->cli_options[] = array('-n number', 'Number of items per minute.', 'Specifies how many items are put in the queue per minute. Only valid for output mode "queue"');
60
+        $this->cli_options[] = array('-conf configurationkeys','List of Configuration Keys','A commaseperated list of crawler configurations');
61
+        #		$this->cli_options[] = array('-v level', 'Verbosity level 0-3', "The value of level can be:\n  0 = all output\n  1 = info and greater (default)\n  2 = warnings and greater\n  3 = errors");
62 62
 
63
-		// Setting help texts:
64
-		$this->cli_help['name'] = 'crawler CLI interface -- Submitting URLs to be crawled via CLI interface.';
65
-		$this->cli_help['synopsis'] = 'page_id ###OPTIONS###';
66
-		$this->cli_help['description'] = "Works as a CLI interface to some functionality from the Web > Info > Site Crawler module; It can put entries in the queue from command line options, return the list of URLs and even execute all entries right away without having to queue them up - this can be useful for immediate re-cache, re-indexing or static publishing from command line.";
67
-		$this->cli_help['examples'] = "/.../cli_dispatch.phpsh crawler_im 7 -d=2 -conf=<configurationKey> -o=exec\nWill re-cache pages from page 7 and two levels down, executed immediately.\n";
68
-		$this->cli_help['examples'].= "/.../cli_dispatch.phpsh crawler_im 7 -d=0 -conf=<configurationKey> -n=4 -o=queue\nWill put entries for re-caching pages from page 7 into queue, 4 every minute.\n";
69
-		$this->cli_help['author'] = 'Kasper Skaarhoj, Daniel Poetzinger, Fabrizio Branca, Tolleiv Nietsch, Timo Schmidt - AOE media 2009';
70
-	}
63
+        // Setting help texts:
64
+        $this->cli_help['name'] = 'crawler CLI interface -- Submitting URLs to be crawled via CLI interface.';
65
+        $this->cli_help['synopsis'] = 'page_id ###OPTIONS###';
66
+        $this->cli_help['description'] = "Works as a CLI interface to some functionality from the Web > Info > Site Crawler module; It can put entries in the queue from command line options, return the list of URLs and even execute all entries right away without having to queue them up - this can be useful for immediate re-cache, re-indexing or static publishing from command line.";
67
+        $this->cli_help['examples'] = "/.../cli_dispatch.phpsh crawler_im 7 -d=2 -conf=<configurationKey> -o=exec\nWill re-cache pages from page 7 and two levels down, executed immediately.\n";
68
+        $this->cli_help['examples'].= "/.../cli_dispatch.phpsh crawler_im 7 -d=0 -conf=<configurationKey> -n=4 -o=queue\nWill put entries for re-caching pages from page 7 into queue, 4 every minute.\n";
69
+        $this->cli_help['author'] = 'Kasper Skaarhoj, Daniel Poetzinger, Fabrizio Branca, Tolleiv Nietsch, Timo Schmidt - AOE media 2009';
70
+    }
71 71
 }
72 72
 
73 73
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/cli/class.tx_crawler_cli_im.php']) {
74
-	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/cli/class.tx_crawler_cli_im.php']);
74
+    include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/cli/class.tx_crawler_cli_im.php']);
75 75
 }
76 76
 
77 77
 ?>
Please login to merge, or discard this patch.
cli/bootstrap.php 1 patch
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -5,20 +5,20 @@  discard block
 block discarded – undo
5 5
  * Retrieve path (taken from cli_dispatch.phpsh)
6 6
  */
7 7
 
8
-	// Get path to this script
8
+    // Get path to this script
9 9
 $tempPathThisScript = isset($_SERVER['argv'][0]) ? $_SERVER['argv'][0] : (isset($_ENV['_']) ? $_ENV['_'] : $_SERVER['_']);
10 10
 
11
-	// Resolve path
11
+    // Resolve path
12 12
 if (!isAbsPath($tempPathThisScript)) {
13
-	$workingDirectory = $_SERVER['PWD'] ? $_SERVER['PWD'] : getcwd();
14
-	if ($workingDirectory) {
15
-		$tempPathThisScript = $workingDirectory . '/' . preg_replace('/\.\//', '', $tempPathThisScript);
16
-		if (!@is_file($tempPathThisScript)) {
17
-			die('Relative path found, but an error occured during resolving of the absolute path: ' . $tempPathThisScript . PHP_EOL);
18
-		}
19
-	} else {
20
-		die('Relative path found, but resolving absolute path is not supported on this platform.' . PHP_EOL);
21
-	}
13
+    $workingDirectory = $_SERVER['PWD'] ? $_SERVER['PWD'] : getcwd();
14
+    if ($workingDirectory) {
15
+        $tempPathThisScript = $workingDirectory . '/' . preg_replace('/\.\//', '', $tempPathThisScript);
16
+        if (!@is_file($tempPathThisScript)) {
17
+            die('Relative path found, but an error occured during resolving of the absolute path: ' . $tempPathThisScript . PHP_EOL);
18
+        }
19
+    } else {
20
+        die('Relative path found, but resolving absolute path is not supported on this platform.' . PHP_EOL);
21
+    }
22 22
 }
23 23
 
24 24
 $typo3Root = preg_replace('#typo3conf/ext/crawler/cli/bootstrap.php$#', '', $tempPathThisScript);
@@ -30,33 +30,33 @@  discard block
 block discarded – undo
30 30
  */
31 31
 $additionalHeaders = unserialize(base64_decode($_SERVER['argv'][3]));
32 32
 if (is_array($additionalHeaders)) {
33
-	foreach ($additionalHeaders as $additionalHeader) {
34
-		if (strpos($additionalHeader, ':') !== FALSE) {
35
-			list($key, $value) = explode(':', $additionalHeader, 2);
36
-			$key = str_replace('-', '_', strtoupper(trim($key)));
37
-			if ($key != 'HOST') {
38
-				$_SERVER['HTTP_' . $key] = $value;
39
-			}
40
-		}
41
-	}
33
+    foreach ($additionalHeaders as $additionalHeader) {
34
+        if (strpos($additionalHeader, ':') !== FALSE) {
35
+            list($key, $value) = explode(':', $additionalHeader, 2);
36
+            $key = str_replace('-', '_', strtoupper(trim($key)));
37
+            if ($key != 'HOST') {
38
+                $_SERVER['HTTP_' . $key] = $value;
39
+            }
40
+        }
41
+    }
42 42
 }
43 43
 
44 44
 
45
-	// put parsed query parts into $_GET array
45
+    // put parsed query parts into $_GET array
46 46
 $urlParts = parse_url($_SERVER['argv'][2]);
47
-	// Populating $_GET
47
+    // Populating $_GET
48 48
 parse_str($urlParts['query'], $_GET);
49
-	// Populating $_REQUEST
49
+    // Populating $_REQUEST
50 50
 parse_str($urlParts['query'], $_REQUEST);
51
-	// Populating $_POST
51
+    // Populating $_POST
52 52
 $_POST = array();
53
-	// Populating $_COOKIE
53
+    // Populating $_COOKIE
54 54
 $_COOKIE = array();
55 55
 
56
-	// Get the TYPO3_SITE_PATH of the website frontend:
56
+    // Get the TYPO3_SITE_PATH of the website frontend:
57 57
 $typo3SitePath = $_SERVER['argv'][1];
58 58
 
59
-	// faking the environment
59
+    // faking the environment
60 60
 $_SERVER['DOCUMENT_ROOT'] = preg_replace('#' . preg_quote($typo3SitePath, '#') . '$#', '', $typo3Root);
61 61
 $_SERVER['HTTP_USER_AGENT'] = 'CLI Mode';
62 62
 $_SERVER['HTTP_HOST'] = $_SERVER['SERVER_NAME'] = $urlParts['host'];
@@ -66,15 +66,15 @@  discard block
 block discarded – undo
66 66
 $_SERVER['REQUEST_URI'] = $urlParts['path'] . (isset($urlParts['query']) ? '?' . $urlParts['query'] : '');
67 67
 $_SERVER['REQUEST_METHOD'] = 'GET';
68 68
 
69
-	// Define a port if used in the URL:
69
+    // Define a port if used in the URL:
70 70
 if (isset($urlParts['port'])) {
71
-	$_SERVER['HTTP_HOST'] .= ':' . $urlParts['port'];
72
-	$_SERVER['SERVER_PORT'] = $urlParts['port'];
71
+    $_SERVER['HTTP_HOST'] .= ':' . $urlParts['port'];
72
+    $_SERVER['SERVER_PORT'] = $urlParts['port'];
73 73
 }
74 74
 
75
-	// Define HTTPS disposal:
75
+    // Define HTTPS disposal:
76 76
 if ($urlParts['scheme'] === 'https') {
77
-	$_SERVER['HTTPS'] = 'on';
77
+    $_SERVER['HTTPS'] = 'on';
78 78
 }
79 79
 
80 80
 chdir($typo3Root);
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
  * @return boolean
89 89
  */
90 90
 function isAbsPath($path) {
91
-		// on Windows also a path starting with a drive letter is absolute: X:/
92
-	if (stristr(PHP_OS, 'win') && substr($path, 1, 2) === ':/') {
93
-		return TRUE;
94
-	}
91
+        // on Windows also a path starting with a drive letter is absolute: X:/
92
+    if (stristr(PHP_OS, 'win') && substr($path, 1, 2) === ':/') {
93
+        return TRUE;
94
+    }
95 95
 
96
-		// path starting with a / is always absolute, on every system
97
-	return (substr($path, 0, 1) === '/');
96
+        // path starting with a / is always absolute, on every system
97
+    return (substr($path, 0, 1) === '/');
98 98
 }
Please login to merge, or discard this patch.
cli/class.tx_crawler_cli_flush.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -37,30 +37,30 @@
 block discarded – undo
37 37
  */
38 38
 class tx_crawler_cli_flush extends \TYPO3\CMS\Core\Controller\CommandLineController {
39 39
 
40
-	/**
41
-	 * Constructor
42
-	 *
43
-	 * @return	void
44
-	 */
45
-	function __construct() {
46
-		parent::__construct();
40
+    /**
41
+     * Constructor
42
+     *
43
+     * @return	void
44
+     */
45
+    function __construct() {
46
+        parent::__construct();
47 47
 
48
-			// Adding options to help archive:
49
-		$this->cli_options[] = array('-o mode', 'Output mode: "finished", "all", "pending"', "Specifies the type queue entries which is flushed in the process.");
50
-		#		$this->cli_options[] = array('-v level', 'Verbosity level 0-3', "The value of level can be:\n  0 = all output\n  1 = info and greater (default)\n  2 = warnings and greater\n  3 = errors");
48
+            // Adding options to help archive:
49
+        $this->cli_options[] = array('-o mode', 'Output mode: "finished", "all", "pending"', "Specifies the type queue entries which is flushed in the process.");
50
+        #		$this->cli_options[] = array('-v level', 'Verbosity level 0-3', "The value of level can be:\n  0 = all output\n  1 = info and greater (default)\n  2 = warnings and greater\n  3 = errors");
51 51
 
52
-			// Setting help texts:
53
-		$this->cli_help['name'] = 'crawler CLI interface -- Cleaning up the queue.';
54
-		$this->cli_help['synopsis'] = 'page_id ###OPTIONS###';
55
-		$this->cli_help['description'] = "Works as a CLI interface to some functionality from the Web > Info > Site Crawler module; It will remove queue entires and perform a cleanup.";
56
-		$this->cli_help['examples'] = "/.../cli_dispatch.phpsh crawler_flush 5 -o=finished\nWill remove all finished queue-entries in the sub-branch of page 5\n";
57
-		$this->cli_help['examples'] = "/.../cli_dispatch.phpsh crawler_flush 0 -o=all\nWill remove all queue-entries for every page\n";
58
-		$this->cli_help['author'] = 'Kasper Skaarhoj, Daniel Poetzinger, Fabrizio Branca, Tolleiv Nietsch, Timo Schmidt - AOE media 2009';
59
-	}
52
+            // Setting help texts:
53
+        $this->cli_help['name'] = 'crawler CLI interface -- Cleaning up the queue.';
54
+        $this->cli_help['synopsis'] = 'page_id ###OPTIONS###';
55
+        $this->cli_help['description'] = "Works as a CLI interface to some functionality from the Web > Info > Site Crawler module; It will remove queue entires and perform a cleanup.";
56
+        $this->cli_help['examples'] = "/.../cli_dispatch.phpsh crawler_flush 5 -o=finished\nWill remove all finished queue-entries in the sub-branch of page 5\n";
57
+        $this->cli_help['examples'] = "/.../cli_dispatch.phpsh crawler_flush 0 -o=all\nWill remove all queue-entries for every page\n";
58
+        $this->cli_help['author'] = 'Kasper Skaarhoj, Daniel Poetzinger, Fabrizio Branca, Tolleiv Nietsch, Timo Schmidt - AOE media 2009';
59
+    }
60 60
 }
61 61
 
62 62
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/cli/class.tx_crawler_cli_flush.php']) {
63
-	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/cli/class.tx_crawler_cli_flush.php']);
63
+    include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/cli/class.tx_crawler_cli_flush.php']);
64 64
 }
65 65
 
66 66
 ?>
Please login to merge, or discard this patch.
domain/lib/class.tx_crawler_domain_lib_abstract_dbobject.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -24,43 +24,43 @@
 block discarded – undo
24 24
 
25 25
 abstract class tx_crawler_domain_lib_abstract_dbobject {
26 26
 
27
-	/**
28
-	 * @var array
29
-	 */
30
-	protected $row;
27
+    /**
28
+     * @var array
29
+     */
30
+    protected $row;
31 31
 
32
-	/**
33
-	 * @var string table name
34
-	 */
35
-	protected static $tableName;
32
+    /**
33
+     * @var string table name
34
+     */
35
+    protected static $tableName;
36 36
 
37
-	/**
38
-	 * Constructor
39
-	 *
40
-	 * @param array $row optional array with propertys
41
-	 */
42
-	public function __construct($row = array()) {
43
-		$this->row = $row;
44
-	}
37
+    /**
38
+     * Constructor
39
+     *
40
+     * @param array $row optional array with propertys
41
+     */
42
+    public function __construct($row = array()) {
43
+        $this->row = $row;
44
+    }
45 45
 
46
-	/**
47
-	 * Get table name
48
-	 *
49
-	 * @param void
50
-	 * @return string table name
51
-	 */
52
-	public static function getTableName(){
53
-		return self::$tableName;
54
-	}
46
+    /**
47
+     * Get table name
48
+     *
49
+     * @param void
50
+     * @return string table name
51
+     */
52
+    public static function getTableName(){
53
+        return self::$tableName;
54
+    }
55 55
 
56
-	/**
57
-	 * Returns the propertys of the object as array
58
-	 *
59
-	 * @return array
60
-	 */
61
-	public function getRow() {
62
-		return $this->row;
63
-	}
56
+    /**
57
+     * Returns the propertys of the object as array
58
+     *
59
+     * @return array
60
+     */
61
+    public function getRow() {
62
+        return $this->row;
63
+    }
64 64
 
65 65
 
66 66
 }
Please login to merge, or discard this patch.