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