Completed
Push — issue/174 ( 5f2a16 )
by Tomas Norre
11:34
created
domain/queue/class.tx_crawler_domain_queue_repository.php 4 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -132,6 +132,7 @@
 block discarded – undo
132 132
 	/**
133 133
 	 * Internal method to count items by a given where clause
134 134
 	 *
135
+	 * @param string $where
135 136
 	 */
136 137
 	protected function countItemsByWhereClause($where) {
137 138
 		$db 	= $this->getDB();
Please login to merge, or discard this patch.
Indentation   +241 added lines, -241 removed lines patch added patch discarded remove patch
@@ -25,270 +25,270 @@
 block discarded – undo
25 25
 class tx_crawler_domain_queue_repository extends tx_crawler_domain_lib_abstract_repository {
26 26
 
27 27
 
28
-	protected $objectClassname = 'tx_crawler_domain_queue_entry';
28
+    protected $objectClassname = 'tx_crawler_domain_queue_entry';
29 29
 
30
-	protected $tableName = 'tx_crawler_queue';
30
+    protected $tableName = 'tx_crawler_queue';
31 31
 
32
-	/**
33
-	 * This mehtod is used to find the youngest entry for a given process.
34
-	 *
35
-	 * @author Timo Schmidt <[email protected]>
36
-	 * @param tx_crawler_domain_process $process
37
-	 * @return tx_crawler_domain_queue_entry $entry
38
-	 */
39
-	public function findYoungestEntryForProcess(tx_crawler_domain_process $process) {
40
-		return $this->getFirstOrLastObjectByProcess($process,'exec_time ASC');
41
-	}
32
+    /**
33
+     * This mehtod is used to find the youngest entry for a given process.
34
+     *
35
+     * @author Timo Schmidt <[email protected]>
36
+     * @param tx_crawler_domain_process $process
37
+     * @return tx_crawler_domain_queue_entry $entry
38
+     */
39
+    public function findYoungestEntryForProcess(tx_crawler_domain_process $process) {
40
+        return $this->getFirstOrLastObjectByProcess($process,'exec_time ASC');
41
+    }
42 42
 
43
-	/**
44
-	 * This method is used to find the oldest entry for a given process.
45
-	 *
46
-	 * @param tx_crawler_domain_process $process
47
-	 * @return tx_crawler_domain_queue_entry
48
-	 */
49
-	public function findOldestEntryForProcess(tx_crawler_domain_process $process) {
50
-		return $this->getFirstOrLastObjectByProcess($process,'exec_time DESC');
51
-	}
43
+    /**
44
+     * This method is used to find the oldest entry for a given process.
45
+     *
46
+     * @param tx_crawler_domain_process $process
47
+     * @return tx_crawler_domain_queue_entry
48
+     */
49
+    public function findOldestEntryForProcess(tx_crawler_domain_process $process) {
50
+        return $this->getFirstOrLastObjectByProcess($process,'exec_time DESC');
51
+    }
52 52
 
53 53
 
54
-	/**
55
-	 * This internal helper method is used to create an instance of an entry object
56
-	 *
57
-	 * @param tx_crawler_domain_process $process
58
-	 * @param string $orderby first matching item will be returned as object
59
-	 * @return tx_crawler_domain_queue_entry
60
-	 */
61
-	protected function getFirstOrLastObjectByProcess($process, $orderby) {
62
-		$db = $this->getDB();
63
-		$where = 'process_id_completed='.$db->fullQuoteStr($process->getProcess_id(),$this->tableName).
64
-				 ' AND exec_time > 0 ';
65
-		$limit = 1;
66
-		$groupby = '';
54
+    /**
55
+     * This internal helper method is used to create an instance of an entry object
56
+     *
57
+     * @param tx_crawler_domain_process $process
58
+     * @param string $orderby first matching item will be returned as object
59
+     * @return tx_crawler_domain_queue_entry
60
+     */
61
+    protected function getFirstOrLastObjectByProcess($process, $orderby) {
62
+        $db = $this->getDB();
63
+        $where = 'process_id_completed='.$db->fullQuoteStr($process->getProcess_id(),$this->tableName).
64
+                    ' AND exec_time > 0 ';
65
+        $limit = 1;
66
+        $groupby = '';
67 67
 
68
-		$res 	= $db->exec_SELECTgetRows('*','tx_crawler_queue',$where,$groupby,$orderby,$limit);
69
-		if($res) {
70
-			$first 	= $res[0];
71
-		}else{
72
-			$first = array();
73
-		}
74
-		$resultObject = new tx_crawler_domain_queue_entry($first);
75
-		return $resultObject;
76
-	}
68
+        $res 	= $db->exec_SELECTgetRows('*','tx_crawler_queue',$where,$groupby,$orderby,$limit);
69
+        if($res) {
70
+            $first 	= $res[0];
71
+        }else{
72
+            $first = array();
73
+        }
74
+        $resultObject = new tx_crawler_domain_queue_entry($first);
75
+        return $resultObject;
76
+    }
77 77
 
78
-	/**
79
-	 * Counts all executed items of a process.
80
-	 *
81
-	 * @param tx_crawler_domain_process $process
82
-	 * @return int
83
-	 */
84
-	public function countExtecutedItemsByProcess($process) {
78
+    /**
79
+     * Counts all executed items of a process.
80
+     *
81
+     * @param tx_crawler_domain_process $process
82
+     * @return int
83
+     */
84
+    public function countExtecutedItemsByProcess($process) {
85 85
 
86
-		return $this->countItemsByWhereClause('exec_time > 0 AND process_id_completed = '.$this->getDB()->fullQuoteStr($process->getProcess_id(),$this->tableName));
87
-	}
86
+        return $this->countItemsByWhereClause('exec_time > 0 AND process_id_completed = '.$this->getDB()->fullQuoteStr($process->getProcess_id(),$this->tableName));
87
+    }
88 88
 
89
-	/**
90
-	 * Counts items of a process which yet have not been processed/executed
91
-	 *
92
-	 * @param tx_crawler_domain_process $process
93
-	 * @return int
94
-	 */
95
-	public function countNonExecutedItemsByProcess($process) {
96
-		return $this->countItemsByWhereClause('exec_time = 0 AND process_id = '.$this->getDB()->fullQuoteStr($process->getProcess_id(),$this->tableName));
97
-	}
89
+    /**
90
+     * Counts items of a process which yet have not been processed/executed
91
+     *
92
+     * @param tx_crawler_domain_process $process
93
+     * @return int
94
+     */
95
+    public function countNonExecutedItemsByProcess($process) {
96
+        return $this->countItemsByWhereClause('exec_time = 0 AND process_id = '.$this->getDB()->fullQuoteStr($process->getProcess_id(),$this->tableName));
97
+    }
98 98
 
99
-	/**
100
-	 * This method can be used to count all queue entrys which are
101
-	 * scheduled for now or a earler date.
102
-	 *
103
-	 * @param void
104
-	 * @return int
105
-	 */
106
-	public function countAllPendingItems() {
107
-		return $this->countItemsByWhereClause('exec_time = 0 AND scheduled < '.time());
108
-	}
99
+    /**
100
+     * This method can be used to count all queue entrys which are
101
+     * scheduled for now or a earler date.
102
+     *
103
+     * @param void
104
+     * @return int
105
+     */
106
+    public function countAllPendingItems() {
107
+        return $this->countItemsByWhereClause('exec_time = 0 AND scheduled < '.time());
108
+    }
109 109
 
110
-	/**
111
-	 * This method can be used to count all queue entrys which are
112
-	 * scheduled for now or a earler date and are assigned to a process.
113
-	 *
114
-	 * @param void
115
-	 * @return int
116
-	 */
117
-	public function countAllAssignedPendingItems() {
118
-		return $this->countItemsByWhereClause("exec_time = 0 AND scheduled < ".time()." AND process_id != ''");
119
-	}
110
+    /**
111
+     * This method can be used to count all queue entrys which are
112
+     * scheduled for now or a earler date and are assigned to a process.
113
+     *
114
+     * @param void
115
+     * @return int
116
+     */
117
+    public function countAllAssignedPendingItems() {
118
+        return $this->countItemsByWhereClause("exec_time = 0 AND scheduled < ".time()." AND process_id != ''");
119
+    }
120 120
 
121
-	/**
122
-	 * This method can be used to count all queue entrys which are
123
-	 * scheduled for now or a earler date and are not assigned to a process.
124
-	 *
125
-	 * @param void
126
-	 * @return int
127
-	 */
128
-	public function countAllUnassignedPendingItems() {
129
-		return $this->countItemsByWhereClause("exec_time = 0 AND scheduled < ".time()." AND process_id = ''");
130
-	}
121
+    /**
122
+     * This method can be used to count all queue entrys which are
123
+     * scheduled for now or a earler date and are not assigned to a process.
124
+     *
125
+     * @param void
126
+     * @return int
127
+     */
128
+    public function countAllUnassignedPendingItems() {
129
+        return $this->countItemsByWhereClause("exec_time = 0 AND scheduled < ".time()." AND process_id = ''");
130
+    }
131 131
 
132
-	/**
133
-	 * Internal method to count items by a given where clause
134
-	 *
135
-	 */
136
-	protected function countItemsByWhereClause($where) {
137
-		$db 	= $this->getDB();
138
-		$rs 	= $db->exec_SELECTquery('count(*) as anz',$this->tableName,$where);
139
-		$res 	= $db->sql_fetch_assoc($rs);
132
+    /**
133
+     * Internal method to count items by a given where clause
134
+     *
135
+     */
136
+    protected function countItemsByWhereClause($where) {
137
+        $db 	= $this->getDB();
138
+        $rs 	= $db->exec_SELECTquery('count(*) as anz',$this->tableName,$where);
139
+        $res 	= $db->sql_fetch_assoc($rs);
140 140
 
141
-		return $res['anz'];
142
-	}
141
+        return $res['anz'];
142
+    }
143 143
 
144
-	/**
145
-	 * Count pending queue entries grouped by configuration key
146
-	 *
147
-	 * @param void
148
-	 * @return array
149
-	 * @author Fabrizio Branca <[email protected]>
150
-	 * @since 2099-09-03
151
-	 */
152
-	public function countPendingItemsGroupedByConfigurationKey() {
153
-		$db = $this->getDB();
154
-		$res = $db->exec_SELECTquery(
155
-			"configuration, count(*) as unprocessed, sum(process_id != '') as assignedButUnprocessed",
156
-			$this->tableName,
157
-			'exec_time = 0 AND scheduled < '.time(),
158
-			'configuration'
159
-		);
160
-		$rows = array();
161
-		while ($row = $db->sql_fetch_assoc($res)) {
162
-			$rows[] = $row;
163
-		}
164
-		return $rows;
165
-	}
144
+    /**
145
+     * Count pending queue entries grouped by configuration key
146
+     *
147
+     * @param void
148
+     * @return array
149
+     * @author Fabrizio Branca <[email protected]>
150
+     * @since 2099-09-03
151
+     */
152
+    public function countPendingItemsGroupedByConfigurationKey() {
153
+        $db = $this->getDB();
154
+        $res = $db->exec_SELECTquery(
155
+            "configuration, count(*) as unprocessed, sum(process_id != '') as assignedButUnprocessed",
156
+            $this->tableName,
157
+            'exec_time = 0 AND scheduled < '.time(),
158
+            'configuration'
159
+        );
160
+        $rows = array();
161
+        while ($row = $db->sql_fetch_assoc($res)) {
162
+            $rows[] = $row;
163
+        }
164
+        return $rows;
165
+    }
166 166
 
167
-	/**
168
-	 * Get set id with unprocessed entries
169
-	 *
170
-	 * @param void
171
-	 * @return array array of set ids
172
-	 * @author Fabrizio Branca <[email protected]>
173
-	 * @since 2009-09-03
174
-	 */
175
-	public function getSetIdWithUnprocessedEntries() {
176
-		$db = $this->getDB();
177
-		$res = $db->exec_SELECTquery(
178
-			'set_id',
179
-			$this->tableName,
180
-			'exec_time = 0 AND scheduled < '.time(),
181
-			'set_id'
182
-		);
183
-		$setIds = array();
184
-		while ($row = $db->sql_fetch_assoc($res)) {
185
-			$setIds[] = intval($row['set_id']);
186
-		}
187
-		return $setIds;
188
-	}
167
+    /**
168
+     * Get set id with unprocessed entries
169
+     *
170
+     * @param void
171
+     * @return array array of set ids
172
+     * @author Fabrizio Branca <[email protected]>
173
+     * @since 2009-09-03
174
+     */
175
+    public function getSetIdWithUnprocessedEntries() {
176
+        $db = $this->getDB();
177
+        $res = $db->exec_SELECTquery(
178
+            'set_id',
179
+            $this->tableName,
180
+            'exec_time = 0 AND scheduled < '.time(),
181
+            'set_id'
182
+        );
183
+        $setIds = array();
184
+        while ($row = $db->sql_fetch_assoc($res)) {
185
+            $setIds[] = intval($row['set_id']);
186
+        }
187
+        return $setIds;
188
+    }
189 189
 
190
-	/**
191
-	 * Get total queue entries by configuration
192
-	 *
193
-	 * @param array set ids
194
-	 * @return array totals by configuration (keys)
195
-	 * @author Fabrizio Branca <[email protected]>
196
-	 * @since 2009-09-03
197
-	 */
198
-	public function getTotalQueueEntriesByConfiguration(array $setIds) {
199
-		$totals = array();
200
-		if (count($setIds) > 0) {
201
-			$db = $this->getDB();
202
-			$res = $db->exec_SELECTquery(
203
-				'configuration, count(*) as c',
204
-				$this->tableName,
205
-				'set_id in ('. implode(',',$setIds).') AND scheduled < '.time(),
206
-				'configuration'
207
-			);
208
-			while ($row = $db->sql_fetch_assoc($res)) {
209
-				$totals[$row['configuration']] = $row['c'];
210
-			}
211
-		}
212
-		return $totals;
213
-	}
190
+    /**
191
+     * Get total queue entries by configuration
192
+     *
193
+     * @param array set ids
194
+     * @return array totals by configuration (keys)
195
+     * @author Fabrizio Branca <[email protected]>
196
+     * @since 2009-09-03
197
+     */
198
+    public function getTotalQueueEntriesByConfiguration(array $setIds) {
199
+        $totals = array();
200
+        if (count($setIds) > 0) {
201
+            $db = $this->getDB();
202
+            $res = $db->exec_SELECTquery(
203
+                'configuration, count(*) as c',
204
+                $this->tableName,
205
+                'set_id in ('. implode(',',$setIds).') AND scheduled < '.time(),
206
+                'configuration'
207
+            );
208
+            while ($row = $db->sql_fetch_assoc($res)) {
209
+                $totals[$row['configuration']] = $row['c'];
210
+            }
211
+        }
212
+        return $totals;
213
+    }
214 214
 
215
-	/**
216
-	 * Get the timestamps of the last processed entries
217
-	 *
218
-	 * @param void
219
-	 * @return array
220
-	 * @author Fabrizio Branca <[email protected]>
221
-	 * @since 2009-09-03
222
-	 */
223
-	public function getLastProcessedEntriesTimestamps($limit = 100) {
224
-		$db = $this->getDB();
225
-		$res = $db->exec_SELECTquery(
226
-			'exec_time',
227
-			$this->tableName,
228
-			'',
229
-			'',
230
-			'exec_time desc',
231
-			$limit
232
-		);
215
+    /**
216
+     * Get the timestamps of the last processed entries
217
+     *
218
+     * @param void
219
+     * @return array
220
+     * @author Fabrizio Branca <[email protected]>
221
+     * @since 2009-09-03
222
+     */
223
+    public function getLastProcessedEntriesTimestamps($limit = 100) {
224
+        $db = $this->getDB();
225
+        $res = $db->exec_SELECTquery(
226
+            'exec_time',
227
+            $this->tableName,
228
+            '',
229
+            '',
230
+            'exec_time desc',
231
+            $limit
232
+        );
233 233
 
234
-		$rows = array();
235
-		while (($row = $db->sql_fetch_assoc($res)) !== false) {
236
-			$rows[] = $row['exec_time'];
237
-		}
238
-		return $rows;
239
-	}
234
+        $rows = array();
235
+        while (($row = $db->sql_fetch_assoc($res)) !== false) {
236
+            $rows[] = $row['exec_time'];
237
+        }
238
+        return $rows;
239
+    }
240 240
 
241
-	/**
242
-	 * Get the last processed entries
243
-	 *
244
-	 * @param string $selectFields
245
-	 * @param int $limit
246
-	 * @return array
247
-	 * @author Fabrizio Branca <[email protected]>
248
-	 * @since 2010-11-16
249
-	 */
250
-	public function getLastProcessedEntries($selectFields='*', $limit='100') {
251
-		$db = $this->getDB();
252
-		$res = $db->exec_SELECTquery(
253
-			$selectFields,
254
-			$this->tableName,
255
-			'',
256
-			'',
257
-			'exec_time desc',
258
-			$limit
259
-		);
241
+    /**
242
+     * Get the last processed entries
243
+     *
244
+     * @param string $selectFields
245
+     * @param int $limit
246
+     * @return array
247
+     * @author Fabrizio Branca <[email protected]>
248
+     * @since 2010-11-16
249
+     */
250
+    public function getLastProcessedEntries($selectFields='*', $limit='100') {
251
+        $db = $this->getDB();
252
+        $res = $db->exec_SELECTquery(
253
+            $selectFields,
254
+            $this->tableName,
255
+            '',
256
+            '',
257
+            'exec_time desc',
258
+            $limit
259
+        );
260 260
 
261
-		$rows = array();
262
-		while (($row = $db->sql_fetch_assoc($res)) !== false) {
263
-			$rows[] = $row;
264
-		}
265
-		return $rows;
266
-	}
261
+        $rows = array();
262
+        while (($row = $db->sql_fetch_assoc($res)) !== false) {
263
+            $rows[] = $row;
264
+        }
265
+        return $rows;
266
+    }
267 267
 
268
-	/**
269
-	 * Get performance statistics data
270
-	 *
271
-	 * @param int start timestamp
272
-	 * @param int end timestamp
273
-	 * @return array performance data
274
-	 * @author Fabrizio Branca <[email protected]>
275
-	 * @since 2009-09-03
276
-	 */
277
-	public function getPerformanceData($start, $end) {
278
-		$db = $this->getDB();
279
-		$res = $db->exec_SELECTquery(
280
-			'process_id_completed, min(exec_time) as start, max(exec_time) as end, count(*) as urlcount',
281
-			$this->tableName,
282
-			'exec_time != 0 and exec_time >= '.intval($start). ' and exec_time <= ' . intval($end),
283
-			'process_id_completed'
284
-		);
268
+    /**
269
+     * Get performance statistics data
270
+     *
271
+     * @param int start timestamp
272
+     * @param int end timestamp
273
+     * @return array performance data
274
+     * @author Fabrizio Branca <[email protected]>
275
+     * @since 2009-09-03
276
+     */
277
+    public function getPerformanceData($start, $end) {
278
+        $db = $this->getDB();
279
+        $res = $db->exec_SELECTquery(
280
+            'process_id_completed, min(exec_time) as start, max(exec_time) as end, count(*) as urlcount',
281
+            $this->tableName,
282
+            'exec_time != 0 and exec_time >= '.intval($start). ' and exec_time <= ' . intval($end),
283
+            'process_id_completed'
284
+        );
285 285
 
286
-		$rows = array();
287
-		while (($row = $db->sql_fetch_assoc($res)) !== false) {
288
-			$rows[$row['process_id_completed']] = $row;
289
-		}
290
-		return $rows;
291
-	}
286
+        $rows = array();
287
+        while (($row = $db->sql_fetch_assoc($res)) !== false) {
288
+            $rows[$row['process_id_completed']] = $row;
289
+        }
290
+        return $rows;
291
+    }
292 292
 
293 293
     /**
294 294
      * This method is used to count all processes in the process table.
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 * @return tx_crawler_domain_queue_entry $entry
38 38
 	 */
39 39
 	public function findYoungestEntryForProcess(tx_crawler_domain_process $process) {
40
-		return $this->getFirstOrLastObjectByProcess($process,'exec_time ASC');
40
+		return $this->getFirstOrLastObjectByProcess($process, 'exec_time ASC');
41 41
 	}
42 42
 
43 43
 	/**
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	 * @return tx_crawler_domain_queue_entry
48 48
 	 */
49 49
 	public function findOldestEntryForProcess(tx_crawler_domain_process $process) {
50
-		return $this->getFirstOrLastObjectByProcess($process,'exec_time DESC');
50
+		return $this->getFirstOrLastObjectByProcess($process, 'exec_time DESC');
51 51
 	}
52 52
 
53 53
 
@@ -60,15 +60,15 @@  discard block
 block discarded – undo
60 60
 	 */
61 61
 	protected function getFirstOrLastObjectByProcess($process, $orderby) {
62 62
 		$db = $this->getDB();
63
-		$where = 'process_id_completed='.$db->fullQuoteStr($process->getProcess_id(),$this->tableName).
63
+		$where = 'process_id_completed='.$db->fullQuoteStr($process->getProcess_id(), $this->tableName).
64 64
 				 ' AND exec_time > 0 ';
65 65
 		$limit = 1;
66 66
 		$groupby = '';
67 67
 
68
-		$res 	= $db->exec_SELECTgetRows('*','tx_crawler_queue',$where,$groupby,$orderby,$limit);
69
-		if($res) {
70
-			$first 	= $res[0];
71
-		}else{
68
+		$res = $db->exec_SELECTgetRows('*', 'tx_crawler_queue', $where, $groupby, $orderby, $limit);
69
+		if ($res) {
70
+			$first = $res[0];
71
+		} else {
72 72
 			$first = array();
73 73
 		}
74 74
 		$resultObject = new tx_crawler_domain_queue_entry($first);
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 */
84 84
 	public function countExtecutedItemsByProcess($process) {
85 85
 
86
-		return $this->countItemsByWhereClause('exec_time > 0 AND process_id_completed = '.$this->getDB()->fullQuoteStr($process->getProcess_id(),$this->tableName));
86
+		return $this->countItemsByWhereClause('exec_time > 0 AND process_id_completed = '.$this->getDB()->fullQuoteStr($process->getProcess_id(), $this->tableName));
87 87
 	}
88 88
 
89 89
 	/**
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 * @return int
94 94
 	 */
95 95
 	public function countNonExecutedItemsByProcess($process) {
96
-		return $this->countItemsByWhereClause('exec_time = 0 AND process_id = '.$this->getDB()->fullQuoteStr($process->getProcess_id(),$this->tableName));
96
+		return $this->countItemsByWhereClause('exec_time = 0 AND process_id = '.$this->getDB()->fullQuoteStr($process->getProcess_id(), $this->tableName));
97 97
 	}
98 98
 
99 99
 	/**
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
 	 */
136 136
 	protected function countItemsByWhereClause($where) {
137 137
 		$db 	= $this->getDB();
138
-		$rs 	= $db->exec_SELECTquery('count(*) as anz',$this->tableName,$where);
139
-		$res 	= $db->sql_fetch_assoc($rs);
138
+		$rs 	= $db->exec_SELECTquery('count(*) as anz', $this->tableName, $where);
139
+		$res = $db->sql_fetch_assoc($rs);
140 140
 
141 141
 		return $res['anz'];
142 142
 	}
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 			$res = $db->exec_SELECTquery(
203 203
 				'configuration, count(*) as c',
204 204
 				$this->tableName,
205
-				'set_id in ('. implode(',',$setIds).') AND scheduled < '.time(),
205
+				'set_id in ('.implode(',', $setIds).') AND scheduled < '.time(),
206 206
 				'configuration'
207 207
 			);
208 208
 			while ($row = $db->sql_fetch_assoc($res)) {
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 	 * @author Fabrizio Branca <[email protected]>
248 248
 	 * @since 2010-11-16
249 249
 	 */
250
-	public function getLastProcessedEntries($selectFields='*', $limit='100') {
250
+	public function getLastProcessedEntries($selectFields = '*', $limit = '100') {
251 251
 		$db = $this->getDB();
252 252
 		$res = $db->exec_SELECTquery(
253 253
 			$selectFields,
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 		$res = $db->exec_SELECTquery(
280 280
 			'process_id_completed, min(exec_time) as start, max(exec_time) as end, count(*) as urlcount',
281 281
 			$this->tableName,
282
-			'exec_time != 0 and exec_time >= '.intval($start). ' and exec_time <= ' . intval($end),
282
+			'exec_time != 0 and exec_time >= '.intval($start).' and exec_time <= '.intval($end),
283 283
 			'process_id_completed'
284 284
 		);
285 285
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
 		$res 	= $db->exec_SELECTgetRows('*','tx_crawler_queue',$where,$groupby,$orderby,$limit);
69 69
 		if($res) {
70 70
 			$first 	= $res[0];
71
-		}else{
71
+		} else{
72 72
 			$first = array();
73 73
 		}
74 74
 		$resultObject = new tx_crawler_domain_queue_entry($first);
Please login to merge, or discard this patch.
domain/reason/class.tx_crawler_domain_reason.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@
 block discarded – undo
103 103
 	 * This method is used to set the uid of the queue entry
104 104
 	 * where the reason is relevant for.
105 105
 	 *
106
-	 * @param int $entry_id
106
+	 * @param int $entry_uid
107 107
 	 */
108 108
 	public function setQueueEntryUid($entry_uid) {
109 109
 		$this->row['queue_entry_uid'] = $entry_uid;
Please login to merge, or discard this patch.
Indentation   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -24,90 +24,90 @@
 block discarded – undo
24 24
 
25 25
 class tx_crawler_domain_reason extends tx_crawler_domain_lib_abstract_dbobject {
26 26
 
27
-	protected static $tableName = 'tx_crawler_reason';
27
+    protected static $tableName = 'tx_crawler_reason';
28 28
 
29
-	/**
30
-	 * THE CONSTANTS REPRESENT THE KIND OF THE REASON
31
-	 *
32
-	 * Convention for own states: <extensionkey>_<reason>
33
-	 */
34
-	const REASON_DEFAULT = 'crawler_default_reason';
35
-	const REASON_GUI_SUBMIT = 'crawler_gui_submit_reason';
36
-	const REASON_CLI_SUBMIT = 'crawler_cli_submit_reason';
29
+    /**
30
+     * THE CONSTANTS REPRESENT THE KIND OF THE REASON
31
+     *
32
+     * Convention for own states: <extensionkey>_<reason>
33
+     */
34
+    const REASON_DEFAULT = 'crawler_default_reason';
35
+    const REASON_GUI_SUBMIT = 'crawler_gui_submit_reason';
36
+    const REASON_CLI_SUBMIT = 'crawler_cli_submit_reason';
37 37
 
38
-	/**
39
-	 * Set uid
40
-	 *
41
-	 * @param int uid
42
-	 * @return void
43
-	 */
44
-	public function setUid($uid) {
45
-		$this->row['uid'] = $uid;
46
-	}
38
+    /**
39
+     * Set uid
40
+     *
41
+     * @param int uid
42
+     * @return void
43
+     */
44
+    public function setUid($uid) {
45
+        $this->row['uid'] = $uid;
46
+    }
47 47
 
48
-	/**
49
-	 * Method to set a timestamp for the creation time of this record
50
-	 *
51
-	 * @param int $time
52
-	 */
53
-	public function setCreationDate($time) {
54
-		$this->row['crdate'] = $time;
55
-	}
48
+    /**
49
+     * Method to set a timestamp for the creation time of this record
50
+     *
51
+     * @param int $time
52
+     */
53
+    public function setCreationDate($time) {
54
+        $this->row['crdate'] = $time;
55
+    }
56 56
 
57
-	/**
58
-	 * This method can be used to set a user id of the user who has created this reason entry
59
-	 *
60
-	 * @param int $user_id
61
-	 */
62
-	public function setBackendUserId($user_id) {
63
-		$this->row['cruser_id'] = $user_id;
64
-	}
57
+    /**
58
+     * This method can be used to set a user id of the user who has created this reason entry
59
+     *
60
+     * @param int $user_id
61
+     */
62
+    public function setBackendUserId($user_id) {
63
+        $this->row['cruser_id'] = $user_id;
64
+    }
65 65
 
66
-	/**
67
-	 * Method to set the type of the reason for this reason instance (see constances)
68
-	 *
69
-	 * @param string $string
70
-	 */
71
-	public function setReason($string) {
72
-		$this->row['reason'] = $string;
73
-	}
66
+    /**
67
+     * Method to set the type of the reason for this reason instance (see constances)
68
+     *
69
+     * @param string $string
70
+     */
71
+    public function setReason($string) {
72
+        $this->row['reason'] = $string;
73
+    }
74 74
 
75
-	/**
76
-	 * This method returns the attached reason text.
77
-	 * @return string
78
-	 */
79
-	public function getReason() {
80
-		return $this->row['reason'];
81
-	}
75
+    /**
76
+     * This method returns the attached reason text.
77
+     * @return string
78
+     */
79
+    public function getReason() {
80
+        return $this->row['reason'];
81
+    }
82 82
 
83
-	/**
84
-	 * This method can be used to assign a detail text to the crawler reason
85
-	 *
86
-	 * @param string $detail_text
87
-	 */
88
-	public function setDetailText($detail_text) {
89
-		$this->row['detail_text'] = $detail_text;
90
-	}
83
+    /**
84
+     * This method can be used to assign a detail text to the crawler reason
85
+     *
86
+     * @param string $detail_text
87
+     */
88
+    public function setDetailText($detail_text) {
89
+        $this->row['detail_text'] = $detail_text;
90
+    }
91 91
 
92
-	/**
93
-	 * Returns the attachet detail text.
94
-	 *
95
-	 * @param void
96
-	 * @return string
97
-	 */
98
-	public function getDetailText() {
99
-		return $this->row['detail_text'];
100
-	}
92
+    /**
93
+     * Returns the attachet detail text.
94
+     *
95
+     * @param void
96
+     * @return string
97
+     */
98
+    public function getDetailText() {
99
+        return $this->row['detail_text'];
100
+    }
101 101
 
102
-	/**
103
-	 * This method is used to set the uid of the queue entry
104
-	 * where the reason is relevant for.
105
-	 *
106
-	 * @param int $entry_id
107
-	 */
108
-	public function setQueueEntryUid($entry_uid) {
109
-		$this->row['queue_entry_uid'] = $entry_uid;
110
-	}
102
+    /**
103
+     * This method is used to set the uid of the queue entry
104
+     * where the reason is relevant for.
105
+     *
106
+     * @param int $entry_id
107
+     */
108
+    public function setQueueEntryUid($entry_uid) {
109
+        $this->row['queue_entry_uid'] = $entry_uid;
110
+    }
111 111
 
112 112
 }
113 113
 
Please login to merge, or discard this patch.
modfunc1/class.tx_crawler_modfunc1.php 4 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -709,6 +709,7 @@  discard block
 block discarded – undo
709 709
 	 * @param	array		Page row or set-id
710 710
 	 * @param	string		Title string
711 711
 	 * @param	int			Items per Page setting
712
+	 * @param string $titleString
712 713
 	 * @return	string		HTML <tr> content (one or more)
713 714
 	 */
714 715
 	function drawLog_addRows($pageRow_setId, $titleString, $itemsPerPage=10) {
@@ -1214,6 +1215,8 @@  discard block
 block discarded – undo
1214 1215
 	 * @param	string		Selector box name
1215 1216
 	 * @param	string		Selector box value (array for multiple...)
1216 1217
 	 * @param	boolean		If set, will draw multiple box.
1218
+	 * @param string $name
1219
+	 * @param integer $multiple
1217 1220
 	 * @return	string		HTML select element
1218 1221
 	 */
1219 1222
 	function selectorBox($optArray, $name, $value, $multiple)	{
Please login to merge, or discard this patch.
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.
Spacing   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -90,10 +90,10 @@  discard block
 block discarded – undo
90 90
 	 *
91 91
 	 * @return	array		Menu array
92 92
 	 */
93
-	function modMenu()	{
93
+	function modMenu() {
94 94
 		global $LANG;
95 95
 
96
-		return array (
96
+		return array(
97 97
 			'depth' => array(
98 98
 				0 => $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.depth_0'),
99 99
 				1 => $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.depth_1'),
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 		}
151 151
 
152 152
 			// Set CSS styles specific for this document:
153
-		$this->pObj->content = str_replace('/*###POSTCSSMARKER###*/','
153
+		$this->pObj->content = str_replace('/*###POSTCSSMARKER###*/', '
154 154
 			TABLE.c-list TR TD { white-space: nowrap; vertical-align: top; }
155 155
 		',$this->pObj->content);
156 156
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 		*/
196 196
 
197 197
 			// Additional menus for the log type:
198
-		if ($this->pObj->MOD_SETTINGS['crawlaction']==='log')	{
198
+		if ($this->pObj->MOD_SETTINGS['crawlaction'] === 'log') {
199 199
 			$h_func .= \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu(
200 200
 				$this->pObj->id,
201 201
 				'SET[depth]',
@@ -204,15 +204,15 @@  discard block
 block discarded – undo
204 204
 				'index.php'
205 205
 			);
206 206
 
207
-			$quiPart = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details') ? '&qid_details=' . intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) : '';
207
+			$quiPart = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details') ? '&qid_details='.intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) : '';
208 208
 
209 209
 			$setId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID'));
210 210
 
211
-			$h_func.= '<hr/>'.
212
-					$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) . ' - ' .
213
-					$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) . ' - ' .
214
-					$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) . ' - ' .
215
-					$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage').': ' .
211
+			$h_func .= '<hr/>'.
212
+					$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).' - '.
213
+					$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).' - '.
214
+					$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).' - '.
215
+					$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage').': '.
216 216
 					\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu(
217 217
 						$this->pObj->id,
218 218
 						'SET[itemsPerPage]',
@@ -222,11 +222,11 @@  discard block
 block discarded – undo
222 222
 					);
223 223
 		}
224 224
 
225
-		$theOutput= $this->pObj->doc->spacer(5);
226
-		$theOutput.= $this->pObj->doc->section($LANG->getLL('title'), $h_func, 0, 1);
225
+		$theOutput = $this->pObj->doc->spacer(5);
226
+		$theOutput .= $this->pObj->doc->section($LANG->getLL('title'), $h_func, 0, 1);
227 227
 
228 228
 			// Branch based on type:
229
-		switch ((string)$this->pObj->MOD_SETTINGS['crawlaction']) {
229
+		switch ((string) $this->pObj->MOD_SETTINGS['crawlaction']) {
230 230
 			case 'start':
231 231
 				if (empty($this->pObj->id)) {
232 232
 					$this->addErrorMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noPageSelected'));
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 	 *
275 275
 	 * @return	string		HTML output
276 276
 	 */
277
-	function drawURLs()	{
277
+	function drawURLs() {
278 278
 		global $BACK_PATH, $BE_USER;
279 279
 
280 280
 			// Init:
@@ -283,12 +283,12 @@  discard block
 block discarded – undo
283 283
 		$this->downloadCrawlUrls = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('_download');
284 284
 		$this->makeCrawlerProcessableChecks();
285 285
 
286
-		switch((string)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('tstamp'))	{
286
+		switch ((string) \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('tstamp')) {
287 287
 			case 'midnight':
288
-				$this->scheduledTime = mktime(0,0,0);
288
+				$this->scheduledTime = mktime(0, 0, 0);
289 289
 			break;
290 290
 			case '04:00':
291
-				$this->scheduledTime = mktime(0,0,0)+4*3600;
291
+				$this->scheduledTime = mktime(0, 0, 0) + 4 * 3600;
292 292
 			break;
293 293
 			case 'now':
294 294
 			default:
@@ -308,23 +308,23 @@  discard block
 block discarded – undo
308 308
 		$this->crawlerObj->setID = \TYPO3\CMS\Core\Utility\GeneralUtility::md5int(microtime());
309 309
 
310 310
 		if (empty($this->incomingConfigurationSelection)
311
-			|| (count($this->incomingConfigurationSelection)==1 && empty($this->incomingConfigurationSelection[0]))
311
+			|| (count($this->incomingConfigurationSelection) == 1 && empty($this->incomingConfigurationSelection[0]))
312 312
 			) {
313
-			$code= '
313
+			$code = '
314 314
 			<tr>
315 315
 				<td colspan="7"><b>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noConfigSelected').'</b></td>
316 316
 			</tr>';
317 317
 		} else {
318
-			if($this->submitCrawlUrls){
318
+			if ($this->submitCrawlUrls) {
319 319
 				$reason = new tx_crawler_domain_reason();
320 320
 				$reason->setReason(tx_crawler_domain_reason::REASON_GUI_SUBMIT);
321 321
 
322
-				if($BE_USER instanceof \TYPO3\CMS\Core\Authentication\BackendUserAuthentication){ $username = $BE_USER->user['username']; }
322
+				if ($BE_USER instanceof \TYPO3\CMS\Core\Authentication\BackendUserAuthentication) { $username = $BE_USER->user['username']; }
323 323
 				$reason->setDetailText('The user '.$username.' added pages to the crawler queue manually ');
324 324
 
325
-				tx_crawler_domain_events_dispatcher::getInstance()->post(	'invokeQueueChange',
325
+				tx_crawler_domain_events_dispatcher::getInstance()->post('invokeQueueChange',
326 326
 																			$this->findCrawler()->setID,
327
-																			array(	'reason' => $reason ));
327
+																			array('reason' => $reason));
328 328
 			}
329 329
 
330 330
 			$code = $this->crawlerObj->getPageTreeAndUrls(
@@ -345,18 +345,18 @@  discard block
 block discarded – undo
345 345
 		$this->duplicateTrack = $this->crawlerObj->duplicateTrack;
346 346
 
347 347
 		$output = '';
348
-		if ($code)	{
348
+		if ($code) {
349 349
 
350 350
 			$output .= '<h3>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.configuration').':</h3>';
351 351
 			$output .= '<input type="hidden" name="id" value="'.intval($this->pObj->id).'" />';
352 352
 
353
-			if (!$this->submitCrawlUrls)	{
353
+			if (!$this->submitCrawlUrls) {
354 354
 				$output .= $this->drawURLs_cfgSelectors().'<br />';
355 355
 				$output .= '<input type="submit" name="_update" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerUpdate').'" /> ';
356 356
 				$output .= '<input type="submit" name="_crawl" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerCrawl').'" /> ';
357 357
 				$output .= '<input type="submit" name="_download" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerDownload').'" /><br /><br />';
358 358
 				$output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.count').': '.count(array_keys($this->duplicateTrack)).'<br />';
359
-				$output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime').': '.date('H:i:s',time()).'<br />';
359
+				$output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime').': '.date('H:i:s', time()).'<br />';
360 360
 				$output .= '<br />
361 361
 					<table class="lrPadding c-list url-table">'.
362 362
 						$this->drawURLs_printTableHeader().
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
 		}
371 371
 
372 372
 			// Download Urls to crawl:
373
-		if ($this->downloadCrawlUrls)	{
373
+		if ($this->downloadCrawlUrls) {
374 374
 
375 375
 				// Creating output header:
376 376
 			$mimeType = 'application/octet-stream';
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 			Header('Content-Disposition: attachment; filename=CrawlerUrls.txt');
379 379
 
380 380
 				// Printing the content of the CSV lines:
381
-			echo implode(chr(13).chr(10),$this->downloadUrls);
381
+			echo implode(chr(13).chr(10), $this->downloadUrls);
382 382
 
383 383
 				// Exits:
384 384
 			exit;
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 	 *
394 394
 	 * @return	string		HTML table
395 395
 	 */
396
-	function drawURLs_cfgSelectors()	{
396
+	function drawURLs_cfgSelectors() {
397 397
 
398 398
 			// depth
399 399
 		$cell[] = $this->selectorBox(
@@ -409,11 +409,11 @@  discard block
 block discarded – undo
409 409
 			$this->pObj->MOD_SETTINGS['depth'],
410 410
 			0
411 411
 		);
412
-		$availableConfigurations = $this->crawlerObj->getConfigurationsForBranch($this->pObj->id, $this->pObj->MOD_SETTINGS['depth']?$this->pObj->MOD_SETTINGS['depth']:0 );
412
+		$availableConfigurations = $this->crawlerObj->getConfigurationsForBranch($this->pObj->id, $this->pObj->MOD_SETTINGS['depth'] ? $this->pObj->MOD_SETTINGS['depth'] : 0);
413 413
 
414 414
 			// Configurations
415 415
 		$cell[] = $this->selectorBox(
416
-			empty($availableConfigurations)?array():array_combine($availableConfigurations, $availableConfigurations),
416
+			empty($availableConfigurations) ? array() : array_combine($availableConfigurations, $availableConfigurations),
417 417
 			'configurationSelection',
418 418
 			$this->incomingConfigurationSelection,
419 419
 			1
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
 	 *
475 475
 	 * @return	string		Table header
476 476
 	 */
477
-	function drawURLs_printTableHeader()	{
477
+	function drawURLs_printTableHeader() {
478 478
 
479 479
 		$content = '
480 480
 			<tr class="bgColor5 tableheader">
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 	 *
513 513
 	 * @return	string		HTML output
514 514
 	 */
515
-	function drawLog()	{
515
+	function drawLog() {
516 516
 		global $BACK_PATH;
517 517
 		$output = '';
518 518
 
@@ -524,46 +524,46 @@  discard block
 block discarded – undo
524 524
 		$this->CSVExport = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_csv');
525 525
 
526 526
 			// Read URL:
527
-		if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_read'))	{
528
-			$this->crawlerObj->readUrl(intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_read')),TRUE);
527
+		if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_read')) {
528
+			$this->crawlerObj->readUrl(intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_read')), TRUE);
529 529
 		}
530 530
 
531 531
 			// Look for set ID sent - if it is, we will display contents of that set:
532 532
 		$showSetId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID'));
533 533
 
534 534
 			// Show details:
535
-		if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details'))	{
535
+		if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) {
536 536
 
537 537
 				// Get entry record:
538
-			list($q_entry) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*','tx_crawler_queue','qid='.intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')));
538
+			list($q_entry) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'tx_crawler_queue', 'qid='.intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')));
539 539
 
540 540
 				// Explode values:
541 541
 				$resStatus = $this->getResStatus($q_entry);
542 542
 			$q_entry['parameters'] = unserialize($q_entry['parameters']);
543 543
 			$q_entry['result_data'] = unserialize($q_entry['result_data']);
544
-			if (is_array($q_entry['result_data']))	{
544
+			if (is_array($q_entry['result_data'])) {
545 545
 				$q_entry['result_data']['content'] = unserialize($q_entry['result_data']['content']);
546 546
 			}
547 547
 
548
-			if(!$this->pObj->MOD_SETTINGS['log_resultLog']) {
548
+			if (!$this->pObj->MOD_SETTINGS['log_resultLog']) {
549 549
 				unset($q_entry['result_data']['content']['log']);
550 550
 			}
551 551
 
552 552
 				// Print rudimentary details:
553 553
 			$output .= '
554 554
 				<br /><br />
555
-				<input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.back') . '" name="_back" />
556
-				<input type="hidden" value="' . $this->pObj->id . '" name="id" />
557
-				<input type="hidden" value="' . $showSetId . '" name="setID" />
555
+				<input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.back').'" name="_back" />
556
+				<input type="hidden" value="' . $this->pObj->id.'" name="id" />
557
+				<input type="hidden" value="' . $showSetId.'" name="setID" />
558 558
 				<br />
559
-				Current server time: ' . date('H:i:s', time()) . '<br />' .
560
-				'Status: ' . $resStatus . '<br />' .
559
+				Current server time: ' . date('H:i:s', time()).'<br />'.
560
+				'Status: '.$resStatus.'<br />'.
561 561
 				\TYPO3\CMS\Core\Utility\DebugUtility::viewArray($q_entry);
562 562
 		} else {	// Show list:
563 563
 
564 564
 				// If either id or set id, show list:
565
-			if ($this->pObj->id || $showSetId)	{
566
-				if ($this->pObj->id)	{
565
+			if ($this->pObj->id || $showSetId) {
566
+				if ($this->pObj->id) {
567 567
 						// Drawing tree:
568 568
 					$tree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Backend\Tree\View\PageTreeView');
569 569
 					$perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
@@ -577,16 +577,16 @@  discard block
 block discarded – undo
577 577
 					);
578 578
 
579 579
 						// Get branch beneath:
580
-					if ($this->pObj->MOD_SETTINGS['depth'])	{
580
+					if ($this->pObj->MOD_SETTINGS['depth']) {
581 581
 						$tree->getTree($this->pObj->id, $this->pObj->MOD_SETTINGS['depth'], '');
582 582
 					}
583 583
 
584 584
 						// Traverse page tree:
585 585
 					$code = ''; $count = 0;
586
-					foreach($tree->tree as $data)	{
586
+					foreach ($tree->tree as $data) {
587 587
 						$code .= $this->drawLog_addRows(
588 588
 									$data['row'],
589
-									$data['HTML'] . \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages',$data['row'],TRUE),
589
+									$data['HTML'].\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', $data['row'], TRUE),
590 590
 									intval($this->pObj->MOD_SETTINGS['itemsPerPage'])
591 591
 								);
592 592
 						if (++$count == 1000) {
@@ -595,13 +595,13 @@  discard block
 block discarded – undo
595 595
 					}
596 596
 				} else {
597 597
 					$code = '';
598
-					$code.= $this->drawLog_addRows(
598
+					$code .= $this->drawLog_addRows(
599 599
 								$showSetId,
600 600
 								'Set ID: '.$showSetId
601 601
 							);
602 602
 				}
603 603
 
604
-				if ($code)	{
604
+				if ($code) {
605 605
 
606 606
 					$output .= '
607 607
 						<br /><br />
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
 						<input type="hidden" value="'.$this->pObj->id.'" name="id" />
613 613
 						<input type="hidden" value="'.$showSetId.'" name="setID" />
614 614
 						<br />
615
-						'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime').': '.date('H:i:s',time()).'
615
+						'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime').': '.date('H:i:s', time()).'
616 616
 						<br /><br />
617 617
 
618 618
 
@@ -638,10 +638,10 @@  discard block
 block discarded – undo
638 638
 					</tr>
639 639
 				';
640 640
 
641
-				$cc=0;
642
-				foreach($setList as $set)	{
643
-					$code.= '
644
-						<tr class="bgColor'.($cc%2 ? '-20':'-10').'">
641
+				$cc = 0;
642
+				foreach ($setList as $set) {
643
+					$code .= '
644
+						<tr class="bgColor'.($cc % 2 ? '-20' : '-10').'">
645 645
 							<td><a href="'.htmlspecialchars('index.php?setID='.$set['set_id']).'">'.$set['set_id'].'</a></td>
646 646
 							<td>'.$set['count_value'].'</td>
647 647
 							<td>'.\TYPO3\CMS\Backend\Utility\BackendUtility::dateTimeAge($set['scheduled']).'</td>
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
 			}
660 660
 		}
661 661
 
662
-		if($this->CSVExport) {
662
+		if ($this->CSVExport) {
663 663
 			$this->outputCsvFile();
664 664
 		}
665 665
 
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
 		$csvLines[] = \TYPO3\CMS\Core\Utility\GeneralUtility::csvValues($fieldNames);
686 686
 
687 687
 			// Data:
688
-		foreach($this->CSVaccu as $row)	{
688
+		foreach ($this->CSVaccu as $row) {
689 689
 			$csvLines[] = \TYPO3\CMS\Core\Utility\GeneralUtility::csvValues($row);
690 690
 		}
691 691
 
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
 		Header('Content-Disposition: attachment; filename=CrawlerLog.csv');
696 696
 
697 697
 			// Printing the content of the CSV lines:
698
-		echo implode(chr(13).chr(10),$csvLines);
698
+		echo implode(chr(13).chr(10), $csvLines);
699 699
 
700 700
 			// Exits:
701 701
 		exit;
@@ -710,14 +710,14 @@  discard block
 block discarded – undo
710 710
 	 * @param	int			Items per Page setting
711 711
 	 * @return	string		HTML <tr> content (one or more)
712 712
 	 */
713
-	function drawLog_addRows($pageRow_setId, $titleString, $itemsPerPage=10) {
713
+	function drawLog_addRows($pageRow_setId, $titleString, $itemsPerPage = 10) {
714 714
 
715 715
 			// If Flush button is pressed, flush tables instead of selecting entries:
716 716
 
717
-		if(\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_flush')) {
717
+		if (\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_flush')) {
718 718
 			$doFlush = true;
719 719
 			$doFullFlush = false;
720
-		} elseif(\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_flush_all')) {
720
+		} elseif (\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_flush_all')) {
721 721
 			$doFlush = true;
722 722
 			$doFullFlush = true;
723 723
 		} else {
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
 		}
727 727
 
728 728
 			// Get result:
729
-		if (is_array($pageRow_setId))	{
729
+		if (is_array($pageRow_setId)) {
730 730
 			$res = $this->crawlerObj->getLogEntriesForPageId($pageRow_setId['uid'], $this->pObj->MOD_SETTINGS['log_display'], $doFlush, $doFullFlush, intval($itemsPerPage));
731 731
 		} else {
732 732
 			$res = $this->crawlerObj->getLogEntriesForSetId($pageRow_setId, $this->pObj->MOD_SETTINGS['log_display'], $doFlush, $doFullFlush, intval($itemsPerPage));
@@ -737,14 +737,14 @@  discard block
 block discarded – undo
737 737
 				+ ($this->pObj->MOD_SETTINGS['log_resultLog'] ? -1 : 0)
738 738
 				+ ($this->pObj->MOD_SETTINGS['log_feVars'] ? 3 : 0);
739 739
 
740
-		if (count($res))	{
740
+		if (count($res)) {
741 741
 				// Traverse parameter combinations:
742 742
 			$c = 0;
743
-			$content='';
744
-			foreach($res as $kk => $vv)	{
743
+			$content = '';
744
+			foreach ($res as $kk => $vv) {
745 745
 
746 746
 					// Title column:
747
-				if (!$c)	{
747
+				if (!$c) {
748 748
 					$titleClm = '<td rowspan="'.count($res).'">'.$titleString.'</td>';
749 749
 				} else {
750 750
 					$titleClm = '';
@@ -761,16 +761,16 @@  discard block
 block discarded – undo
761 761
 
762 762
 					// Put data into array:
763 763
 				$rowData = array();
764
-				if ($this->pObj->MOD_SETTINGS['log_resultLog'])	{
764
+				if ($this->pObj->MOD_SETTINGS['log_resultLog']) {
765 765
 					$rowData['result_log'] = $resLog;
766 766
 				} else {
767
-					$rowData['scheduled'] = ($vv['scheduled']> 0) ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']) : ' '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.immediate');
767
+					$rowData['scheduled'] = ($vv['scheduled'] > 0) ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']) : ' '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.immediate');
768 768
 					$rowData['exec_time'] = $vv['exec_time'] ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['exec_time']) : '-';
769 769
 				}
770
-				$rowData['result_status'] = \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($resStatus,50);
770
+				$rowData['result_status'] = \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($resStatus, 50);
771 771
 				$rowData['url'] = '<a href="'.htmlspecialchars($parameters['url']).'" target="_newWIndow">'.htmlspecialchars($parameters['url']).'</a>';
772 772
 				$rowData['feUserGroupList'] = $parameters['feUserGroupList'];
773
-				$rowData['procInstructions'] = is_array($parameters['procInstructions']) ? implode('; ',$parameters['procInstructions']) : '';
773
+				$rowData['procInstructions'] = is_array($parameters['procInstructions']) ? implode('; ', $parameters['procInstructions']) : '';
774 774
 				$rowData['set_id'] = $vv['set_id'];
775 775
 
776 776
 				if ($this->pObj->MOD_SETTINGS['log_feVars']) {
@@ -781,34 +781,34 @@  discard block
 block discarded – undo
781 781
 
782 782
 				$setId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID'));
783 783
 
784
-				$refreshIcon = $GLOBALS['BACK_PATH'] . 'gfx/refresh_n.gif';
785
-				if (version_compare(TYPO3_version,'7.0','>=')) {
786
-					$refreshIcon = $GLOBALS['BACK_PATH'] . 'sysext/t3skin/extjs/images/grid/refresh.gif';
784
+				$refreshIcon = $GLOBALS['BACK_PATH'].'gfx/refresh_n.gif';
785
+				if (version_compare(TYPO3_version, '7.0', '>=')) {
786
+					$refreshIcon = $GLOBALS['BACK_PATH'].'sysext/t3skin/extjs/images/grid/refresh.gif';
787 787
 				}
788 788
 
789 789
 					// Put rows together:
790
-				$content.= '
791
-					<tr class="bgColor'.($c%2 ? '-20':'-10').'">
790
+				$content .= '
791
+					<tr class="bgColor'.($c % 2 ? '-20' : '-10').'">
792 792
 						'.$titleClm.'
793
-						<td><a href="' . $this->getModuleUrl(array('qid_details' => $vv['qid'], 'setID' => $setId)) . '">'.htmlspecialchars($vv['qid']).'</a></td>
794
-						<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>';
795
-				foreach($rowData as $fKey => $value) {
793
+						<td><a href="' . $this->getModuleUrl(array('qid_details' => $vv['qid'], 'setID' => $setId)).'">'.htmlspecialchars($vv['qid']).'</a></td>
794
+						<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>';
795
+				foreach ($rowData as $fKey => $value) {
796 796
 
797
-					if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('url',$fKey))	{
798
-						$content.= '
797
+					if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('url', $fKey)) {
798
+						$content .= '
799 799
 						<td>'.$value.'</td>';
800 800
 					} else {
801
-						$content.= '
801
+						$content .= '
802 802
 						<td>'.nl2br(htmlspecialchars($value)).'</td>';
803 803
 					}
804 804
 				}
805
-				$content.= '
805
+				$content .= '
806 806
 					</tr>';
807 807
 				$c++;
808 808
 
809
-				if ($this->CSVExport)	{
809
+				if ($this->CSVExport) {
810 810
 						// Only for CSV (adding qid and scheduled/exec_time if needed):
811
-					$rowData['result_log'] = implode('// ',explode(chr(10),$resLog));
811
+					$rowData['result_log'] = implode('// ', explode(chr(10), $resLog));
812 812
 					$rowData['qid'] = $vv['qid'];
813 813
 					$rowData['scheduled'] = \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']);
814 814
 					$rowData['exec_time'] = $vv['exec_time'] ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['exec_time']) : '-';
@@ -851,7 +851,7 @@  discard block
 block discarded – undo
851 851
 	 *
852 852
 	 * @return	string		Table header
853 853
 	 */
854
-	function drawLog_printTableHeader()	{
854
+	function drawLog_printTableHeader() {
855 855
 
856 856
 		$content = '
857 857
 			<tr class="bgColor5 tableheader">
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
         }
903 903
 
904 904
 	function getResStatus($vv) {
905
-		if ($vv['result_data'])	{
905
+		if ($vv['result_data']) {
906 906
 			$requestContent = unserialize($vv['result_data']);
907 907
 			$requestResult = unserialize($requestContent['content']);
908 908
 			if (is_array($requestResult)) {
@@ -911,9 +911,9 @@  discard block
 block discarded – undo
911 911
 				} else {
912 912
 					$resStatus = implode("\n", $requestResult['errorlog']);
913 913
 				}
914
-				$resLog = is_array($requestResult['log']) ?  implode(chr(10),$requestResult['log']) : '';
914
+				$resLog = is_array($requestResult['log']) ?  implode(chr(10), $requestResult['log']) : '';
915 915
 			} else {
916
-				$resStatus = 'Error: '.substr(preg_replace('/\s+/',' ',strip_tags($requestContent['content'])),0,10000).'...';
916
+				$resStatus = 'Error: '.substr(preg_replace('/\s+/', ' ', strip_tags($requestContent['content'])), 0, 10000).'...';
917 917
 			}
918 918
 		} else {
919 919
 			$resStatus = '-';
@@ -941,7 +941,7 @@  discard block
 block discarded – undo
941 941
 	 * @param void
942 942
 	 * @return string
943 943
 	 */
944
-	protected function drawProcessOverviewAction(){
944
+	protected function drawProcessOverviewAction() {
945 945
 
946 946
 		$this->runRefreshHooks();
947 947
 
@@ -955,20 +955,20 @@  discard block
 block discarded – undo
955 955
 			$this->addErrorMessage($e->getMessage());
956 956
 		}
957 957
 
958
-		$offset 	= intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('offset'));
959
-		$perpage 	= 20;
958
+		$offset = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('offset'));
959
+		$perpage = 20;
960 960
 
961
-		$processRepository	= new tx_crawler_domain_process_repository();
962
-		$queueRepository	= new tx_crawler_domain_queue_repository();
961
+		$processRepository = new tx_crawler_domain_process_repository();
962
+		$queueRepository = new tx_crawler_domain_queue_repository();
963 963
 
964 964
 		$mode = $this->pObj->MOD_SETTINGS['processListMode'];
965 965
 		if ($mode == 'detail') {
966 966
 			$where = '';
967
-		} elseif($mode == 'simple') {
967
+		} elseif ($mode == 'simple') {
968 968
 			$where = 'active = 1';
969 969
 		}
970 970
 
971
-		$allProcesses 		= $processRepository->findAll('ttl','DESC', $perpage, $offset,$where);
971
+		$allProcesses = $processRepository->findAll('ttl', 'DESC', $perpage, $offset, $where);
972 972
 		$allCount			= $processRepository->countAll($where);
973 973
 
974 974
 		$listView			= new tx_crawler_view_process_list();
@@ -980,10 +980,10 @@  discard block
 block discarded – undo
980 980
 		$listView->setTotalUnprocessedItemCount($queueRepository->countAllPendingItems());
981 981
 		$listView->setAssignedUnprocessedItemCount($queueRepository->countAllAssignedPendingItems());
982 982
 		$listView->setActiveProcessCount($processRepository->countActive());
983
-		$listView->setMaxActiveProcessCount(tx_crawler_api::forceIntegerInRange($this->extensionSettings['processLimit'],1,99,1));
983
+		$listView->setMaxActiveProcessCount(tx_crawler_api::forceIntegerInRange($this->extensionSettings['processLimit'], 1, 99, 1));
984 984
 		$listView->setMode($mode);
985 985
 
986
-		$paginationView		= new tx_crawler_view_pagination();
986
+		$paginationView = new tx_crawler_view_pagination();
987 987
 		$paginationView->setCurrentOffset($offset);
988 988
 		$paginationView->setPerPage($perpage);
989 989
 		$paginationView->setTotalItemCount($allCount);
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
 
1021 1021
 		$exitCode = 0;
1022 1022
 		$out = array();
1023
-		exec(escapeshellcmd($this->extensionSettings['phpPath'] . ' -v'), $out, $exitCode);
1023
+		exec(escapeshellcmd($this->extensionSettings['phpPath'].' -v'), $out, $exitCode);
1024 1024
 		if ($exitCode > 0) {
1025 1025
 			$this->addErrorMessage(sprintf($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.phpBinaryNotFound'), htmlspecialchars($this->extensionSettings['phpPath'])));
1026 1026
 		}
@@ -1083,7 +1083,7 @@  discard block
 block discarded – undo
1083 1083
 	 * @param void
1084 1084
 	 * @return void
1085 1085
 	 */
1086
-	protected function handleProcessOverviewActions(){
1086
+	protected function handleProcessOverviewActions() {
1087 1087
 
1088 1088
 		$crawler = $this->findCrawler();
1089 1089
 
@@ -1116,8 +1116,8 @@  discard block
 block discarded – undo
1116 1116
 	 * @return tx_crawler_lib crawler object
1117 1117
 	 * @author Timo Schmidt <[email protected]>
1118 1118
 	 */
1119
-	protected function findCrawler(){
1120
-		if(!$this->crawlerObj instanceof tx_crawler_lib){
1119
+	protected function findCrawler() {
1120
+		if (!$this->crawlerObj instanceof tx_crawler_lib) {
1121 1121
 			$this->crawlerObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_lib');
1122 1122
 		}
1123 1123
 		return $this->crawlerObj;
@@ -1218,15 +1218,15 @@  discard block
 block discarded – undo
1218 1218
 	 * @param	boolean		If set, will draw multiple box.
1219 1219
 	 * @return	string		HTML select element
1220 1220
 	 */
1221
-	function selectorBox($optArray, $name, $value, $multiple)	{
1221
+	function selectorBox($optArray, $name, $value, $multiple) {
1222 1222
 
1223 1223
 		$options = array();
1224
-		foreach($optArray as $key => $val)	{
1224
+		foreach ($optArray as $key => $val) {
1225 1225
 			$options[] = '
1226
-				<option value="'.htmlspecialchars($key).'"'.((!$multiple && !strcmp($value,$key)) || ($multiple && in_array($key,(array)$value))?' selected="selected"':'').'>'.htmlspecialchars($val).'</option>';
1226
+				<option value="'.htmlspecialchars($key).'"'.((!$multiple && !strcmp($value, $key)) || ($multiple && in_array($key, (array) $value)) ? ' selected="selected"' : '').'>'.htmlspecialchars($val).'</option>';
1227 1227
 		}
1228 1228
 
1229
-		$output = '<select name="'.htmlspecialchars($name.($multiple?'[]':'')).'"'.($multiple ? ' multiple="multiple" size="'.count($options).'"' : '').'>'.implode('',$options).'</select>';
1229
+		$output = '<select name="'.htmlspecialchars($name.($multiple ? '[]' : '')).'"'.($multiple ? ' multiple="multiple" size="'.count($options).'"' : '').'>'.implode('', $options).'</select>';
1230 1230
 
1231 1231
 		return $output;
1232 1232
 	}
@@ -1265,6 +1265,6 @@  discard block
 block discarded – undo
1265 1265
 	}
1266 1266
 }
1267 1267
 
1268
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/modfunc1/class.tx_crawler_modfunc1.php'])	{
1268
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/modfunc1/class.tx_crawler_modfunc1.php']) {
1269 1269
 	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/modfunc1/class.tx_crawler_modfunc1.php']);
1270 1270
 }
Please login to merge, or discard this patch.
Indentation   +942 added lines, -942 removed lines patch added patch discarded remove patch
@@ -28,126 +28,126 @@  discard block
 block discarded – undo
28 28
  * Class tx_crawler_modfunc1
29 29
  */
30 30
 class tx_crawler_modfunc1 extends \TYPO3\CMS\Backend\Module\AbstractFunctionModule {
31
-		// Internal, dynamic:
32
-	var $duplicateTrack = array();
33
-	var $submitCrawlUrls = FALSE;
34
-	var $downloadCrawlUrls = FALSE;
35
-
36
-	var $scheduledTime = 0;
37
-	var $reqMinute = 0;
38
-
39
-	/**
40
-	 * @var array holds the selection of configuration from the configuration selector box
41
-	 */
42
-	var $incomingConfigurationSelection = array();
43
-
44
-	/**
45
-	 * @var tx_crawler_lib
46
-	 */
47
-	var $crawlerObj;
48
-
49
-	var $CSVaccu = array();
50
-
51
-	/**
52
-	 * If true the user requested a CSV export of the queue
53
-	 *
54
-	 * @var boolean
55
-	 */
56
-	var $CSVExport = FALSE;
57
-
58
-	var $downloadUrls = array();
59
-
60
-	/**
61
-	 * Holds the configuration from ext_conf_template loaded by loadExtensionSettings()
62
-	 *
63
-	 * @var array
64
-	 */
65
-	protected $extensionSettings = array();
66
-
67
-	/**
68
-	 * Indicate that an flash message with an error is present.
69
-	 *
70
-	 * @var boolean
71
-	 */
72
-	protected $isErrorDetected = false;
73
-
74
-	/**
75
-	 * the constructor
76
-	 */
77
-	public function __construct() {
78
-		$this->processManager = new tx_crawler_domain_process_manager();
79
-	}
80
-
81
-	/**
82
-	 * Additions to the function menu array
83
-	 *
84
-	 * @return	array		Menu array
85
-	 */
86
-	function modMenu()	{
87
-		global $LANG;
88
-
89
-		return array (
90
-			'depth' => array(
91
-				0 => $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.depth_0'),
92
-				1 => $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.depth_1'),
93
-				2 => $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.depth_2'),
94
-				3 => $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.depth_3'),
95
-				4 => $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.depth_4'),
96
-				99 => $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.depth_infi'),
97
-			),
98
-			'crawlaction' => array(
99
-				'start' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.start'),
100
-				'log' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.log'),
101
-				'multiprocess' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.multiprocess')
102
-			),
103
-			'log_resultLog' => '',
104
-			'log_feVars' => '',
105
-			'processListMode' => '',
106
-			'log_display' => array(
107
-				'all' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.all'),
108
-				'pending' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.pending'),
109
-				'finished' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.finished')
110
-			),
111
-			'itemsPerPage' => array(
112
-				'5' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage.5'),
113
-				'10' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage.10'),
114
-				'50' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage.50'),
115
-				'0' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage.0')
116
-			)
117
-		);
118
-	}
119
-
120
-	/**
121
-	 * Load extension settings
122
-	 *
123
-	 * @param void
124
-	 * @return void
125
-	 */
126
-	protected function loadExtensionSettings() {
127
-		$this->extensionSettings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['crawler']);
128
-	}
129
-
130
-	/**
131
-	 * Main function
132
-	 *
133
-	 * @return	string		HTML output
134
-	 */
135
-	function main() {
136
-		global $LANG, $BACK_PATH;
137
-
138
-		$this->incLocalLang();
139
-
140
-		$this->loadExtensionSettings();
141
-		if (empty($this->pObj->MOD_SETTINGS['processListMode'])) {
142
-			$this->pObj->MOD_SETTINGS['processListMode'] = 'simple';
143
-		}
31
+        // Internal, dynamic:
32
+    var $duplicateTrack = array();
33
+    var $submitCrawlUrls = FALSE;
34
+    var $downloadCrawlUrls = FALSE;
35
+
36
+    var $scheduledTime = 0;
37
+    var $reqMinute = 0;
38
+
39
+    /**
40
+     * @var array holds the selection of configuration from the configuration selector box
41
+     */
42
+    var $incomingConfigurationSelection = array();
43
+
44
+    /**
45
+     * @var tx_crawler_lib
46
+     */
47
+    var $crawlerObj;
48
+
49
+    var $CSVaccu = array();
50
+
51
+    /**
52
+     * If true the user requested a CSV export of the queue
53
+     *
54
+     * @var boolean
55
+     */
56
+    var $CSVExport = FALSE;
57
+
58
+    var $downloadUrls = array();
59
+
60
+    /**
61
+     * Holds the configuration from ext_conf_template loaded by loadExtensionSettings()
62
+     *
63
+     * @var array
64
+     */
65
+    protected $extensionSettings = array();
66
+
67
+    /**
68
+     * Indicate that an flash message with an error is present.
69
+     *
70
+     * @var boolean
71
+     */
72
+    protected $isErrorDetected = false;
73
+
74
+    /**
75
+     * the constructor
76
+     */
77
+    public function __construct() {
78
+        $this->processManager = new tx_crawler_domain_process_manager();
79
+    }
80
+
81
+    /**
82
+     * Additions to the function menu array
83
+     *
84
+     * @return	array		Menu array
85
+     */
86
+    function modMenu()	{
87
+        global $LANG;
88
+
89
+        return array (
90
+            'depth' => array(
91
+                0 => $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.depth_0'),
92
+                1 => $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.depth_1'),
93
+                2 => $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.depth_2'),
94
+                3 => $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.depth_3'),
95
+                4 => $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.depth_4'),
96
+                99 => $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.depth_infi'),
97
+            ),
98
+            'crawlaction' => array(
99
+                'start' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.start'),
100
+                'log' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.log'),
101
+                'multiprocess' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.multiprocess')
102
+            ),
103
+            'log_resultLog' => '',
104
+            'log_feVars' => '',
105
+            'processListMode' => '',
106
+            'log_display' => array(
107
+                'all' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.all'),
108
+                'pending' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.pending'),
109
+                'finished' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.finished')
110
+            ),
111
+            'itemsPerPage' => array(
112
+                '5' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage.5'),
113
+                '10' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage.10'),
114
+                '50' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage.50'),
115
+                '0' => $LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage.0')
116
+            )
117
+        );
118
+    }
119
+
120
+    /**
121
+     * Load extension settings
122
+     *
123
+     * @param void
124
+     * @return void
125
+     */
126
+    protected function loadExtensionSettings() {
127
+        $this->extensionSettings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['crawler']);
128
+    }
129
+
130
+    /**
131
+     * Main function
132
+     *
133
+     * @return	string		HTML output
134
+     */
135
+    function main() {
136
+        global $LANG, $BACK_PATH;
137
+
138
+        $this->incLocalLang();
139
+
140
+        $this->loadExtensionSettings();
141
+        if (empty($this->pObj->MOD_SETTINGS['processListMode'])) {
142
+            $this->pObj->MOD_SETTINGS['processListMode'] = 'simple';
143
+        }
144 144
 
145
-			// Set CSS styles specific for this document:
146
-		$this->pObj->content = str_replace('/*###POSTCSSMARKER###*/','
145
+            // Set CSS styles specific for this document:
146
+        $this->pObj->content = str_replace('/*###POSTCSSMARKER###*/','
147 147
 			TABLE.c-list TR TD { white-space: nowrap; vertical-align: top; }
148 148
 		',$this->pObj->content);
149 149
 
150
-		$this->pObj->content .= '<style type="text/css"><!--
150
+        $this->pObj->content .= '<style type="text/css"><!--
151 151
 			table.url-table,
152 152
 			table.param-expanded,
153 153
 			table.crawlerlog {
@@ -165,16 +165,16 @@  discard block
 block discarded – undo
165 165
 		<link rel="stylesheet" type="text/css" href="'.$BACK_PATH.'../typo3conf/ext/crawler/template/res.css" />
166 166
 		';
167 167
 
168
-			// Type function menu:
169
-		$h_func = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu(
170
-			$this->pObj->id,
171
-			'SET[crawlaction]',
172
-			$this->pObj->MOD_SETTINGS['crawlaction'],
173
-			$this->pObj->MOD_MENU['crawlaction'],
174
-			'index.php'
175
-		);
168
+            // Type function menu:
169
+        $h_func = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu(
170
+            $this->pObj->id,
171
+            'SET[crawlaction]',
172
+            $this->pObj->MOD_SETTINGS['crawlaction'],
173
+            $this->pObj->MOD_MENU['crawlaction'],
174
+            'index.php'
175
+        );
176 176
 
177
-		/*
177
+        /*
178 178
 			// Showing depth-menu in certain cases:
179 179
 		if ($this->pObj->MOD_SETTINGS['crawlaction']!=='cli' && $this->pObj->MOD_SETTINGS['crawlaction']!== 'multiprocess' && ($this->pObj->MOD_SETTINGS['crawlaction']!=='log' || $this->pObj->id))	{
180 180
 			$h_func .= \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu(
@@ -187,63 +187,63 @@  discard block
 block discarded – undo
187 187
 		}
188 188
 		*/
189 189
 
190
-			// Additional menus for the log type:
191
-		if ($this->pObj->MOD_SETTINGS['crawlaction']==='log')	{
192
-			$h_func .= \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu(
193
-				$this->pObj->id,
194
-				'SET[depth]',
195
-				$this->pObj->MOD_SETTINGS['depth'],
196
-				$this->pObj->MOD_MENU['depth'],
197
-				'index.php'
198
-			);
190
+            // Additional menus for the log type:
191
+        if ($this->pObj->MOD_SETTINGS['crawlaction']==='log')	{
192
+            $h_func .= \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu(
193
+                $this->pObj->id,
194
+                'SET[depth]',
195
+                $this->pObj->MOD_SETTINGS['depth'],
196
+                $this->pObj->MOD_MENU['depth'],
197
+                'index.php'
198
+            );
199
+
200
+            $quiPart = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details') ? '&qid_details=' . intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) : '';
201
+
202
+            $setId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID'));
203
+
204
+            $h_func.= '<hr/>'.
205
+                    $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) . ' - ' .
206
+                    $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) . ' - ' .
207
+                    $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) . ' - ' .
208
+                    $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage').': ' .
209
+                    \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu(
210
+                        $this->pObj->id,
211
+                        'SET[itemsPerPage]',
212
+                        $this->pObj->MOD_SETTINGS['itemsPerPage'],
213
+                        $this->pObj->MOD_MENU['itemsPerPage'],
214
+                        'index.php'
215
+                    );
216
+        }
199 217
 
200
-			$quiPart = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details') ? '&qid_details=' . intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) : '';
201
-
202
-			$setId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID'));
203
-
204
-			$h_func.= '<hr/>'.
205
-					$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) . ' - ' .
206
-					$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) . ' - ' .
207
-					$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) . ' - ' .
208
-					$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage').': ' .
209
-					\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu(
210
-						$this->pObj->id,
211
-						'SET[itemsPerPage]',
212
-						$this->pObj->MOD_SETTINGS['itemsPerPage'],
213
-						$this->pObj->MOD_MENU['itemsPerPage'],
214
-						'index.php'
215
-					);
216
-		}
218
+        $theOutput= $this->pObj->doc->spacer(5);
219
+        $theOutput.= $this->pObj->doc->section($LANG->getLL('title'), $h_func, 0, 1);
217 220
 
218
-		$theOutput= $this->pObj->doc->spacer(5);
219
-		$theOutput.= $this->pObj->doc->section($LANG->getLL('title'), $h_func, 0, 1);
220
-
221
-			// Branch based on type:
222
-		switch ((string)$this->pObj->MOD_SETTINGS['crawlaction']) {
223
-			case 'start':
224
-				if (empty($this->pObj->id)) {
225
-					$this->addErrorMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noPageSelected'));
226
-				} else {
227
-					$theOutput .= $this->pObj->doc->section('', $this->drawURLs(), 0, 1);
228
-				}
229
-				break;
230
-			case 'log':
231
-				if (empty($this->pObj->id)) {
232
-					$this->addErrorMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noPageSelected'));
233
-				} else {
234
-					$theOutput .= $this->pObj->doc->section('', $this->drawLog(), 0, 1);
235
-				}
236
-				break;
237
-			case 'cli':
238
-				$theOutput .= $this->pObj->doc->section('', $this->drawCLIstatus(), 0, 1);
239
-				break;
240
-			case 'multiprocess':
241
-				$theOutput .= $this->pObj->doc->section('', $this->drawProcessOverviewAction(), 0, 1);
242
-				break;
243
-		}
221
+            // Branch based on type:
222
+        switch ((string)$this->pObj->MOD_SETTINGS['crawlaction']) {
223
+            case 'start':
224
+                if (empty($this->pObj->id)) {
225
+                    $this->addErrorMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noPageSelected'));
226
+                } else {
227
+                    $theOutput .= $this->pObj->doc->section('', $this->drawURLs(), 0, 1);
228
+                }
229
+                break;
230
+            case 'log':
231
+                if (empty($this->pObj->id)) {
232
+                    $this->addErrorMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noPageSelected'));
233
+                } else {
234
+                    $theOutput .= $this->pObj->doc->section('', $this->drawLog(), 0, 1);
235
+                }
236
+                break;
237
+            case 'cli':
238
+                $theOutput .= $this->pObj->doc->section('', $this->drawCLIstatus(), 0, 1);
239
+                break;
240
+            case 'multiprocess':
241
+                $theOutput .= $this->pObj->doc->section('', $this->drawProcessOverviewAction(), 0, 1);
242
+                break;
243
+        }
244 244
 
245
-		return $theOutput;
246
-	}
245
+        return $theOutput;
246
+    }
247 247
 
248 248
 
249 249
 
@@ -256,176 +256,176 @@  discard block
 block discarded – undo
256 256
 
257 257
 
258 258
 
259
-	/*******************************
259
+    /*******************************
260 260
 	 *
261 261
 	 * Generate URLs for crawling:
262 262
 	 *
263 263
 	 ******************************/
264 264
 
265
-	/**
266
-	 * Produces a table with overview of the URLs to be crawled for each page
267
-	 *
268
-	 * @return	string		HTML output
269
-	 */
270
-	function drawURLs()	{
271
-		global $BACK_PATH, $BE_USER;
272
-
273
-			// Init:
274
-		$this->duplicateTrack = array();
275
-		$this->submitCrawlUrls = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('_crawl');
276
-		$this->downloadCrawlUrls = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('_download');
277
-		$this->makeCrawlerProcessableChecks();
278
-
279
-		switch((string)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('tstamp'))	{
280
-			case 'midnight':
281
-				$this->scheduledTime = mktime(0,0,0);
282
-			break;
283
-			case '04:00':
284
-				$this->scheduledTime = mktime(0,0,0)+4*3600;
285
-			break;
286
-			case 'now':
287
-			default:
288
-				$this->scheduledTime = time();
289
-			break;
290
-		}
291
-		// $this->reqMinute = \TYPO3\CMS\Core\Utility\GeneralUtility::intInRange(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('perminute'),1,10000);
292
-		// TODO: check relevance
293
-		$this->reqMinute = 1000;
265
+    /**
266
+     * Produces a table with overview of the URLs to be crawled for each page
267
+     *
268
+     * @return	string		HTML output
269
+     */
270
+    function drawURLs()	{
271
+        global $BACK_PATH, $BE_USER;
272
+
273
+            // Init:
274
+        $this->duplicateTrack = array();
275
+        $this->submitCrawlUrls = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('_crawl');
276
+        $this->downloadCrawlUrls = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('_download');
277
+        $this->makeCrawlerProcessableChecks();
278
+
279
+        switch((string)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('tstamp'))	{
280
+            case 'midnight':
281
+                $this->scheduledTime = mktime(0,0,0);
282
+            break;
283
+            case '04:00':
284
+                $this->scheduledTime = mktime(0,0,0)+4*3600;
285
+            break;
286
+            case 'now':
287
+            default:
288
+                $this->scheduledTime = time();
289
+            break;
290
+        }
291
+        // $this->reqMinute = \TYPO3\CMS\Core\Utility\GeneralUtility::intInRange(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('perminute'),1,10000);
292
+        // TODO: check relevance
293
+        $this->reqMinute = 1000;
294 294
 
295 295
 
296
-		$this->incomingConfigurationSelection = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('configurationSelection');
297
-		$this->incomingConfigurationSelection = is_array($this->incomingConfigurationSelection) ? $this->incomingConfigurationSelection : array('');
296
+        $this->incomingConfigurationSelection = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('configurationSelection');
297
+        $this->incomingConfigurationSelection = is_array($this->incomingConfigurationSelection) ? $this->incomingConfigurationSelection : array('');
298 298
 
299
-		$this->crawlerObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_lib');
300
-		$this->crawlerObj->setAccessMode('gui');
301
-		$this->crawlerObj->setID = \TYPO3\CMS\Core\Utility\GeneralUtility::md5int(microtime());
299
+        $this->crawlerObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_lib');
300
+        $this->crawlerObj->setAccessMode('gui');
301
+        $this->crawlerObj->setID = \TYPO3\CMS\Core\Utility\GeneralUtility::md5int(microtime());
302 302
 
303
-		if (empty($this->incomingConfigurationSelection)
304
-			|| (count($this->incomingConfigurationSelection)==1 && empty($this->incomingConfigurationSelection[0]))
305
-			) {
306
-			$code= '
303
+        if (empty($this->incomingConfigurationSelection)
304
+            || (count($this->incomingConfigurationSelection)==1 && empty($this->incomingConfigurationSelection[0]))
305
+            ) {
306
+            $code= '
307 307
 			<tr>
308 308
 				<td colspan="7"><b>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noConfigSelected').'</b></td>
309 309
 			</tr>';
310
-		} else {
311
-			if($this->submitCrawlUrls){
312
-				$reason = new tx_crawler_domain_reason();
313
-				$reason->setReason(tx_crawler_domain_reason::REASON_GUI_SUBMIT);
314
-
315
-				if($BE_USER instanceof \TYPO3\CMS\Core\Authentication\BackendUserAuthentication){ $username = $BE_USER->user['username']; }
316
-				$reason->setDetailText('The user '.$username.' added pages to the crawler queue manually ');
317
-
318
-				tx_crawler_domain_events_dispatcher::getInstance()->post(	'invokeQueueChange',
319
-																			$this->findCrawler()->setID,
320
-																			array(	'reason' => $reason ));
321
-			}
322
-
323
-			$code = $this->crawlerObj->getPageTreeAndUrls(
324
-				$this->pObj->id,
325
-				$this->pObj->MOD_SETTINGS['depth'],
326
-				$this->scheduledTime,
327
-				$this->reqMinute,
328
-				$this->submitCrawlUrls,
329
-				$this->downloadCrawlUrls,
330
-				array(), // Do not filter any processing instructions
331
-				$this->incomingConfigurationSelection
332
-			);
310
+        } else {
311
+            if($this->submitCrawlUrls){
312
+                $reason = new tx_crawler_domain_reason();
313
+                $reason->setReason(tx_crawler_domain_reason::REASON_GUI_SUBMIT);
314
+
315
+                if($BE_USER instanceof \TYPO3\CMS\Core\Authentication\BackendUserAuthentication){ $username = $BE_USER->user['username']; }
316
+                $reason->setDetailText('The user '.$username.' added pages to the crawler queue manually ');
317
+
318
+                tx_crawler_domain_events_dispatcher::getInstance()->post(	'invokeQueueChange',
319
+                                                                            $this->findCrawler()->setID,
320
+                                                                            array(	'reason' => $reason ));
321
+            }
322
+
323
+            $code = $this->crawlerObj->getPageTreeAndUrls(
324
+                $this->pObj->id,
325
+                $this->pObj->MOD_SETTINGS['depth'],
326
+                $this->scheduledTime,
327
+                $this->reqMinute,
328
+                $this->submitCrawlUrls,
329
+                $this->downloadCrawlUrls,
330
+                array(), // Do not filter any processing instructions
331
+                $this->incomingConfigurationSelection
332
+            );
333 333
 
334 334
 
335
-		}
335
+        }
336 336
 
337
-		$this->downloadUrls = $this->crawlerObj->downloadUrls;
338
-		$this->duplicateTrack = $this->crawlerObj->duplicateTrack;
337
+        $this->downloadUrls = $this->crawlerObj->downloadUrls;
338
+        $this->duplicateTrack = $this->crawlerObj->duplicateTrack;
339 339
 
340
-		$output = '';
341
-		if ($code)	{
340
+        $output = '';
341
+        if ($code)	{
342 342
 
343
-			$output .= '<h3>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.configuration').':</h3>';
344
-			$output .= '<input type="hidden" name="id" value="'.intval($this->pObj->id).'" />';
343
+            $output .= '<h3>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.configuration').':</h3>';
344
+            $output .= '<input type="hidden" name="id" value="'.intval($this->pObj->id).'" />';
345 345
 
346
-			if (!$this->submitCrawlUrls)	{
347
-				$output .= $this->drawURLs_cfgSelectors().'<br />';
348
-				$output .= '<input type="submit" name="_update" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerUpdate').'" /> ';
349
-				$output .= '<input type="submit" name="_crawl" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerCrawl').'" /> ';
350
-				$output .= '<input type="submit" name="_download" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerDownload').'" /><br /><br />';
351
-				$output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.count').': '.count(array_keys($this->duplicateTrack)).'<br />';
352
-				$output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime').': '.date('H:i:s',time()).'<br />';
353
-				$output .= '<br />
346
+            if (!$this->submitCrawlUrls)	{
347
+                $output .= $this->drawURLs_cfgSelectors().'<br />';
348
+                $output .= '<input type="submit" name="_update" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerUpdate').'" /> ';
349
+                $output .= '<input type="submit" name="_crawl" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerCrawl').'" /> ';
350
+                $output .= '<input type="submit" name="_download" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerDownload').'" /><br /><br />';
351
+                $output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.count').': '.count(array_keys($this->duplicateTrack)).'<br />';
352
+                $output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime').': '.date('H:i:s',time()).'<br />';
353
+                $output .= '<br />
354 354
 					<table class="lrPadding c-list url-table">'.
355
-						$this->drawURLs_printTableHeader().
356
-						$code.
357
-					'</table>';
358
-			} else {
359
-				$output .= count(array_keys($this->duplicateTrack)).' '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.submitted').'. <br /><br />';
360
-				$output .= '<input type="submit" name="_" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.continue').'" />';
361
-				$output .= '<input type="submit" onclick="this.form.elements[\'SET[crawlaction]\'].value=\'log\';" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.continueinlog').'" />';
362
-			}
363
-		}
364
-
365
-			// Download Urls to crawl:
366
-		if ($this->downloadCrawlUrls)	{
367
-
368
-				// Creating output header:
369
-			$mimeType = 'application/octet-stream';
370
-			Header('Content-Type: '.$mimeType);
371
-			Header('Content-Disposition: attachment; filename=CrawlerUrls.txt');
372
-
373
-				// Printing the content of the CSV lines:
374
-			echo implode(chr(13).chr(10),$this->downloadUrls);
375
-
376
-				// Exits:
377
-			exit;
378
-		}
379
-
380
-			// Return output:
381
-		return 	$output;
382
-	}
355
+                        $this->drawURLs_printTableHeader().
356
+                        $code.
357
+                    '</table>';
358
+            } else {
359
+                $output .= count(array_keys($this->duplicateTrack)).' '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.submitted').'. <br /><br />';
360
+                $output .= '<input type="submit" name="_" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.continue').'" />';
361
+                $output .= '<input type="submit" onclick="this.form.elements[\'SET[crawlaction]\'].value=\'log\';" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.continueinlog').'" />';
362
+            }
363
+        }
383 364
 
384
-	/**
385
-	 * Draws the configuration selectors for compiling URLs:
386
-	 *
387
-	 * @return	string		HTML table
388
-	 */
389
-	function drawURLs_cfgSelectors()	{
365
+            // Download Urls to crawl:
366
+        if ($this->downloadCrawlUrls)	{
390 367
 
391
-			// depth
392
-		$cell[] = $this->selectorBox(
393
-			array(
394
-				0 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_0'),
395
-				1 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_1'),
396
-				2 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_2'),
397
-				3 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_3'),
398
-				4 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_4'),
399
-				99 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_infi'),
400
-			),
401
-			'SET[depth]',
402
-			$this->pObj->MOD_SETTINGS['depth'],
403
-			0
404
-		);
405
-		$availableConfigurations = $this->crawlerObj->getConfigurationsForBranch($this->pObj->id, $this->pObj->MOD_SETTINGS['depth']?$this->pObj->MOD_SETTINGS['depth']:0 );
368
+                // Creating output header:
369
+            $mimeType = 'application/octet-stream';
370
+            Header('Content-Type: '.$mimeType);
371
+            Header('Content-Disposition: attachment; filename=CrawlerUrls.txt');
406 372
 
407
-			// Configurations
408
-		$cell[] = $this->selectorBox(
409
-			empty($availableConfigurations)?array():array_combine($availableConfigurations, $availableConfigurations),
410
-			'configurationSelection',
411
-			$this->incomingConfigurationSelection,
412
-			1
413
-		);
373
+                // Printing the content of the CSV lines:
374
+            echo implode(chr(13).chr(10),$this->downloadUrls);
414 375
 
415
-			// Scheduled time:
416
-		$cell[] = $this->selectorBox(
417
-			array(
418
-				'now' => $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.time.now'),
419
-				'midnight' => $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.time.midnight'),
420
-				'04:00' => $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.time.4am'),
421
-			),
422
-			'tstamp',
423
-			\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('tstamp'),
424
-			0
425
-		);
376
+                // Exits:
377
+            exit;
378
+        }
426 379
 
427
-		// TODO: check relevance
428
-		/*
380
+            // Return output:
381
+        return 	$output;
382
+    }
383
+
384
+    /**
385
+     * Draws the configuration selectors for compiling URLs:
386
+     *
387
+     * @return	string		HTML table
388
+     */
389
+    function drawURLs_cfgSelectors()	{
390
+
391
+            // depth
392
+        $cell[] = $this->selectorBox(
393
+            array(
394
+                0 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_0'),
395
+                1 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_1'),
396
+                2 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_2'),
397
+                3 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_3'),
398
+                4 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_4'),
399
+                99 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_infi'),
400
+            ),
401
+            'SET[depth]',
402
+            $this->pObj->MOD_SETTINGS['depth'],
403
+            0
404
+        );
405
+        $availableConfigurations = $this->crawlerObj->getConfigurationsForBranch($this->pObj->id, $this->pObj->MOD_SETTINGS['depth']?$this->pObj->MOD_SETTINGS['depth']:0 );
406
+
407
+            // Configurations
408
+        $cell[] = $this->selectorBox(
409
+            empty($availableConfigurations)?array():array_combine($availableConfigurations, $availableConfigurations),
410
+            'configurationSelection',
411
+            $this->incomingConfigurationSelection,
412
+            1
413
+        );
414
+
415
+            // Scheduled time:
416
+        $cell[] = $this->selectorBox(
417
+            array(
418
+                'now' => $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.time.now'),
419
+                'midnight' => $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.time.midnight'),
420
+                '04:00' => $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.time.4am'),
421
+            ),
422
+            'tstamp',
423
+            \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('tstamp'),
424
+            0
425
+        );
426
+
427
+        // TODO: check relevance
428
+        /*
429 429
 			// Requests per minute:
430 430
 		$cell[] = $this->selectorBox(
431 431
 			array(
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 		);
447 447
 		*/
448 448
 
449
-		$output = '
449
+        $output = '
450 450
 			<table class="lrPadding c-list">
451 451
 				<tr class="bgColor5 tableheader">
452 452
 					<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.depth').':</td>
@@ -459,17 +459,17 @@  discard block
 block discarded – undo
459 459
 				</tr>
460 460
 			</table>';
461 461
 
462
-		return $output;
463
-	}
462
+        return $output;
463
+    }
464 464
 
465
-	/**
466
-	 * Create Table header row for URL display
467
-	 *
468
-	 * @return	string		Table header
469
-	 */
470
-	function drawURLs_printTableHeader()	{
465
+    /**
466
+     * Create Table header row for URL display
467
+     *
468
+     * @return	string		Table header
469
+     */
470
+    function drawURLs_printTableHeader()	{
471 471
 
472
-		$content = '
472
+        $content = '
473 473
 			<tr class="bgColor5 tableheader">
474 474
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.pagetitle').':</td>
475 475
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.key').':</td>
@@ -480,8 +480,8 @@  discard block
 block discarded – undo
480 480
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.parameters').':</td>
481 481
 			</tr>';
482 482
 
483
-		return $content;
484
-	}
483
+        return $content;
484
+    }
485 485
 
486 486
 
487 487
 
@@ -494,109 +494,109 @@  discard block
 block discarded – undo
494 494
 
495 495
 
496 496
 
497
-	/*******************************
497
+    /*******************************
498 498
 	 *
499 499
 	 * Shows log of indexed URLs
500 500
 	 *
501 501
 	 ******************************/
502 502
 
503
-	/**
504
-	 * Shows the log of indexed URLs
505
-	 *
506
-	 * @return	string		HTML output
507
-	 */
508
-	function drawLog()	{
509
-		global $BACK_PATH;
510
-		$output = '';
511
-
512
-			// Init:
513
-		$this->crawlerObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_lib');
514
-		$this->crawlerObj->setAccessMode('gui');
515
-		$this->crawlerObj->setID = \TYPO3\CMS\Core\Utility\GeneralUtility::md5int(microtime());
516
-
517
-		$this->CSVExport = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_csv');
518
-
519
-			// Read URL:
520
-		if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_read'))	{
521
-			$this->crawlerObj->readUrl(intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_read')),TRUE);
522
-		}
503
+    /**
504
+     * Shows the log of indexed URLs
505
+     *
506
+     * @return	string		HTML output
507
+     */
508
+    function drawLog()	{
509
+        global $BACK_PATH;
510
+        $output = '';
511
+
512
+            // Init:
513
+        $this->crawlerObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_lib');
514
+        $this->crawlerObj->setAccessMode('gui');
515
+        $this->crawlerObj->setID = \TYPO3\CMS\Core\Utility\GeneralUtility::md5int(microtime());
516
+
517
+        $this->CSVExport = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_csv');
518
+
519
+            // Read URL:
520
+        if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_read'))	{
521
+            $this->crawlerObj->readUrl(intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_read')),TRUE);
522
+        }
523 523
 
524
-			// Look for set ID sent - if it is, we will display contents of that set:
525
-		$showSetId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID'));
524
+            // Look for set ID sent - if it is, we will display contents of that set:
525
+        $showSetId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID'));
526 526
 
527
-			// Show details:
528
-		if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details'))	{
527
+            // Show details:
528
+        if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details'))	{
529 529
 
530
-				// Get entry record:
531
-			list($q_entry) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*','tx_crawler_queue','qid='.intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')));
530
+                // Get entry record:
531
+            list($q_entry) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*','tx_crawler_queue','qid='.intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')));
532 532
 
533
-				// Explode values:
534
-				$resStatus = $this->getResStatus($q_entry);
535
-			$q_entry['parameters'] = unserialize($q_entry['parameters']);
536
-			$q_entry['result_data'] = unserialize($q_entry['result_data']);
537
-			if (is_array($q_entry['result_data']))	{
538
-				$q_entry['result_data']['content'] = unserialize($q_entry['result_data']['content']);
539
-			}
533
+                // Explode values:
534
+                $resStatus = $this->getResStatus($q_entry);
535
+            $q_entry['parameters'] = unserialize($q_entry['parameters']);
536
+            $q_entry['result_data'] = unserialize($q_entry['result_data']);
537
+            if (is_array($q_entry['result_data']))	{
538
+                $q_entry['result_data']['content'] = unserialize($q_entry['result_data']['content']);
539
+            }
540 540
 
541
-			if(!$this->pObj->MOD_SETTINGS['log_resultLog']) {
542
-				unset($q_entry['result_data']['content']['log']);
543
-			}
541
+            if(!$this->pObj->MOD_SETTINGS['log_resultLog']) {
542
+                unset($q_entry['result_data']['content']['log']);
543
+            }
544 544
 
545
-				// Print rudimentary details:
546
-			$output .= '
545
+                // Print rudimentary details:
546
+            $output .= '
547 547
 				<br /><br />
548 548
 				<input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.back') . '" name="_back" />
549 549
 				<input type="hidden" value="' . $this->pObj->id . '" name="id" />
550 550
 				<input type="hidden" value="' . $showSetId . '" name="setID" />
551 551
 				<br />
552 552
 				Current server time: ' . date('H:i:s', time()) . '<br />' .
553
-				'Status: ' . $resStatus . '<br />' .
554
-				\TYPO3\CMS\Core\Utility\DebugUtility::viewArray($q_entry);
555
-		} else {	// Show list:
556
-
557
-				// If either id or set id, show list:
558
-			if ($this->pObj->id || $showSetId)	{
559
-				if ($this->pObj->id)	{
560
-						// Drawing tree:
561
-					$tree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Backend\Tree\View\PageTreeView');
562
-					$perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
563
-					$tree->init('AND '.$perms_clause);
564
-
565
-						// Set root row:
566
-					$HTML = \AOE\Crawler\Utility\IconUtility::getIconForRecord('pages', $this->pObj->pageinfo);
567
-					$tree->tree[] = Array(
568
-						'row' => $this->pObj->pageinfo,
569
-						'HTML' => $HTML
570
-					);
571
-
572
-						// Get branch beneath:
573
-					if ($this->pObj->MOD_SETTINGS['depth'])	{
574
-						$tree->getTree($this->pObj->id, $this->pObj->MOD_SETTINGS['depth'], '');
575
-					}
576
-
577
-						// Traverse page tree:
578
-					$code = ''; $count = 0;
579
-					foreach($tree->tree as $data)	{
580
-						$code .= $this->drawLog_addRows(
581
-									$data['row'],
582
-									$data['HTML'] . \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages',$data['row'],TRUE),
583
-									intval($this->pObj->MOD_SETTINGS['itemsPerPage'])
584
-								);
585
-						if (++$count == 1000) {
586
-							break;
587
-						}
588
-					}
589
-				} else {
590
-					$code = '';
591
-					$code.= $this->drawLog_addRows(
592
-								$showSetId,
593
-								'Set ID: '.$showSetId
594
-							);
595
-				}
596
-
597
-				if ($code)	{
598
-
599
-					$output .= '
553
+                'Status: ' . $resStatus . '<br />' .
554
+                \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($q_entry);
555
+        } else {	// Show list:
556
+
557
+                // If either id or set id, show list:
558
+            if ($this->pObj->id || $showSetId)	{
559
+                if ($this->pObj->id)	{
560
+                        // Drawing tree:
561
+                    $tree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Backend\Tree\View\PageTreeView');
562
+                    $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
563
+                    $tree->init('AND '.$perms_clause);
564
+
565
+                        // Set root row:
566
+                    $HTML = \AOE\Crawler\Utility\IconUtility::getIconForRecord('pages', $this->pObj->pageinfo);
567
+                    $tree->tree[] = Array(
568
+                        'row' => $this->pObj->pageinfo,
569
+                        'HTML' => $HTML
570
+                    );
571
+
572
+                        // Get branch beneath:
573
+                    if ($this->pObj->MOD_SETTINGS['depth'])	{
574
+                        $tree->getTree($this->pObj->id, $this->pObj->MOD_SETTINGS['depth'], '');
575
+                    }
576
+
577
+                        // Traverse page tree:
578
+                    $code = ''; $count = 0;
579
+                    foreach($tree->tree as $data)	{
580
+                        $code .= $this->drawLog_addRows(
581
+                                    $data['row'],
582
+                                    $data['HTML'] . \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages',$data['row'],TRUE),
583
+                                    intval($this->pObj->MOD_SETTINGS['itemsPerPage'])
584
+                                );
585
+                        if (++$count == 1000) {
586
+                            break;
587
+                        }
588
+                    }
589
+                } else {
590
+                    $code = '';
591
+                    $code.= $this->drawLog_addRows(
592
+                                $showSetId,
593
+                                'Set ID: '.$showSetId
594
+                            );
595
+                }
596
+
597
+                if ($code)	{
598
+
599
+                    $output .= '
600 600
 						<br /><br />
601 601
 						<input type="submit" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.reloadlist').'" name="_reload" />
602 602
 						<input type="submit" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.downloadcsv').'" name="_csv" />
@@ -610,20 +610,20 @@  discard block
 block discarded – undo
610 610
 
611 611
 
612 612
 						<table class="lrPadding c-list crawlerlog">'.
613
-							$this->drawLog_printTableHeader().
614
-							$code.
615
-						'</table>';
616
-				}
617
-			} else {	// Otherwise show available sets:
618
-				$setList = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
619
-								'set_id, count(*) as count_value, scheduled',
620
-								'tx_crawler_queue',
621
-								'',
622
-								'set_id, scheduled',
623
-								'scheduled DESC'
624
-							);
625
-
626
-				$code = '
613
+                            $this->drawLog_printTableHeader().
614
+                            $code.
615
+                        '</table>';
616
+                }
617
+            } else {	// Otherwise show available sets:
618
+                $setList = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
619
+                                'set_id, count(*) as count_value, scheduled',
620
+                                'tx_crawler_queue',
621
+                                '',
622
+                                'set_id, scheduled',
623
+                                'scheduled DESC'
624
+                            );
625
+
626
+                $code = '
627 627
 					<tr class="bgColor5 tableheader">
628 628
 						<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.setid').':</td>
629 629
 						<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.count').'t:</td>
@@ -631,9 +631,9 @@  discard block
 block discarded – undo
631 631
 					</tr>
632 632
 				';
633 633
 
634
-				$cc=0;
635
-				foreach($setList as $set)	{
636
-					$code.= '
634
+                $cc=0;
635
+                foreach($setList as $set)	{
636
+                    $code.= '
637 637
 						<tr class="bgColor'.($cc%2 ? '-20':'-10').'">
638 638
 							<td><a href="'.htmlspecialchars('index.php?setID='.$set['set_id']).'">'.$set['set_id'].'</a></td>
639 639
 							<td>'.$set['count_value'].'</td>
@@ -641,217 +641,217 @@  discard block
 block discarded – undo
641 641
 						</tr>
642 642
 					';
643 643
 
644
-					$cc++;
645
-				}
644
+                    $cc++;
645
+                }
646 646
 
647
-				$output .= '
647
+                $output .= '
648 648
 					<br /><br />
649 649
 					<table class="lrPadding c-list">'.
650
-						$code.
651
-					'</table>';
652
-			}
653
-		}
650
+                        $code.
651
+                    '</table>';
652
+            }
653
+        }
654 654
 
655
-		if($this->CSVExport) {
656
-			$this->outputCsvFile();
657
-		}
655
+        if($this->CSVExport) {
656
+            $this->outputCsvFile();
657
+        }
658 658
 
659
-			// Return output
660
-		return 	$output;
661
-	}
659
+            // Return output
660
+        return 	$output;
661
+    }
662 662
 
663
-	/**
664
-	 * Outputs the CSV file and sets the correct headers
665
-	 */
666
-	protected function outputCsvFile() {
663
+    /**
664
+     * Outputs the CSV file and sets the correct headers
665
+     */
666
+    protected function outputCsvFile() {
667 667
 
668
-		if (!count($this->CSVaccu)) {
669
-			$this->addWarningMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.canNotExportEmptyQueueToCsvText'));
670
-			return;
671
-		}
668
+        if (!count($this->CSVaccu)) {
669
+            $this->addWarningMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.canNotExportEmptyQueueToCsvText'));
670
+            return;
671
+        }
672 672
 
673
-		$csvLines = array();
673
+        $csvLines = array();
674 674
 
675
-			// Field names:
676
-		reset($this->CSVaccu);
677
-		$fieldNames = array_keys(current($this->CSVaccu));
678
-		$csvLines[] = \TYPO3\CMS\Core\Utility\GeneralUtility::csvValues($fieldNames);
675
+            // Field names:
676
+        reset($this->CSVaccu);
677
+        $fieldNames = array_keys(current($this->CSVaccu));
678
+        $csvLines[] = \TYPO3\CMS\Core\Utility\GeneralUtility::csvValues($fieldNames);
679 679
 
680
-			// Data:
681
-		foreach($this->CSVaccu as $row)	{
682
-			$csvLines[] = \TYPO3\CMS\Core\Utility\GeneralUtility::csvValues($row);
683
-		}
680
+            // Data:
681
+        foreach($this->CSVaccu as $row)	{
682
+            $csvLines[] = \TYPO3\CMS\Core\Utility\GeneralUtility::csvValues($row);
683
+        }
684 684
 
685
-			// Creating output header:
686
-		$mimeType = 'application/octet-stream';
687
-		Header('Content-Type: '.$mimeType);
688
-		Header('Content-Disposition: attachment; filename=CrawlerLog.csv');
685
+            // Creating output header:
686
+        $mimeType = 'application/octet-stream';
687
+        Header('Content-Type: '.$mimeType);
688
+        Header('Content-Disposition: attachment; filename=CrawlerLog.csv');
689
+
690
+            // Printing the content of the CSV lines:
691
+        echo implode(chr(13).chr(10),$csvLines);
692
+
693
+            // Exits:
694
+        exit;
695
+    }
696
+
697
+    /**
698
+     * Create the rows for display of the page tree
699
+     * For each page a number of rows are shown displaying GET variable configuration
700
+     *
701
+     * @param	array		Page row or set-id
702
+     * @param	string		Title string
703
+     * @param	int			Items per Page setting
704
+     * @return	string		HTML <tr> content (one or more)
705
+     */
706
+    function drawLog_addRows($pageRow_setId, $titleString, $itemsPerPage=10) {
707
+
708
+            // If Flush button is pressed, flush tables instead of selecting entries:
709
+
710
+        if(\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_flush')) {
711
+            $doFlush = true;
712
+            $doFullFlush = false;
713
+        } elseif(\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_flush_all')) {
714
+            $doFlush = true;
715
+            $doFullFlush = true;
716
+        } else {
717
+            $doFlush = false;
718
+            $doFullFlush = false;
719
+        }
689 720
 
690
-			// Printing the content of the CSV lines:
691
-		echo implode(chr(13).chr(10),$csvLines);
721
+            // Get result:
722
+        if (is_array($pageRow_setId))	{
723
+            $res = $this->crawlerObj->getLogEntriesForPageId($pageRow_setId['uid'], $this->pObj->MOD_SETTINGS['log_display'], $doFlush, $doFullFlush, intval($itemsPerPage));
724
+        } else {
725
+            $res = $this->crawlerObj->getLogEntriesForSetId($pageRow_setId, $this->pObj->MOD_SETTINGS['log_display'], $doFlush, $doFullFlush, intval($itemsPerPage));
726
+        }
692 727
 
693
-			// Exits:
694
-		exit;
695
-	}
728
+            // Init var:
729
+        $colSpan = 9
730
+                + ($this->pObj->MOD_SETTINGS['log_resultLog'] ? -1 : 0)
731
+                + ($this->pObj->MOD_SETTINGS['log_feVars'] ? 3 : 0);
732
+
733
+        if (count($res))	{
734
+                // Traverse parameter combinations:
735
+            $c = 0;
736
+            $content='';
737
+            foreach($res as $kk => $vv)	{
738
+
739
+                    // Title column:
740
+                if (!$c)	{
741
+                    $titleClm = '<td rowspan="'.count($res).'">'.$titleString.'</td>';
742
+                } else {
743
+                    $titleClm = '';
744
+                }
696 745
 
697
-	/**
698
-	 * Create the rows for display of the page tree
699
-	 * For each page a number of rows are shown displaying GET variable configuration
700
-	 *
701
-	 * @param	array		Page row or set-id
702
-	 * @param	string		Title string
703
-	 * @param	int			Items per Page setting
704
-	 * @return	string		HTML <tr> content (one or more)
705
-	 */
706
-	function drawLog_addRows($pageRow_setId, $titleString, $itemsPerPage=10) {
707
-
708
-			// If Flush button is pressed, flush tables instead of selecting entries:
709
-
710
-		if(\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_flush')) {
711
-			$doFlush = true;
712
-			$doFullFlush = false;
713
-		} elseif(\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_flush_all')) {
714
-			$doFlush = true;
715
-			$doFullFlush = true;
716
-		} else {
717
-			$doFlush = false;
718
-			$doFullFlush = false;
719
-		}
746
+                    // Result:
747
+                $resLog = $this->getResultLog($vv);
720 748
 
721
-			// Get result:
722
-		if (is_array($pageRow_setId))	{
723
-			$res = $this->crawlerObj->getLogEntriesForPageId($pageRow_setId['uid'], $this->pObj->MOD_SETTINGS['log_display'], $doFlush, $doFullFlush, intval($itemsPerPage));
724
-		} else {
725
-			$res = $this->crawlerObj->getLogEntriesForSetId($pageRow_setId, $this->pObj->MOD_SETTINGS['log_display'], $doFlush, $doFullFlush, intval($itemsPerPage));
726
-		}
749
+                $resStatus = $this->getResStatus($vv);
750
+                $resFeVars = $this->getResFeVars($vv);
751
+
752
+                    // Compile row:
753
+                $parameters = unserialize($vv['parameters']);
754
+
755
+                    // Put data into array:
756
+                $rowData = array();
757
+                if ($this->pObj->MOD_SETTINGS['log_resultLog'])	{
758
+                    $rowData['result_log'] = $resLog;
759
+                } else {
760
+                    $rowData['scheduled'] = ($vv['scheduled']> 0) ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']) : ' '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.immediate');
761
+                    $rowData['exec_time'] = $vv['exec_time'] ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['exec_time']) : '-';
762
+                }
763
+                $rowData['result_status'] = \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($resStatus,50);
764
+                $rowData['url'] = '<a href="'.htmlspecialchars($parameters['url']).'" target="_newWIndow">'.htmlspecialchars($parameters['url']).'</a>';
765
+                $rowData['feUserGroupList'] = $parameters['feUserGroupList'];
766
+                $rowData['procInstructions'] = is_array($parameters['procInstructions']) ? implode('; ',$parameters['procInstructions']) : '';
767
+                $rowData['set_id'] = $vv['set_id'];
768
+
769
+                if ($this->pObj->MOD_SETTINGS['log_feVars']) {
770
+                    $rowData['tsfe_id'] = $resFeVars['id'];
771
+                    $rowData['tsfe_gr_list'] = $resFeVars['gr_list'];
772
+                    $rowData['tsfe_no_cache'] = $resFeVars['no_cache'];
773
+                }
774
+
775
+                $setId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID'));
776
+
777
+                $refreshIcon = $GLOBALS['BACK_PATH'] . 'gfx/refresh_n.gif';
778
+                if (version_compare(TYPO3_version,'7.0','>=')) {
779
+                    $refreshIcon = $GLOBALS['BACK_PATH'] . 'sysext/t3skin/extjs/images/grid/refresh.gif';
780
+                }
727 781
 
728
-			// Init var:
729
-		$colSpan = 9
730
-				+ ($this->pObj->MOD_SETTINGS['log_resultLog'] ? -1 : 0)
731
-				+ ($this->pObj->MOD_SETTINGS['log_feVars'] ? 3 : 0);
732
-
733
-		if (count($res))	{
734
-				// Traverse parameter combinations:
735
-			$c = 0;
736
-			$content='';
737
-			foreach($res as $kk => $vv)	{
738
-
739
-					// Title column:
740
-				if (!$c)	{
741
-					$titleClm = '<td rowspan="'.count($res).'">'.$titleString.'</td>';
742
-				} else {
743
-					$titleClm = '';
744
-				}
745
-
746
-					// Result:
747
-				$resLog = $this->getResultLog($vv);
748
-
749
-				$resStatus = $this->getResStatus($vv);
750
-				$resFeVars = $this->getResFeVars($vv);
751
-
752
-					// Compile row:
753
-				$parameters = unserialize($vv['parameters']);
754
-
755
-					// Put data into array:
756
-				$rowData = array();
757
-				if ($this->pObj->MOD_SETTINGS['log_resultLog'])	{
758
-					$rowData['result_log'] = $resLog;
759
-				} else {
760
-					$rowData['scheduled'] = ($vv['scheduled']> 0) ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']) : ' '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.immediate');
761
-					$rowData['exec_time'] = $vv['exec_time'] ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['exec_time']) : '-';
762
-				}
763
-				$rowData['result_status'] = \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($resStatus,50);
764
-				$rowData['url'] = '<a href="'.htmlspecialchars($parameters['url']).'" target="_newWIndow">'.htmlspecialchars($parameters['url']).'</a>';
765
-				$rowData['feUserGroupList'] = $parameters['feUserGroupList'];
766
-				$rowData['procInstructions'] = is_array($parameters['procInstructions']) ? implode('; ',$parameters['procInstructions']) : '';
767
-				$rowData['set_id'] = $vv['set_id'];
768
-
769
-				if ($this->pObj->MOD_SETTINGS['log_feVars']) {
770
-					$rowData['tsfe_id'] = $resFeVars['id'];
771
-					$rowData['tsfe_gr_list'] = $resFeVars['gr_list'];
772
-					$rowData['tsfe_no_cache'] = $resFeVars['no_cache'];
773
-				}
774
-
775
-				$setId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID'));
776
-
777
-				$refreshIcon = $GLOBALS['BACK_PATH'] . 'gfx/refresh_n.gif';
778
-				if (version_compare(TYPO3_version,'7.0','>=')) {
779
-					$refreshIcon = $GLOBALS['BACK_PATH'] . 'sysext/t3skin/extjs/images/grid/refresh.gif';
780
-				}
781
-
782
-					// Put rows together:
783
-				$content.= '
782
+                    // Put rows together:
783
+                $content.= '
784 784
 					<tr class="bgColor'.($c%2 ? '-20':'-10').'">
785 785
 						'.$titleClm.'
786 786
 						<td><a href="' . $this->getModuleUrl(array('qid_details' => $vv['qid'], 'setID' => $setId)) . '">'.htmlspecialchars($vv['qid']).'</a></td>
787 787
 						<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>';
788
-				foreach($rowData as $fKey => $value) {
788
+                foreach($rowData as $fKey => $value) {
789 789
 
790
-					if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('url',$fKey))	{
791
-						$content.= '
790
+                    if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('url',$fKey))	{
791
+                        $content.= '
792 792
 						<td>'.$value.'</td>';
793
-					} else {
794
-						$content.= '
793
+                    } else {
794
+                        $content.= '
795 795
 						<td>'.nl2br(htmlspecialchars($value)).'</td>';
796
-					}
797
-				}
798
-				$content.= '
796
+                    }
797
+                }
798
+                $content.= '
799 799
 					</tr>';
800
-				$c++;
801
-
802
-				if ($this->CSVExport)	{
803
-						// Only for CSV (adding qid and scheduled/exec_time if needed):
804
-					$rowData['result_log'] = implode('// ',explode(chr(10),$resLog));
805
-					$rowData['qid'] = $vv['qid'];
806
-					$rowData['scheduled'] = \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']);
807
-					$rowData['exec_time'] = $vv['exec_time'] ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['exec_time']) : '-';
808
-					$this->CSVaccu[] = $rowData;
809
-				}
810
-			}
811
-		} else {
800
+                $c++;
801
+
802
+                if ($this->CSVExport)	{
803
+                        // Only for CSV (adding qid and scheduled/exec_time if needed):
804
+                    $rowData['result_log'] = implode('// ',explode(chr(10),$resLog));
805
+                    $rowData['qid'] = $vv['qid'];
806
+                    $rowData['scheduled'] = \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']);
807
+                    $rowData['exec_time'] = $vv['exec_time'] ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['exec_time']) : '-';
808
+                    $this->CSVaccu[] = $rowData;
809
+                }
810
+            }
811
+        } else {
812 812
 
813
-				// Compile row:
814
-			$content = '
813
+                // Compile row:
814
+            $content = '
815 815
 				<tr class="bgColor-20">
816 816
 					<td>'.$titleString.'</td>
817 817
 					<td colspan="'.$colSpan.'"><em>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noentries').'</em></td>
818 818
 				</tr>';
819
-		}
820
-
821
-		return $content;
822
-	}
819
+        }
823 820
 
824
-	/**
825
-	 * Find Fe vars
826
-	 *
827
-	 * @param array $row
828
-	 * @return array
829
-	 */
830
-	function getResFeVars($row) {
831
-		$feVars = array();
832
-
833
-		if ($row['result_data']) {
834
-			$resultData = unserialize($row['result_data']);
835
-			$requestResult = unserialize($resultData['content']);
836
-			$feVars = $requestResult['vars'];
837
-		}
821
+        return $content;
822
+    }
823
+
824
+    /**
825
+     * Find Fe vars
826
+     *
827
+     * @param array $row
828
+     * @return array
829
+     */
830
+    function getResFeVars($row) {
831
+        $feVars = array();
832
+
833
+        if ($row['result_data']) {
834
+            $resultData = unserialize($row['result_data']);
835
+            $requestResult = unserialize($resultData['content']);
836
+            $feVars = $requestResult['vars'];
837
+        }
838 838
 
839
-		return $feVars;
840
-	}
839
+        return $feVars;
840
+    }
841 841
 
842
-	/**
843
-	 * Create Table header row (log)
844
-	 *
845
-	 * @return	string		Table header
846
-	 */
847
-	function drawLog_printTableHeader()	{
842
+    /**
843
+     * Create Table header row (log)
844
+     *
845
+     * @return	string		Table header
846
+     */
847
+    function drawLog_printTableHeader()	{
848 848
 
849
-		$content = '
849
+        $content = '
850 850
 			<tr class="bgColor5 tableheader">
851 851
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.pagetitle').':</td>
852 852
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.qid').':</td>
853 853
 				<td>&nbsp;</td>'.
854
-				($this->pObj->MOD_SETTINGS['log_resultLog'] ? '
854
+                ($this->pObj->MOD_SETTINGS['log_resultLog'] ? '
855 855
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.resultlog').':</td>' : '
856 856
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.scheduledtime').':</td>
857 857
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.runtime').':</td>').'
@@ -860,14 +860,14 @@  discard block
 block discarded – undo
860 860
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.groups').':</td>
861 861
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.procinstr').':</td>
862 862
 				<td>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.setid').':</td>'.
863
-				($this->pObj->MOD_SETTINGS['log_feVars'] ? '
863
+                ($this->pObj->MOD_SETTINGS['log_feVars'] ? '
864 864
 				<td>'.htmlspecialchars('TSFE->id').'</td>
865 865
 				<td>'.htmlspecialchars('TSFE->gr_list').'</td>
866 866
 				<td>'.htmlspecialchars('TSFE->no_cache').'</td>' : '').'
867 867
 			</tr>';
868 868
 
869
-		return $content;
870
-	}
869
+        return $content;
870
+    }
871 871
 
872 872
         /**
873 873
          * Extract the log information from the current row and retrive it as formatted string.
@@ -894,25 +894,25 @@  discard block
 block discarded – undo
894 894
                 return $content;
895 895
         }
896 896
 
897
-	function getResStatus($vv) {
898
-		if ($vv['result_data'])	{
899
-			$requestContent = unserialize($vv['result_data']);
900
-			$requestResult = unserialize($requestContent['content']);
901
-			if (is_array($requestResult)) {
902
-				if (empty($requestResult['errorlog'])) {
903
-					$resStatus = 'OK';
904
-				} else {
905
-					$resStatus = implode("\n", $requestResult['errorlog']);
906
-				}
907
-				$resLog = is_array($requestResult['log']) ?  implode(chr(10),$requestResult['log']) : '';
908
-			} else {
909
-				$resStatus = 'Error: '.substr(preg_replace('/\s+/',' ',strip_tags($requestContent['content'])),0,10000).'...';
910
-			}
911
-		} else {
912
-			$resStatus = '-';
913
-		}
914
-		return $resStatus;
915
-	}
897
+    function getResStatus($vv) {
898
+        if ($vv['result_data'])	{
899
+            $requestContent = unserialize($vv['result_data']);
900
+            $requestResult = unserialize($requestContent['content']);
901
+            if (is_array($requestResult)) {
902
+                if (empty($requestResult['errorlog'])) {
903
+                    $resStatus = 'OK';
904
+                } else {
905
+                    $resStatus = implode("\n", $requestResult['errorlog']);
906
+                }
907
+                $resLog = is_array($requestResult['log']) ?  implode(chr(10),$requestResult['log']) : '';
908
+            } else {
909
+                $resStatus = 'Error: '.substr(preg_replace('/\s+/',' ',strip_tags($requestContent['content'])),0,10000).'...';
910
+            }
911
+        } else {
912
+            $resStatus = '-';
913
+        }
914
+        return $resStatus;
915
+    }
916 916
 
917 917
 
918 918
 
@@ -921,343 +921,343 @@  discard block
 block discarded – undo
921 921
 
922 922
 
923 923
 
924
-	/*****************************
924
+    /*****************************
925 925
 	 *
926 926
 	 * CLI status display
927 927
 	 *
928 928
 	 *****************************/
929 929
 
930
-	/**
931
-	 * This method is used to show an overview about the active an the finished crawling processes
932
-	 *
933
-	 * @author Timo Schmidt
934
-	 * @param void
935
-	 * @return string
936
-	 */
937
-	protected function drawProcessOverviewAction(){
938
-
939
-		$this->runRefreshHooks();
940
-
941
-		global $BACK_PATH;
942
-		$this->makeCrawlerProcessableChecks();
943
-
944
-		$crawler = $this->findCrawler();
945
-		try {
946
-			$this->handleProcessOverviewActions();
947
-		} catch (Exception $e) {
948
-			$this->addErrorMessage($e->getMessage());
949
-		}
950
-
951
-		$offset 	= intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('offset'));
952
-		$perpage 	= 20;
953
-
954
-		$processRepository	= new tx_crawler_domain_process_repository();
955
-		$queueRepository	= new tx_crawler_domain_queue_repository();
956
-
957
-		$mode = $this->pObj->MOD_SETTINGS['processListMode'];
958
-		if ($mode == 'detail') {
959
-			$where = '';
960
-		} elseif($mode == 'simple') {
961
-			$where = 'active = 1';
962
-		}
963
-
964
-		$allProcesses 		= $processRepository->findAll('ttl','DESC', $perpage, $offset,$where);
965
-		$allCount			= $processRepository->countAll($where);
966
-
967
-		$listView			= new tx_crawler_view_process_list();
968
-		$listView->setPageId($this->pObj->id);
969
-		$listView->setIconPath($BACK_PATH.'../typo3conf/ext/crawler/template/process/res/img/');
970
-		$listView->setProcessCollection($allProcesses);
971
-		$listView->setCliPath($this->processManager->getCrawlerCliPath());
972
-		$listView->setIsCrawlerEnabled(!$crawler->getDisabled() && !$this->isErrorDetected);
973
-		$listView->setTotalUnprocessedItemCount($queueRepository->countAllPendingItems());
974
-		$listView->setAssignedUnprocessedItemCount($queueRepository->countAllAssignedPendingItems());
975
-		$listView->setActiveProcessCount($processRepository->countActive());
976
-		$listView->setMaxActiveProcessCount(tx_crawler_api::forceIntegerInRange($this->extensionSettings['processLimit'],1,99,1));
977
-		$listView->setMode($mode);
978
-
979
-		$paginationView		= new tx_crawler_view_pagination();
980
-		$paginationView->setCurrentOffset($offset);
981
-		$paginationView->setPerPage($perpage);
982
-		$paginationView->setTotalItemCount($allCount);
983
-
984
-		$output = $listView->render();
985
-
986
-		if ($paginationView->getTotalPagesCount() > 1) {
987
-			$output .= ' <br />'.$paginationView->render();
988
-		}
989
-
990
-		return $output;
991
-	}
992
-
993
-	/**
994
-	 * Verify that the crawler is exectuable.
995
-	 *
996
-	 * @access protected
997
-	 * @return void
998
-	 *
999
-	 * @author Michael Klapper <[email protected]>
1000
-	 */
1001
-	protected function makeCrawlerProcessableChecks() {
1002
-		global $LANG;
1003
-
1004
-		if ($this->isCrawlerUserAvailable() === false) {
1005
-			$this->addErrorMessage($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.noBeUserAvailable'));
1006
-		} elseif ($this->isCrawlerUserNotAdmin() === false) {
1007
-			$this->addErrorMessage($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.beUserIsAdmin'));
1008
-		}
930
+    /**
931
+     * This method is used to show an overview about the active an the finished crawling processes
932
+     *
933
+     * @author Timo Schmidt
934
+     * @param void
935
+     * @return string
936
+     */
937
+    protected function drawProcessOverviewAction(){
938
+
939
+        $this->runRefreshHooks();
940
+
941
+        global $BACK_PATH;
942
+        $this->makeCrawlerProcessableChecks();
943
+
944
+        $crawler = $this->findCrawler();
945
+        try {
946
+            $this->handleProcessOverviewActions();
947
+        } catch (Exception $e) {
948
+            $this->addErrorMessage($e->getMessage());
949
+        }
1009 950
 
1010
-		if ($this->isPhpForkAvailable() === false) {
1011
-			$this->addErrorMessage($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.noPhpForkAvailable'));
1012
-		}
951
+        $offset 	= intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('offset'));
952
+        $perpage 	= 20;
1013 953
 
1014
-		$exitCode = 0;
1015
-		$out = array();
1016
-		exec(escapeshellcmd($this->extensionSettings['phpPath'] . ' -v'), $out, $exitCode);
1017
-		if ($exitCode > 0) {
1018
-			$this->addErrorMessage(sprintf($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.phpBinaryNotFound'), htmlspecialchars($this->extensionSettings['phpPath'])));
1019
-		}
1020
-	}
1021
-
1022
-	/**
1023
-	 * Indicate that the required PHP method "popen" is
1024
-	 * available in the system.
1025
-	 *
1026
-	 * @access protected
1027
-	 * @return boolean
1028
-	 *
1029
-	 * @author Michael Klapper <[email protected]>
1030
-	 */
1031
-	protected function isPhpForkAvailable() {
1032
-		return function_exists('popen');
1033
-	}
1034
-
1035
-	/**
1036
-	 * Indicate that the required be_user "_cli_crawler" is
1037
-	 * global available in the system.
1038
-	 *
1039
-	 * @access protected
1040
-	 * @return boolean
1041
-	 *
1042
-	 * @author Michael Klapper <[email protected]>
1043
-	 */
1044
-	protected function isCrawlerUserAvailable() {
1045
-		$isAvailable = false;
1046
-		$userArray = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField('be_users', 'username', '_cli_crawler');
954
+        $processRepository	= new tx_crawler_domain_process_repository();
955
+        $queueRepository	= new tx_crawler_domain_queue_repository();
1047 956
 
1048
-		if (is_array($userArray))
1049
-			$isAvailable = true;
1050
-
1051
-		return $isAvailable;
1052
-	}
957
+        $mode = $this->pObj->MOD_SETTINGS['processListMode'];
958
+        if ($mode == 'detail') {
959
+            $where = '';
960
+        } elseif($mode == 'simple') {
961
+            $where = 'active = 1';
962
+        }
1053 963
 
1054
-	/**
1055
-	 * Indicate that the required be_user "_cli_crawler" is
1056
-	 * has no admin rights.
1057
-	 *
1058
-	 * @access protected
1059
-	 * @return boolean
1060
-	 *
1061
-	 * @author Michael Klapper <[email protected]>
1062
-	 */
1063
-	protected function isCrawlerUserNotAdmin() {
1064
-		$isAvailable = false;
1065
-		$userArray = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField('be_users', 'username', '_cli_crawler');
964
+        $allProcesses 		= $processRepository->findAll('ttl','DESC', $perpage, $offset,$where);
965
+        $allCount			= $processRepository->countAll($where);
966
+
967
+        $listView			= new tx_crawler_view_process_list();
968
+        $listView->setPageId($this->pObj->id);
969
+        $listView->setIconPath($BACK_PATH.'../typo3conf/ext/crawler/template/process/res/img/');
970
+        $listView->setProcessCollection($allProcesses);
971
+        $listView->setCliPath($this->processManager->getCrawlerCliPath());
972
+        $listView->setIsCrawlerEnabled(!$crawler->getDisabled() && !$this->isErrorDetected);
973
+        $listView->setTotalUnprocessedItemCount($queueRepository->countAllPendingItems());
974
+        $listView->setAssignedUnprocessedItemCount($queueRepository->countAllAssignedPendingItems());
975
+        $listView->setActiveProcessCount($processRepository->countActive());
976
+        $listView->setMaxActiveProcessCount(tx_crawler_api::forceIntegerInRange($this->extensionSettings['processLimit'],1,99,1));
977
+        $listView->setMode($mode);
978
+
979
+        $paginationView		= new tx_crawler_view_pagination();
980
+        $paginationView->setCurrentOffset($offset);
981
+        $paginationView->setPerPage($perpage);
982
+        $paginationView->setTotalItemCount($allCount);
983
+
984
+        $output = $listView->render();
985
+
986
+        if ($paginationView->getTotalPagesCount() > 1) {
987
+            $output .= ' <br />'.$paginationView->render();
988
+        }
1066 989
 
1067
-		if (is_array($userArray) && $userArray[0]['admin'] == 0)
1068
-			$isAvailable = true;
990
+        return $output;
991
+    }
992
+
993
+    /**
994
+     * Verify that the crawler is exectuable.
995
+     *
996
+     * @access protected
997
+     * @return void
998
+     *
999
+     * @author Michael Klapper <[email protected]>
1000
+     */
1001
+    protected function makeCrawlerProcessableChecks() {
1002
+        global $LANG;
1003
+
1004
+        if ($this->isCrawlerUserAvailable() === false) {
1005
+            $this->addErrorMessage($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.noBeUserAvailable'));
1006
+        } elseif ($this->isCrawlerUserNotAdmin() === false) {
1007
+            $this->addErrorMessage($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.beUserIsAdmin'));
1008
+        }
1069 1009
 
1070
-		return $isAvailable;
1071
-	}
1010
+        if ($this->isPhpForkAvailable() === false) {
1011
+            $this->addErrorMessage($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.noPhpForkAvailable'));
1012
+        }
1072 1013
 
1073
-	/**
1074
-	 * Method to handle incomming actions of the process overview
1075
-	 *
1076
-	 * @param void
1077
-	 * @return void
1078
-	 */
1079
-	protected function handleProcessOverviewActions(){
1080
-
1081
-		$crawler = $this->findCrawler();
1082
-
1083
-		switch (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('action')) {
1084
-			case 'stopCrawling' :
1085
-				//set the cli status to disable (all processes will be terminated)
1086
-				$crawler->setDisabled(true);
1087
-				break;
1088
-			case 'resumeCrawling' :
1089
-				//set the cli status to end (all processes will be terminated)
1090
-				$crawler->setDisabled(false);
1091
-				break;
1092
-			case 'addProcess' :
1093
-				$handle = $this->processManager->startProcess();
1094
-				if ($handle === false) {
1095
-					throw new Exception($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.newprocesserror'));
1096
-				}
1097
-				$this->addNoticeMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.newprocess'));
1098
-				break;
1099
-		}
1100
-	}
1014
+        $exitCode = 0;
1015
+        $out = array();
1016
+        exec(escapeshellcmd($this->extensionSettings['phpPath'] . ' -v'), $out, $exitCode);
1017
+        if ($exitCode > 0) {
1018
+            $this->addErrorMessage(sprintf($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.phpBinaryNotFound'), htmlspecialchars($this->extensionSettings['phpPath'])));
1019
+        }
1020
+    }
1021
+
1022
+    /**
1023
+     * Indicate that the required PHP method "popen" is
1024
+     * available in the system.
1025
+     *
1026
+     * @access protected
1027
+     * @return boolean
1028
+     *
1029
+     * @author Michael Klapper <[email protected]>
1030
+     */
1031
+    protected function isPhpForkAvailable() {
1032
+        return function_exists('popen');
1033
+    }
1034
+
1035
+    /**
1036
+     * Indicate that the required be_user "_cli_crawler" is
1037
+     * global available in the system.
1038
+     *
1039
+     * @access protected
1040
+     * @return boolean
1041
+     *
1042
+     * @author Michael Klapper <[email protected]>
1043
+     */
1044
+    protected function isCrawlerUserAvailable() {
1045
+        $isAvailable = false;
1046
+        $userArray = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField('be_users', 'username', '_cli_crawler');
1047
+
1048
+        if (is_array($userArray))
1049
+            $isAvailable = true;
1050
+
1051
+        return $isAvailable;
1052
+    }
1053
+
1054
+    /**
1055
+     * Indicate that the required be_user "_cli_crawler" is
1056
+     * has no admin rights.
1057
+     *
1058
+     * @access protected
1059
+     * @return boolean
1060
+     *
1061
+     * @author Michael Klapper <[email protected]>
1062
+     */
1063
+    protected function isCrawlerUserNotAdmin() {
1064
+        $isAvailable = false;
1065
+        $userArray = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField('be_users', 'username', '_cli_crawler');
1066
+
1067
+        if (is_array($userArray) && $userArray[0]['admin'] == 0)
1068
+            $isAvailable = true;
1069
+
1070
+        return $isAvailable;
1071
+    }
1072
+
1073
+    /**
1074
+     * Method to handle incomming actions of the process overview
1075
+     *
1076
+     * @param void
1077
+     * @return void
1078
+     */
1079
+    protected function handleProcessOverviewActions(){
1080
+
1081
+        $crawler = $this->findCrawler();
1082
+
1083
+        switch (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('action')) {
1084
+            case 'stopCrawling' :
1085
+                //set the cli status to disable (all processes will be terminated)
1086
+                $crawler->setDisabled(true);
1087
+                break;
1088
+            case 'resumeCrawling' :
1089
+                //set the cli status to end (all processes will be terminated)
1090
+                $crawler->setDisabled(false);
1091
+                break;
1092
+            case 'addProcess' :
1093
+                $handle = $this->processManager->startProcess();
1094
+                if ($handle === false) {
1095
+                    throw new Exception($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.newprocesserror'));
1096
+                }
1097
+                $this->addNoticeMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.newprocess'));
1098
+                break;
1099
+        }
1100
+    }
1101 1101
 
1102 1102
 
1103 1103
 
1104 1104
 
1105
-	/**
1106
-	 * Returns the singleton instance of the crawler.
1107
-	 *
1108
-	 * @param void
1109
-	 * @return tx_crawler_lib crawler object
1110
-	 * @author Timo Schmidt <[email protected]>
1111
-	 */
1112
-	protected function findCrawler(){
1113
-		if(!$this->crawlerObj instanceof tx_crawler_lib){
1114
-			$this->crawlerObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_lib');
1115
-		}
1116
-		return $this->crawlerObj;
1117
-	}
1105
+    /**
1106
+     * Returns the singleton instance of the crawler.
1107
+     *
1108
+     * @param void
1109
+     * @return tx_crawler_lib crawler object
1110
+     * @author Timo Schmidt <[email protected]>
1111
+     */
1112
+    protected function findCrawler(){
1113
+        if(!$this->crawlerObj instanceof tx_crawler_lib){
1114
+            $this->crawlerObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_lib');
1115
+        }
1116
+        return $this->crawlerObj;
1117
+    }
1118 1118
 
1119 1119
 
1120 1120
 
1121
-	/*****************************
1121
+    /*****************************
1122 1122
 	 *
1123 1123
 	 * General Helper Functions
1124 1124
 	 *
1125 1125
 	 *****************************/
1126 1126
 
1127
-	/**
1128
-	 * This method is used to add a message to the internal queue
1129
-	 *
1130
-	 * NOTE:
1131
-	 * This method is basesd on TYPO3 4.3 or higher!
1132
-	 *
1133
-	 * @param  string  the message itself
1134
-	 * @param  integer message level (-1 = success (default), 0 = info, 1 = notice, 2 = warning, 3 = error)
1135
-	 *
1136
-	 * @access private
1137
-	 * @return void
1138
-	 */
1139
-	private function addMessage($message, $severity = \TYPO3\CMS\Core\Messaging\FlashMessage::OK) {
1140
-		$message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
1141
-			'TYPO3\CMS\Core\Messaging\FlashMessage',
1142
-			$message,
1143
-			'',
1144
-			$severity
1145
-		);
1146
-
1147
-		// TODO:
1148
-		/** @var \TYPO3\CMS\Core\Messaging\FlashMessageService $flashMessageService */
1149
-		$flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
1150
-		$flashMessageService->getMessageQueueByIdentifier()->addMessage($message);
1151
-	}
1152
-
1153
-	/**
1154
-	 * Add notice message to the user interface.
1155
-	 *
1156
-	 * NOTE:
1157
-	 * This method is basesd on TYPO3 4.3 or higher!
1158
-	 *
1159
-	 * @param string The message
1160
-	 *
1161
-	 * @access protected
1162
-	 * @return void
1163
-	 *
1164
-	 * @author Michael Klapper <[email protected]>
1165
-	 */
1166
-	protected function addNoticeMessage($message) {
1167
-		$this->addMessage($message, \TYPO3\CMS\Core\Messaging\FlashMessage::NOTICE);
1168
-	}
1169
-
1170
-	/**
1171
-	 * Add error message to the user interface.
1172
-	 *
1173
-	 * NOTE:
1174
-	 * This method is basesd on TYPO3 4.3 or higher!
1175
-	 *
1176
-	 * @param string The message
1177
-	 *
1178
-	 * @access protected
1179
-	 * @return void
1180
-	 *
1181
-	 * @author Michael Klapper <[email protected]>
1182
-	 */
1183
-	protected function addErrorMessage($message) {
1184
-		$this->isErrorDetected = TRUE;
1185
-		$this->addMessage($message, \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
1186
-	}
1187
-
1188
-	/**
1189
-	 * Add error message to the user interface.
1190
-	 *
1191
-	 * NOTE:
1192
-	 * This method is basesd on TYPO3 4.3 or higher!
1193
-	 *
1194
-	 * @param string The message
1195
-	 *
1196
-	 * @access protected
1197
-	 * @return void
1198
-	 *
1199
-	 * @author Michael Klapper <[email protected]>
1200
-	 */
1201
-	protected function addWarningMessage($message) {
1202
-		$this->addMessage($message, \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING);
1203
-	}
1204
-
1205
-	/**
1206
-	 * Create selector box
1207
-	 *
1208
-	 * @param	array		Options key(value) => label pairs
1209
-	 * @param	string		Selector box name
1210
-	 * @param	string		Selector box value (array for multiple...)
1211
-	 * @param	boolean		If set, will draw multiple box.
1212
-	 * @return	string		HTML select element
1213
-	 */
1214
-	function selectorBox($optArray, $name, $value, $multiple)	{
1215
-
1216
-		$options = array();
1217
-		foreach($optArray as $key => $val)	{
1218
-			$options[] = '
1127
+    /**
1128
+     * This method is used to add a message to the internal queue
1129
+     *
1130
+     * NOTE:
1131
+     * This method is basesd on TYPO3 4.3 or higher!
1132
+     *
1133
+     * @param  string  the message itself
1134
+     * @param  integer message level (-1 = success (default), 0 = info, 1 = notice, 2 = warning, 3 = error)
1135
+     *
1136
+     * @access private
1137
+     * @return void
1138
+     */
1139
+    private function addMessage($message, $severity = \TYPO3\CMS\Core\Messaging\FlashMessage::OK) {
1140
+        $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
1141
+            'TYPO3\CMS\Core\Messaging\FlashMessage',
1142
+            $message,
1143
+            '',
1144
+            $severity
1145
+        );
1146
+
1147
+        // TODO:
1148
+        /** @var \TYPO3\CMS\Core\Messaging\FlashMessageService $flashMessageService */
1149
+        $flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
1150
+        $flashMessageService->getMessageQueueByIdentifier()->addMessage($message);
1151
+    }
1152
+
1153
+    /**
1154
+     * Add notice message to the user interface.
1155
+     *
1156
+     * NOTE:
1157
+     * This method is basesd on TYPO3 4.3 or higher!
1158
+     *
1159
+     * @param string The message
1160
+     *
1161
+     * @access protected
1162
+     * @return void
1163
+     *
1164
+     * @author Michael Klapper <[email protected]>
1165
+     */
1166
+    protected function addNoticeMessage($message) {
1167
+        $this->addMessage($message, \TYPO3\CMS\Core\Messaging\FlashMessage::NOTICE);
1168
+    }
1169
+
1170
+    /**
1171
+     * Add error message to the user interface.
1172
+     *
1173
+     * NOTE:
1174
+     * This method is basesd on TYPO3 4.3 or higher!
1175
+     *
1176
+     * @param string The message
1177
+     *
1178
+     * @access protected
1179
+     * @return void
1180
+     *
1181
+     * @author Michael Klapper <[email protected]>
1182
+     */
1183
+    protected function addErrorMessage($message) {
1184
+        $this->isErrorDetected = TRUE;
1185
+        $this->addMessage($message, \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
1186
+    }
1187
+
1188
+    /**
1189
+     * Add error message to the user interface.
1190
+     *
1191
+     * NOTE:
1192
+     * This method is basesd on TYPO3 4.3 or higher!
1193
+     *
1194
+     * @param string The message
1195
+     *
1196
+     * @access protected
1197
+     * @return void
1198
+     *
1199
+     * @author Michael Klapper <[email protected]>
1200
+     */
1201
+    protected function addWarningMessage($message) {
1202
+        $this->addMessage($message, \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING);
1203
+    }
1204
+
1205
+    /**
1206
+     * Create selector box
1207
+     *
1208
+     * @param	array		Options key(value) => label pairs
1209
+     * @param	string		Selector box name
1210
+     * @param	string		Selector box value (array for multiple...)
1211
+     * @param	boolean		If set, will draw multiple box.
1212
+     * @return	string		HTML select element
1213
+     */
1214
+    function selectorBox($optArray, $name, $value, $multiple)	{
1215
+
1216
+        $options = array();
1217
+        foreach($optArray as $key => $val)	{
1218
+            $options[] = '
1219 1219
 				<option value="'.htmlspecialchars($key).'"'.((!$multiple && !strcmp($value,$key)) || ($multiple && in_array($key,(array)$value))?' selected="selected"':'').'>'.htmlspecialchars($val).'</option>';
1220
-		}
1221
-
1222
-		$output = '<select name="'.htmlspecialchars($name.($multiple?'[]':'')).'"'.($multiple ? ' multiple="multiple" size="'.count($options).'"' : '').'>'.implode('',$options).'</select>';
1223
-
1224
-		return $output;
1225
-	}
1226
-
1227
-	/**
1228
-	 * Activate hooks
1229
-	 *
1230
-	 * @return	void
1231
-	 */
1232
-	function runRefreshHooks() {
1233
-		$crawlerLib = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_lib');
1234
-		if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['crawler']['refresh_hooks'])) {
1235
-			foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['crawler']['refresh_hooks'] as $objRef) {
1236
-				$hookObj = &\TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($objRef);
1237
-				if (is_object($hookObj)) {
1238
-					$hookObj->crawler_init($crawlerLib);
1239
-				}
1240
-			}
1241
-		}
1220
+        }
1242 1221
 
1243
-	}
1222
+        $output = '<select name="'.htmlspecialchars($name.($multiple?'[]':'')).'"'.($multiple ? ' multiple="multiple" size="'.count($options).'"' : '').'>'.implode('',$options).'</select>';
1223
+
1224
+        return $output;
1225
+    }
1226
+
1227
+    /**
1228
+     * Activate hooks
1229
+     *
1230
+     * @return	void
1231
+     */
1232
+    function runRefreshHooks() {
1233
+        $crawlerLib = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_lib');
1234
+        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['crawler']['refresh_hooks'])) {
1235
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['crawler']['refresh_hooks'] as $objRef) {
1236
+                $hookObj = &\TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($objRef);
1237
+                if (is_object($hookObj)) {
1238
+                    $hookObj->crawler_init($crawlerLib);
1239
+                }
1240
+            }
1241
+        }
1244 1242
 
1245
-	/**
1246
-	 * Returns the URL to the current module, including $_GET['id'].
1247
-	 *
1248
-	 * @param array $urlParameters optional parameters to add to the URL
1249
-	 * @return string
1250
-	 */
1251
-	protected function getModuleUrl(array $urlParameters = array()) {
1252
-	    if ($this->pObj->id) {
1253
-	        $urlParameters = array_merge($urlParameters, array(
1243
+    }
1244
+
1245
+    /**
1246
+     * Returns the URL to the current module, including $_GET['id'].
1247
+     *
1248
+     * @param array $urlParameters optional parameters to add to the URL
1249
+     * @return string
1250
+     */
1251
+    protected function getModuleUrl(array $urlParameters = array()) {
1252
+        if ($this->pObj->id) {
1253
+            $urlParameters = array_merge($urlParameters, array(
1254 1254
                 'id' => $this->pObj->id
1255 1255
             ));
1256
-	    }
1256
+        }
1257 1257
         return \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('M'), $urlParameters);
1258
-	}
1258
+    }
1259 1259
 }
1260 1260
 
1261 1261
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/modfunc1/class.tx_crawler_modfunc1.php'])	{
1262
-	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/modfunc1/class.tx_crawler_modfunc1.php']);
1262
+    include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/modfunc1/class.tx_crawler_modfunc1.php']);
1263 1263
 }
Please login to merge, or discard this patch.
view/class.tx_crawler_view_pagination.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@
 block discarded – undo
123 123
 	 * Returns the total number of pages needed to  display all content which
124 124
 	 * is paginatable
125 125
 	 *
126
-	 * @return int
126
+	 * @return double
127 127
 	 */
128 128
 	public function getTotalPagesCount() {
129 129
 	 	return ceil($this->getTotalItemCount() / $this->getPerPage());
Please login to merge, or discard this patch.
Indentation   +115 added lines, -115 removed lines patch added patch discarded remove patch
@@ -24,121 +24,121 @@
 block discarded – undo
24 24
 
25 25
 class tx_crawler_view_pagination {
26 26
 
27
-	/**
28
-	 * @var string template path
29
-	 */
30
-	protected $template = 'EXT:crawler/template/pagination.php';
31
-
32
-	/**
33
-	 * @var int $perpage number of items perPage
34
-	 */
35
-	protected $perPage;
36
-
37
-	/**
38
-	 * @var int $currentOffset current offset
39
-	 */
40
-	protected $currentOffset;
41
-
42
-	/**
43
-	 * @var int $totalItemCount number of total item
44
-	 */
45
-	protected $totalItemCount;
46
-
47
-	/**
48
-	 * @var string $baseUrl
49
-	 */
50
-	protected $baseUrl;
51
-
52
-
53
-
54
-
55
-	/**
56
-	 * Method to render the view.
57
-	 *
58
-	 * @return string html content
59
-	 */
60
-	public function render() {
61
-		ob_start();
62
-		$this->template = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->template);
63
-		include($this->template);
64
-		$content = ob_get_contents();
65
-		ob_end_clean();
66
-
67
-		return $content;
68
-	}
69
-
70
-	/**
71
-	 * Returns the currently configured offset-
72
-	 * @return int
73
-	 */
74
-	public function getCurrentOffset() {
75
-		return $this->currentOffset;
76
-	}
77
-
78
-	/**
79
-	 * Method to read the number of items per page
80
-	 *
81
-	 * @return int
82
-	 */
83
-	public function getPerPage() {
84
-		return $this->perPage;
85
-	}
86
-
87
-	/**
88
-	 * Method to set the current offset from start
89
-	 *
90
-	 * @param int $currentOffset
91
-	 */
92
-	public function setCurrentOffset($currentOffset) {
93
-		$this->currentOffset = $currentOffset;
94
-	}
95
-
96
-	/**
97
-	 * Number of items per page.
98
-	 *
99
-	 * @param int $perPage
100
-	 */
101
-	public function setPerPage($perPage) {
102
-		$this->perPage = $perPage;
103
-	}
104
-
105
-	/**
106
-	 * returns the total number of items
107
-	 * @return int
108
-	 */
109
-	public function getTotalItemCount() {
110
-		return $this->totalItemCount;
111
-	}
112
-
113
-	/**
114
-	 * Method to set the total number of items in the pagination
115
-	 *
116
-	 * @param int $totalItemCount
117
-	 */
118
-	public function setTotalItemCount($totalItemCount) {
119
-		$this->totalItemCount = $totalItemCount;
120
-	}
121
-
122
-	/**
123
-	 * Returns the total number of pages needed to  display all content which
124
-	 * is paginatable
125
-	 *
126
-	 * @return int
127
-	 */
128
-	public function getTotalPagesCount() {
129
-	 	return ceil($this->getTotalItemCount() / $this->getPerPage());
130
-	}
131
-
132
-	/**
133
-	 * This method is used to caluclate the label for a pageoffset,
134
-	 * in normal cases its the internal offset + 1
135
-	 *
136
-	 * @param int $pageoffset
137
-	 * @return int
138
-	 */
139
-	protected function getLabelForPageOffset($pageoffset) {
140
-		return $pageoffset + 1;
141
-	}
27
+    /**
28
+     * @var string template path
29
+     */
30
+    protected $template = 'EXT:crawler/template/pagination.php';
31
+
32
+    /**
33
+     * @var int $perpage number of items perPage
34
+     */
35
+    protected $perPage;
36
+
37
+    /**
38
+     * @var int $currentOffset current offset
39
+     */
40
+    protected $currentOffset;
41
+
42
+    /**
43
+     * @var int $totalItemCount number of total item
44
+     */
45
+    protected $totalItemCount;
46
+
47
+    /**
48
+     * @var string $baseUrl
49
+     */
50
+    protected $baseUrl;
51
+
52
+
53
+
54
+
55
+    /**
56
+     * Method to render the view.
57
+     *
58
+     * @return string html content
59
+     */
60
+    public function render() {
61
+        ob_start();
62
+        $this->template = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->template);
63
+        include($this->template);
64
+        $content = ob_get_contents();
65
+        ob_end_clean();
66
+
67
+        return $content;
68
+    }
69
+
70
+    /**
71
+     * Returns the currently configured offset-
72
+     * @return int
73
+     */
74
+    public function getCurrentOffset() {
75
+        return $this->currentOffset;
76
+    }
77
+
78
+    /**
79
+     * Method to read the number of items per page
80
+     *
81
+     * @return int
82
+     */
83
+    public function getPerPage() {
84
+        return $this->perPage;
85
+    }
86
+
87
+    /**
88
+     * Method to set the current offset from start
89
+     *
90
+     * @param int $currentOffset
91
+     */
92
+    public function setCurrentOffset($currentOffset) {
93
+        $this->currentOffset = $currentOffset;
94
+    }
95
+
96
+    /**
97
+     * Number of items per page.
98
+     *
99
+     * @param int $perPage
100
+     */
101
+    public function setPerPage($perPage) {
102
+        $this->perPage = $perPage;
103
+    }
104
+
105
+    /**
106
+     * returns the total number of items
107
+     * @return int
108
+     */
109
+    public function getTotalItemCount() {
110
+        return $this->totalItemCount;
111
+    }
112
+
113
+    /**
114
+     * Method to set the total number of items in the pagination
115
+     *
116
+     * @param int $totalItemCount
117
+     */
118
+    public function setTotalItemCount($totalItemCount) {
119
+        $this->totalItemCount = $totalItemCount;
120
+    }
121
+
122
+    /**
123
+     * Returns the total number of pages needed to  display all content which
124
+     * is paginatable
125
+     *
126
+     * @return int
127
+     */
128
+    public function getTotalPagesCount() {
129
+            return ceil($this->getTotalItemCount() / $this->getPerPage());
130
+    }
131
+
132
+    /**
133
+     * This method is used to caluclate the label for a pageoffset,
134
+     * in normal cases its the internal offset + 1
135
+     *
136
+     * @param int $pageoffset
137
+     * @return int
138
+     */
139
+    protected function getLabelForPageOffset($pageoffset) {
140
+        return $pageoffset + 1;
141
+    }
142 142
 
143 143
 }
144 144
 
Please login to merge, or discard this patch.
view/process/class.tx_crawler_view_process_list.php 3 patches
Doc Comments   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -111,6 +111,7 @@  discard block
 block discarded – undo
111 111
 	 * Set the page id
112 112
 	 *
113 113
 	 * @param int page id
114
+	 * @param integer $pageId
114 115
 	 */
115 116
 	public function setPageId($pageId) {
116 117
 		$this->pageId = $pageId;
@@ -269,7 +270,7 @@  discard block
 block discarded – undo
269 270
 	 * Converts seconds into minutes
270 271
 	 *
271 272
 	 * @param int $seconds
272
-	 * @return int
273
+	 * @return double
273 274
 	 */
274 275
 	protected function asMinutes($seconds) {
275 276
 		return round($seconds / 60);
@@ -409,7 +410,7 @@  discard block
 block discarded – undo
409 410
 	 * just a wrapper should be done in a cleaner way
410 411
 	 * later on
411 412
 	 *
412
-	 * @param $label
413
+	 * @param string $label
413 414
 	 * @return string
414 415
 	 */
415 416
 	protected function getLLLabel($label) {
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 	 * @return string icon
283 283
 	 */
284 284
 	protected function getIconForState($state) {
285
-		switch($state) {
285
+		switch ($state) {
286 286
 			case 'running':
287 287
 				$icon = 'bullet_orange';
288 288
 				$title = $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.process.running');
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 	 * @return string
316 316
 	 */
317 317
 	protected function getRefreshLink() {
318
-		return '<input onclick="window.location=\'' . \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_info') . '&SET[crawlaction]=multiprocess&id=' . $this->pageId . '\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'arrow_refresh.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.refresh') . '" />';
318
+		return '<input onclick="window.location=\''.\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_info').'&SET[crawlaction]=multiprocess&id='.$this->pageId.'\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\''.$this->getIconPath().'arrow_refresh.png'.'\'); background-repeat: no-repeat;" value="'.$this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.refresh').'" />';
319 319
 	}
320 320
 
321 321
 	/**
@@ -334,9 +334,9 @@  discard block
 block discarded – undo
334 334
 	 */
335 335
 	protected function getEnableDisableLink() {
336 336
 		if ($this->getIsCrawlerEnabled()) {
337
-			return '<input onclick="window.location+=\'&action=stopCrawling\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'control_stop_blue.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.disablecrawling') . '" />';
337
+			return '<input onclick="window.location+=\'&action=stopCrawling\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\''.$this->getIconPath().'control_stop_blue.png'.'\'); background-repeat: no-repeat;" value="'.$this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.disablecrawling').'" />';
338 338
 		} else {
339
-			return '<input onclick="window.location+=\'&action=resumeCrawling\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'control_play.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.enablecrawling') . '" />';
339
+			return '<input onclick="window.location+=\'&action=resumeCrawling\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\''.$this->getIconPath().'control_play.png'.'\'); background-repeat: no-repeat;" value="'.$this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.enablecrawling').'" />';
340 340
 		}
341 341
 	}
342 342
 
@@ -348,9 +348,9 @@  discard block
 block discarded – undo
348 348
 	 */
349 349
 	protected function getModeLink() {
350 350
 		if ($this->getMode() == 'detail') {
351
-			return '<input onclick="window.location+=\'&SET[processListMode]=simple\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'arrow_in.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.show.running') . '" />';
351
+			return '<input onclick="window.location+=\'&SET[processListMode]=simple\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\''.$this->getIconPath().'arrow_in.png'.'\'); background-repeat: no-repeat;" value="'.$this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.show.running').'" />';
352 352
 		} elseif ($this->getMode() == 'simple') {
353
-			return '<input onclick="window.location+=\'&SET[processListMode]=detail\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'arrow_out.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.show.all') . '" />';
353
+			return '<input onclick="window.location+=\'&SET[processListMode]=detail\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\''.$this->getIconPath().'arrow_out.png'.'\'); background-repeat: no-repeat;" value="'.$this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.show.all').'" />';
354 354
 		}
355 355
 	}
356 356
 
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 	 */
363 363
 	protected function getAddLink() {
364 364
 		if ($this->getActiveProcessCount() < $this->getMaxActiveProcessCount() && $this->getIsCrawlerEnabled()) {
365
-			return '<input onclick="window.location+=\'&action=addProcess\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'add.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.process.add') . '" />';
365
+			return '<input onclick="window.location+=\'&action=addProcess\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\''.$this->getIconPath().'add.png'.'\'); background-repeat: no-repeat;" value="'.$this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.process.add').'" />';
366 366
 		} else {
367 367
 			return '';
368 368
 		}
@@ -383,11 +383,11 @@  discard block
 block discarded – undo
383 383
 	 * @param string $icon
384 384
 	 * @return string html tag for icon
385 385
 	 */
386
-	protected function getIcon($icon, $title='') {
386
+	protected function getIcon($icon, $title = '') {
387 387
 		if (!empty($title)) {
388 388
 			$title = ' title="'.$title.'"';
389 389
 		}
390
-		return '<img src="'.$this->getIconPath().$icon.'.png" ' . $title . ' />';
390
+		return '<img src="'.$this->getIconPath().$icon.'.png" '.$title.' />';
391 391
 	}
392 392
 
393 393
 	/**
Please login to merge, or discard this patch.
Indentation   +391 added lines, -391 removed lines patch added patch discarded remove patch
@@ -29,397 +29,397 @@
 block discarded – undo
29 29
  */
30 30
 class tx_crawler_view_process_list {
31 31
 
32
-	/**
33
-	 * @var string template path
34
-	 */
35
-	protected $template = 'EXT:crawler/template/process/list.php';
36
-
37
-	/**
38
-	 * @var string icon path
39
-	 */
40
-	protected $iconPath;
41
-
42
-	/**
43
-	 * @var string Holds the path to start a cli process via command line
44
-	 */
45
-	protected $cliPath;
46
-
47
-	/**
48
-	 * @var int Holds the total number of items pending in the queue to be processed
49
-	 */
50
-	protected $totalItemCount;
51
-
52
-	/**
53
-	 * @var boolean Holds the enable state of the crawler
54
-	 */
55
-	protected $isCrawlerEnabled;
56
-
57
-	/**
58
-	 * @var int Holds the number of active processes
59
-	 */
60
-	protected $activeProcessCount;
61
-
62
-	/**
63
-	 * @var int Holds the number of maximum active processes
64
-	 */
65
-	protected $maxActiveProcessCount;
66
-
67
-	/**
68
-	 * @var string Holds the mode state, can be simple or detail
69
-	 */
70
-	protected $mode;
71
-
72
-	/**
73
-	 * @var int Holds the current page id
74
-	 */
75
-	protected $pageId;
76
-
77
-	/**
78
-	 * @var int $totalItemCount number of total item
79
-	 */
80
-	protected $totalUnprocessedItemCount;
81
-
82
-	/**
83
-	 * @var int Holds the number of assigned unprocessed items
84
-	 */
85
-	protected $assignedUnprocessedItemCount;
86
-
87
-	/**
88
-	 * @return int
89
-	 */
90
-	public function getAssignedUnprocessedItemCount() {
91
-		return $this->assignedUnprocessedItemCount;
92
-	}
93
-
94
-	/**
95
-	 * @return int
96
-	 */
97
-	public function getTotalUnprocessedItemCount() {
98
-		return $this->totalUnprocessedItemCount;
99
-	}
100
-
101
-	/**
102
-	 * @param int $assignedUnprocessedItemCount
103
-	 */
104
-	public function setAssignedUnprocessedItemCount($assignedUnprocessedItemCount) {
105
-		$this->assignedUnprocessedItemCount = $assignedUnprocessedItemCount;
106
-	}
107
-
108
-	/**
109
-	 * @param int $totalUnprocessedItemCount
110
-	 */
111
-	public function setTotalUnprocessedItemCount($totalUnprocessedItemCount) {
112
-		$this->totalUnprocessedItemCount = $totalUnprocessedItemCount;
113
-	}
114
-
115
-	/**
116
-	 * Set the page id
117
-	 *
118
-	 * @param int page id
119
-	 */
120
-	public function setPageId($pageId) {
121
-		$this->pageId = $pageId;
122
-	}
123
-
124
-	/**
125
-	 * Get the page id
126
-	 *
127
-	 * @return int page id
128
-	 */
129
-	public function getPageId() {
130
-		return $this->pageId;
131
-	}
132
-
133
-	/**
134
-	 * @return string
135
-	 */
136
-	public function getMode() {
137
-		return $this->mode;
138
-	}
139
-
140
-	/**
141
-	 * @param string $mode
142
-	 */
143
-	public function setMode($mode) {
144
-		$this->mode = $mode;
145
-	}
146
-
147
-
148
-	/**
149
-	 * @return int
150
-	 */
151
-	public function getMaxActiveProcessCount() {
152
-		return $this->maxActiveProcessCount;
153
-	}
154
-
155
-	/**
156
-	 * @param int $maxActiveProcessCount
157
-	 */
158
-	public function setMaxActiveProcessCount($maxActiveProcessCount) {
159
-		$this->maxActiveProcessCount = $maxActiveProcessCount;
160
-	}
161
-
162
-
163
-	/**
164
-	 * @return int
165
-	 */
166
-	public function getActiveProcessCount() {
167
-		return $this->activeProcessCount;
168
-	}
169
-
170
-	/**
171
-	 * @param int $activeProcessCount
172
-	 */
173
-	public function setActiveProcessCount($activeProcessCount) {
174
-		$this->activeProcessCount = $activeProcessCount;
175
-	}
176
-
177
-	/**
178
-	 * @return boolean
179
-	 */
180
-	public function getIsCrawlerEnabled() {
181
-		return $this->isCrawlerEnabled;
182
-	}
183
-
184
-	/**
185
-	 * @param boolean $isCrawlerEnabled
186
-	 */
187
-	public function setIsCrawlerEnabled($isCrawlerEnabled) {
188
-		$this->isCrawlerEnabled = $isCrawlerEnabled;
189
-	}
190
-
191
-
192
-	/**
193
-	 * Returns the path to start a cli process from the shell
194
-	 * @return string
195
-	 */
196
-	public function getCliPath() {
197
-		return $this->cliPath;
198
-	}
199
-
200
-	/**
201
-	 * @param string $cliPath
202
-	 */
203
-	public function setCliPath($cliPath) {
204
-		$this->cliPath = $cliPath;
205
-	}
206
-
207
-
208
-	/**
209
-	 * @return int
210
-	 */
211
-	public function getTotalItemCount() {
212
-		return $this->totalItemCount;
213
-	}
214
-
215
-	/**
216
-	 * @param int $totalItemCount
217
-	 */
218
-	public function setTotalItemCount($totalItemCount) {
219
-		$this->totalItemCount = $totalItemCount;
220
-	}
221
-
222
-	/**
223
-	 * Method to set the path to the icon from outside
224
-	 *
225
-	 * @param string $iconPath
226
-	 */
227
-	public function setIconPath($iconPath) {
228
-		$this->iconPath = $iconPath;
229
-	}
230
-
231
-	/**
232
-	 * Method to read the configured icon path
233
-	 *
234
-	 * @return string
235
-	 */
236
-	protected function getIconPath() {
237
-		return $this->iconPath;
238
-	}
239
-
240
-	/**
241
-	 * Method to set a collection of process objects to be displayed in
242
-	 * the list view.
243
-	 *
244
-	 * @param tx_crawler_domain_process_collection $processCollection
245
-	 */
246
-	public function setProcessCollection($processCollection) {
247
-		$this->processCollection = $processCollection;
248
-	}
249
-
250
-	/**
251
-	 * Returns a collection of processObjects.
252
-	 *
253
-	 * @return tx_crawler_domain_process_collection
254
-	 */
255
-	protected function getProcessCollection() {
256
-		return $this->processCollection;
257
-	}
258
-
259
-	/**
260
-	 * Formats a timestamp as date
261
-	 *
262
-	 * @param int $timestamp
263
-	 * @return string
264
-	 */
265
-	protected function asDate($timestamp) {
266
-		if ($timestamp > 0) {
267
-			return date($this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:time.detailed'), $timestamp);
268
-		} else {
269
-			return '';
270
-		}
271
-	}
272
-
273
-	/**
274
-	 * Converts seconds into minutes
275
-	 *
276
-	 * @param int $seconds
277
-	 * @return int
278
-	 */
279
-	protected function asMinutes($seconds) {
280
-		return round($seconds / 60);
281
-	}
282
-
283
-	/**
284
-	 * Returns the state icon for the current job
285
-	 *
286
-	 * @param string $state
287
-	 * @return string icon
288
-	 */
289
-	protected function getIconForState($state) {
290
-		switch($state) {
291
-			case 'running':
292
-				$icon = 'bullet_orange';
293
-				$title = $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.process.running');
294
-				break;
295
-			case 'completed':
296
-				$icon = 'bullet_green';
297
-				$title = $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.process.success');
298
-				break;
299
-			case 'cancelled':
300
-				$icon = 'bullet_red';
301
-				$title = $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.process.cancelled');
302
-				break;
303
-		}
304
-
305
-		return $this->getIcon($icon, $title);
306
-	}
307
-
308
-	/**
309
-	 * Returns a tag for the refresh icon
310
-	 *
311
-	 * @return string
312
-	 */
313
-	protected function getRefreshIcon() {
314
-		return $this->getIcon('arrow_refresh');
315
-	}
316
-
317
-	/**
318
-	 * Returns a tag for the refresh icon
319
-	 *
320
-	 * @return string
321
-	 */
322
-	protected function getRefreshLink() {
323
-		return '<input onclick="window.location=\'' . \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_info') . '&SET[crawlaction]=multiprocess&id=' . $this->pageId . '\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'arrow_refresh.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.refresh') . '" />';
324
-	}
325
-
326
-	/**
327
-	 * Returns an icon to stop all processes
328
-	 *
329
-	 * @return string html tag for stop icon
330
-	 */
331
-	protected function getStopIcon() {
332
-		return $this->getIcon('stop');
333
-	}
334
-
335
-	/**
336
-	 * Returns a link for the panel to enable or disable the crawler
337
-	 *
338
-	 * @return string
339
-	 */
340
-	protected function getEnableDisableLink() {
341
-		if ($this->getIsCrawlerEnabled()) {
342
-			return '<input onclick="window.location+=\'&action=stopCrawling\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'control_stop_blue.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.disablecrawling') . '" />';
343
-		} else {
344
-			return '<input onclick="window.location+=\'&action=resumeCrawling\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'control_play.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.enablecrawling') . '" />';
345
-		}
346
-	}
347
-
348
-	/**
349
-	 * Get mode link
350
-	 *
351
-	 * @param void
352
-	 * @return string a-tag
353
-	 */
354
-	protected function getModeLink() {
355
-		if ($this->getMode() == 'detail') {
356
-			return '<input onclick="window.location+=\'&SET[processListMode]=simple\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'arrow_in.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.show.running') . '" />';
357
-		} elseif ($this->getMode() == 'simple') {
358
-			return '<input onclick="window.location+=\'&SET[processListMode]=detail\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'arrow_out.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.show.all') . '" />';
359
-		}
360
-	}
361
-
362
-	/**
363
-	 * Get add link
364
-	 *
365
-	 * @param void
366
-	 * @return string a-tag
367
-	 */
368
-	protected function getAddLink() {
369
-		if ($this->getActiveProcessCount() < $this->getMaxActiveProcessCount() && $this->getIsCrawlerEnabled()) {
370
-			return '<input onclick="window.location+=\'&action=addProcess\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'add.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.process.add') . '" />';
371
-		} else {
372
-			return '';
373
-		}
374
-	}
375
-
376
-	/**
377
-	 * Returns the icon to add new crawler processes
378
-	 *
379
-	 * @return string html tag for image to add new processes
380
-	 */
381
-	protected function getAddIcon() {
382
-		return $this->getIcon('add');
383
-	}
384
-
385
-	/**
386
-	 * Returns an imagetag for an icon
387
-	 *
388
-	 * @param string $icon
389
-	 * @return string html tag for icon
390
-	 */
391
-	protected function getIcon($icon, $title='') {
392
-		if (!empty($title)) {
393
-			$title = ' title="'.$title.'"';
394
-		}
395
-		return '<img src="'.$this->getIconPath().$icon.'.png" ' . $title . ' />';
396
-	}
397
-
398
-	/**
399
-	 * Method to render the view.
400
-	 *
401
-	 * @return string html content
402
-	 */
403
-	public function render() {
404
-		ob_start();
405
-		$this->template = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->template);
406
-		include($this->template);
407
-		$content = ob_get_contents();
408
-		ob_end_clean();
409
-		return $content;
410
-	}
411
-
412
-	/**
413
-	 * retrieve locallanglabel from environment
414
-	 * just a wrapper should be done in a cleaner way
415
-	 * later on
416
-	 *
417
-	 * @param $label
418
-	 * @return string
419
-	 */
420
-	protected function getLLLabel($label) {
421
-		return $GLOBALS['LANG']->sL($label);
422
-	}
32
+    /**
33
+     * @var string template path
34
+     */
35
+    protected $template = 'EXT:crawler/template/process/list.php';
36
+
37
+    /**
38
+     * @var string icon path
39
+     */
40
+    protected $iconPath;
41
+
42
+    /**
43
+     * @var string Holds the path to start a cli process via command line
44
+     */
45
+    protected $cliPath;
46
+
47
+    /**
48
+     * @var int Holds the total number of items pending in the queue to be processed
49
+     */
50
+    protected $totalItemCount;
51
+
52
+    /**
53
+     * @var boolean Holds the enable state of the crawler
54
+     */
55
+    protected $isCrawlerEnabled;
56
+
57
+    /**
58
+     * @var int Holds the number of active processes
59
+     */
60
+    protected $activeProcessCount;
61
+
62
+    /**
63
+     * @var int Holds the number of maximum active processes
64
+     */
65
+    protected $maxActiveProcessCount;
66
+
67
+    /**
68
+     * @var string Holds the mode state, can be simple or detail
69
+     */
70
+    protected $mode;
71
+
72
+    /**
73
+     * @var int Holds the current page id
74
+     */
75
+    protected $pageId;
76
+
77
+    /**
78
+     * @var int $totalItemCount number of total item
79
+     */
80
+    protected $totalUnprocessedItemCount;
81
+
82
+    /**
83
+     * @var int Holds the number of assigned unprocessed items
84
+     */
85
+    protected $assignedUnprocessedItemCount;
86
+
87
+    /**
88
+     * @return int
89
+     */
90
+    public function getAssignedUnprocessedItemCount() {
91
+        return $this->assignedUnprocessedItemCount;
92
+    }
93
+
94
+    /**
95
+     * @return int
96
+     */
97
+    public function getTotalUnprocessedItemCount() {
98
+        return $this->totalUnprocessedItemCount;
99
+    }
100
+
101
+    /**
102
+     * @param int $assignedUnprocessedItemCount
103
+     */
104
+    public function setAssignedUnprocessedItemCount($assignedUnprocessedItemCount) {
105
+        $this->assignedUnprocessedItemCount = $assignedUnprocessedItemCount;
106
+    }
107
+
108
+    /**
109
+     * @param int $totalUnprocessedItemCount
110
+     */
111
+    public function setTotalUnprocessedItemCount($totalUnprocessedItemCount) {
112
+        $this->totalUnprocessedItemCount = $totalUnprocessedItemCount;
113
+    }
114
+
115
+    /**
116
+     * Set the page id
117
+     *
118
+     * @param int page id
119
+     */
120
+    public function setPageId($pageId) {
121
+        $this->pageId = $pageId;
122
+    }
123
+
124
+    /**
125
+     * Get the page id
126
+     *
127
+     * @return int page id
128
+     */
129
+    public function getPageId() {
130
+        return $this->pageId;
131
+    }
132
+
133
+    /**
134
+     * @return string
135
+     */
136
+    public function getMode() {
137
+        return $this->mode;
138
+    }
139
+
140
+    /**
141
+     * @param string $mode
142
+     */
143
+    public function setMode($mode) {
144
+        $this->mode = $mode;
145
+    }
146
+
147
+
148
+    /**
149
+     * @return int
150
+     */
151
+    public function getMaxActiveProcessCount() {
152
+        return $this->maxActiveProcessCount;
153
+    }
154
+
155
+    /**
156
+     * @param int $maxActiveProcessCount
157
+     */
158
+    public function setMaxActiveProcessCount($maxActiveProcessCount) {
159
+        $this->maxActiveProcessCount = $maxActiveProcessCount;
160
+    }
161
+
162
+
163
+    /**
164
+     * @return int
165
+     */
166
+    public function getActiveProcessCount() {
167
+        return $this->activeProcessCount;
168
+    }
169
+
170
+    /**
171
+     * @param int $activeProcessCount
172
+     */
173
+    public function setActiveProcessCount($activeProcessCount) {
174
+        $this->activeProcessCount = $activeProcessCount;
175
+    }
176
+
177
+    /**
178
+     * @return boolean
179
+     */
180
+    public function getIsCrawlerEnabled() {
181
+        return $this->isCrawlerEnabled;
182
+    }
183
+
184
+    /**
185
+     * @param boolean $isCrawlerEnabled
186
+     */
187
+    public function setIsCrawlerEnabled($isCrawlerEnabled) {
188
+        $this->isCrawlerEnabled = $isCrawlerEnabled;
189
+    }
190
+
191
+
192
+    /**
193
+     * Returns the path to start a cli process from the shell
194
+     * @return string
195
+     */
196
+    public function getCliPath() {
197
+        return $this->cliPath;
198
+    }
199
+
200
+    /**
201
+     * @param string $cliPath
202
+     */
203
+    public function setCliPath($cliPath) {
204
+        $this->cliPath = $cliPath;
205
+    }
206
+
207
+
208
+    /**
209
+     * @return int
210
+     */
211
+    public function getTotalItemCount() {
212
+        return $this->totalItemCount;
213
+    }
214
+
215
+    /**
216
+     * @param int $totalItemCount
217
+     */
218
+    public function setTotalItemCount($totalItemCount) {
219
+        $this->totalItemCount = $totalItemCount;
220
+    }
221
+
222
+    /**
223
+     * Method to set the path to the icon from outside
224
+     *
225
+     * @param string $iconPath
226
+     */
227
+    public function setIconPath($iconPath) {
228
+        $this->iconPath = $iconPath;
229
+    }
230
+
231
+    /**
232
+     * Method to read the configured icon path
233
+     *
234
+     * @return string
235
+     */
236
+    protected function getIconPath() {
237
+        return $this->iconPath;
238
+    }
239
+
240
+    /**
241
+     * Method to set a collection of process objects to be displayed in
242
+     * the list view.
243
+     *
244
+     * @param tx_crawler_domain_process_collection $processCollection
245
+     */
246
+    public function setProcessCollection($processCollection) {
247
+        $this->processCollection = $processCollection;
248
+    }
249
+
250
+    /**
251
+     * Returns a collection of processObjects.
252
+     *
253
+     * @return tx_crawler_domain_process_collection
254
+     */
255
+    protected function getProcessCollection() {
256
+        return $this->processCollection;
257
+    }
258
+
259
+    /**
260
+     * Formats a timestamp as date
261
+     *
262
+     * @param int $timestamp
263
+     * @return string
264
+     */
265
+    protected function asDate($timestamp) {
266
+        if ($timestamp > 0) {
267
+            return date($this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:time.detailed'), $timestamp);
268
+        } else {
269
+            return '';
270
+        }
271
+    }
272
+
273
+    /**
274
+     * Converts seconds into minutes
275
+     *
276
+     * @param int $seconds
277
+     * @return int
278
+     */
279
+    protected function asMinutes($seconds) {
280
+        return round($seconds / 60);
281
+    }
282
+
283
+    /**
284
+     * Returns the state icon for the current job
285
+     *
286
+     * @param string $state
287
+     * @return string icon
288
+     */
289
+    protected function getIconForState($state) {
290
+        switch($state) {
291
+            case 'running':
292
+                $icon = 'bullet_orange';
293
+                $title = $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.process.running');
294
+                break;
295
+            case 'completed':
296
+                $icon = 'bullet_green';
297
+                $title = $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.process.success');
298
+                break;
299
+            case 'cancelled':
300
+                $icon = 'bullet_red';
301
+                $title = $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.process.cancelled');
302
+                break;
303
+        }
304
+
305
+        return $this->getIcon($icon, $title);
306
+    }
307
+
308
+    /**
309
+     * Returns a tag for the refresh icon
310
+     *
311
+     * @return string
312
+     */
313
+    protected function getRefreshIcon() {
314
+        return $this->getIcon('arrow_refresh');
315
+    }
316
+
317
+    /**
318
+     * Returns a tag for the refresh icon
319
+     *
320
+     * @return string
321
+     */
322
+    protected function getRefreshLink() {
323
+        return '<input onclick="window.location=\'' . \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_info') . '&SET[crawlaction]=multiprocess&id=' . $this->pageId . '\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'arrow_refresh.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.refresh') . '" />';
324
+    }
325
+
326
+    /**
327
+     * Returns an icon to stop all processes
328
+     *
329
+     * @return string html tag for stop icon
330
+     */
331
+    protected function getStopIcon() {
332
+        return $this->getIcon('stop');
333
+    }
334
+
335
+    /**
336
+     * Returns a link for the panel to enable or disable the crawler
337
+     *
338
+     * @return string
339
+     */
340
+    protected function getEnableDisableLink() {
341
+        if ($this->getIsCrawlerEnabled()) {
342
+            return '<input onclick="window.location+=\'&action=stopCrawling\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'control_stop_blue.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.disablecrawling') . '" />';
343
+        } else {
344
+            return '<input onclick="window.location+=\'&action=resumeCrawling\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'control_play.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.enablecrawling') . '" />';
345
+        }
346
+    }
347
+
348
+    /**
349
+     * Get mode link
350
+     *
351
+     * @param void
352
+     * @return string a-tag
353
+     */
354
+    protected function getModeLink() {
355
+        if ($this->getMode() == 'detail') {
356
+            return '<input onclick="window.location+=\'&SET[processListMode]=simple\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'arrow_in.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.show.running') . '" />';
357
+        } elseif ($this->getMode() == 'simple') {
358
+            return '<input onclick="window.location+=\'&SET[processListMode]=detail\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'arrow_out.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.show.all') . '" />';
359
+        }
360
+    }
361
+
362
+    /**
363
+     * Get add link
364
+     *
365
+     * @param void
366
+     * @return string a-tag
367
+     */
368
+    protected function getAddLink() {
369
+        if ($this->getActiveProcessCount() < $this->getMaxActiveProcessCount() && $this->getIsCrawlerEnabled()) {
370
+            return '<input onclick="window.location+=\'&action=addProcess\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'add.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.process.add') . '" />';
371
+        } else {
372
+            return '';
373
+        }
374
+    }
375
+
376
+    /**
377
+     * Returns the icon to add new crawler processes
378
+     *
379
+     * @return string html tag for image to add new processes
380
+     */
381
+    protected function getAddIcon() {
382
+        return $this->getIcon('add');
383
+    }
384
+
385
+    /**
386
+     * Returns an imagetag for an icon
387
+     *
388
+     * @param string $icon
389
+     * @return string html tag for icon
390
+     */
391
+    protected function getIcon($icon, $title='') {
392
+        if (!empty($title)) {
393
+            $title = ' title="'.$title.'"';
394
+        }
395
+        return '<img src="'.$this->getIconPath().$icon.'.png" ' . $title . ' />';
396
+    }
397
+
398
+    /**
399
+     * Method to render the view.
400
+     *
401
+     * @return string html content
402
+     */
403
+    public function render() {
404
+        ob_start();
405
+        $this->template = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->template);
406
+        include($this->template);
407
+        $content = ob_get_contents();
408
+        ob_end_clean();
409
+        return $content;
410
+    }
411
+
412
+    /**
413
+     * retrieve locallanglabel from environment
414
+     * just a wrapper should be done in a cleaner way
415
+     * later on
416
+     *
417
+     * @param $label
418
+     * @return string
419
+     */
420
+    protected function getLLLabel($label) {
421
+        return $GLOBALS['LANG']->sL($label);
422
+    }
423 423
 }
424 424
 
425 425
 ?>
Please login to merge, or discard this patch.
Classes/Hooks/StaticFileCacheCreateUriHook.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
      * @param string $uri
54 54
      * @param TypoScriptFrontendController $frontend
55 55
      *
56
-     * @return array
56
+     * @return string[]
57 57
      *
58 58
      * @throws \Exception
59 59
      *
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,10 +66,10 @@
 block discarded – undo
66 66
         if ($this->isCrawlerExtensionRunning($frontend) && preg_match('#^/index.php\?&?id=(\d+)(&.*)?$#', $uri, $matches)) {
67 67
             $speakingUri = $frontend->cObj->typoLink_URL(array('parameter' => $matches[1], 'additionalParams' => $matches[2]));
68 68
             $speakingUriParts = parse_url($speakingUri);
69
-            if(false === $speakingUriParts){
70
-                throw new \Exception('Could not parse URI: ' . $speakingUri, 1289915976);
69
+            if (false === $speakingUriParts) {
70
+                throw new \Exception('Could not parse URI: '.$speakingUri, 1289915976);
71 71
             }
72
-            $speakingUrlPath = '/' . ltrim($speakingUriParts['path'], '/');
72
+            $speakingUrlPath = '/'.ltrim($speakingUriParts['path'], '/');
73 73
             // Don't change anything if speaking URL is part of old URI:
74 74
             // (it might be the case the using the speaking URL failed)
75 75
             if (strpos($uri, $speakingUrlPath) !== 0 || $speakingUrlPath === '/') {
Please login to merge, or discard this patch.
template/pagination.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php if (!defined('TYPO3_MODE')) die ('Access denied.'); ?>
2 2
 
3 3
 Page:
4
-<?php for($currentPageOffset 	= 0; $currentPageOffset < $this->getTotalPagesCount(); $currentPageOffset++ ){  ?>
4
+<?php for ($currentPageOffset = 0; $currentPageOffset < $this->getTotalPagesCount(); $currentPageOffset++) {  ?>
5 5
 	<a href="index.php?offset=<?php echo htmlspecialchars($currentPageOffset * $this->getPerPage()); ?>">
6 6
 		<?php echo	htmlspecialchars($this->getLabelForPageOffset($currentPageOffset)); ?>
7 7
 	</a>
8
-	<?php if($currentPageOffset+1 < $this->getTotalPagesCount()){ ?>
8
+	<?php if ($currentPageOffset + 1 < $this->getTotalPagesCount()) { ?>
9 9
 	|
10 10
 	<?php } ?>
11 11
 
Please login to merge, or discard this 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 3 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.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,17 +50,17 @@
 block discarded – undo
50 50
 		</tr>
51 51
 	</thead>
52 52
 	<tbody>
53
-		<?php foreach($this->getProcessCollection() as $process): /* @var $process tx_crawler_domain_process */ ?>
54
-			<tr class="<?php echo (++$count % 2 == 0) ? 'odd': 'even' ?>">
53
+		<?php foreach ($this->getProcessCollection() as $process): /* @var $process tx_crawler_domain_process */ ?>
54
+			<tr class="<?php echo (++$count % 2 == 0) ? 'odd' : 'even' ?>">
55 55
 				<td><?php echo $this->getIconForState(htmlspecialchars($process->getState())); ?></td>
56 56
 				<td><?php echo htmlspecialchars($process->getProcess_id()); ?></td>
57 57
 				<td><?php echo htmlspecialchars($this->asDate($process->getTimeForFirstItem())); ?></td>
58 58
 				<td><?php echo htmlspecialchars($this->asDate($process->getTimeForLastItem())); ?></td>
59
-				<td><?php echo htmlspecialchars(floor($process->getRuntime()/ 60)); ?> min. <?php echo htmlspecialchars($process->getRuntime()) % 60 ?> sec.</td>
59
+				<td><?php echo htmlspecialchars(floor($process->getRuntime() / 60)); ?> min. <?php echo htmlspecialchars($process->getRuntime()) % 60 ?> sec.</td>
60 60
 				<td><?php echo htmlspecialchars($this->asDate($process->getTTL())); ?></td>
61 61
 				<td><?php echo htmlspecialchars($process->countItemsProcessed()); ?></td>
62 62
 				<td><?php echo htmlspecialchars($process->countItemsAssigned()); ?></td>
63
-				<td><?php echo htmlspecialchars($process->countItemsToProcess()+$process->countItemsProcessed()); ?></td>
63
+				<td><?php echo htmlspecialchars($process->countItemsToProcess() + $process->countItemsProcessed()); ?></td>
64 64
 				<td>
65 65
 				<?php if ($process->getState() == 'running'): ?>
66 66
 					<div class="crawlerprocessprogress" style="width: 200px;">
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.
cli/crawler_cli.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('TYPO3_cliMode'))	die('You cannot run this script directly!');
2
+if (!defined('TYPO3_cliMode')) {
3
+    die('You cannot run this script directly!');
4
+}
3 5
 
4 6
 $crawlerObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_lib');
5 7
 
Please login to merge, or discard this patch.