* Fixed bug #12425: Give modfunc1 a better name
[Packages/TYPO3.CMS.git] / typo3 / sysext / linkvalidator / modfuncreport / class.tx_linkvalidator_modfuncreport.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2005 - 2010 Jochen Rieger (j.rieger@connecta.ag)
6 * (c) 2010 - 2011 Michael Miousse (michael.miousse@infoglobe.ca)
7 * All rights reserved
8 *
9 * This script is part of the TYPO3 project. The TYPO3 project is
10 * free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * The GNU General Public License can be found at
16 * http://www.gnu.org/copyleft/gpl.html.
17 *
18 * This script is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * This copyright notice MUST APPEAR in all copies of the script!
24 ***************************************************************/
25
26 /**
27 * Module 'Link Validator' for the 'linkvalidator' extension.
28 *
29 * @author Michael Miousse <michael.miousse@infoglobe.ca>
30 * @author Jochen Rieger <j.rieger@connecta.ag>
31 * @package TYPO3
32 * @subpackage linkvalidator
33 */
34 class tx_linkvalidator_modfuncreport extends t3lib_extobjbase {
35
36 /**
37 * @var template
38 */
39 public $doc;
40
41 /**
42 * @var string
43 */
44 protected $relativePath;
45
46 /**
47 * Information about the current page record.
48 *
49 * @var array
50 */
51 protected $pageRecord = array();
52
53 /**
54 * Information, if the module is accessible for the current user or not.
55 *
56 * @var boolean
57 */
58 protected $isAccessibleForCurrentUser = FALSE;
59
60 /**
61 * Depth for the recursivity of the link validation.
62 *
63 * @var integer
64 */
65 protected $search_level;
66
67 /**
68 * Link validation class.
69 *
70 * @var tx_linkvalidator_processing
71 */
72 protected $processing;
73
74 /**
75 * TSconfig of the current module.
76 *
77 * @var array
78 */
79 protected $modTS = array();
80
81 /**
82 * List of available link types to check defined in the TSconfig.
83 *
84 * @var array
85 */
86 protected $availableOptions = array();
87
88 /**
89 * List of link types currently chosen in the Statistics table.
90 * Used to show broken links of these types only.
91 *
92 * @var array
93 */
94 protected $checkOpt = array();
95
96 /**
97 * Hint message displayed on top of the module.
98 *
99 * @var string
100 */
101 protected $firstSteps;
102
103 /**
104 * Html for the button "Check Links".
105 *
106 * @var string
107 */
108 protected $updateListHtml;
109
110 /**
111 * Html for the button "Refresh Display".
112 *
113 * @var string
114 */
115 protected $refreshListHtml;
116
117 /**
118 * Html for the Statistics table with the checkboxes of the link types and the numbers of broken links.
119 *
120 * @var string
121 */
122 protected $checkOptHtml;
123
124 /**
125 * Complete content (html) to be displayed.
126 *
127 * @var string
128 */
129 protected $content;
130
131 /**
132 * Main method of modfuncreport
133 *
134 * @return string Module content
135 */
136 public function main() {
137 $GLOBALS['LANG']->includeLLFile('EXT:linkvalidator/modfuncreport/locallang.xml');
138
139 $this->search_level = t3lib_div::_GP('search_levels');
140
141 if (isset($this->pObj->id)) {
142 $this->modTS = t3lib_BEfunc::getModTSconfig($this->pObj->id, 'mod.linkvalidator');
143 $this->modTS = $this->modTS['properties'];
144 }
145
146 if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
147 foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $value) {
148 // Compile list of all available types. Used for checking with button "Check Links".
149 if (strpos($this->modTS['linktypes'], $linkType) !== FALSE) {
150 $this->availableOptions[$linkType] = 1;
151 }
152 // Compile list of types currently selected by the checkboxes.
153 if ($this->pObj->MOD_SETTINGS[$linkType]) {
154 $this->checkOpt[$linkType] = 1;
155 }
156 }
157 }
158
159 $this->initialize();
160
161 $this->firstSteps = $GLOBALS['LANG']->getLL('first.steps');
162
163 if ($this->modTS['showUpdateButton'] == 1) {
164 $this->firstSteps .= ' ' . $GLOBALS['LANG']->getLL('first.steps.info.update.button');
165 $this->updateListHtml = '<input type="submit" name="updateLinkList" value="' . $GLOBALS['LANG']->getLL('label_update') . '"/>';
166 }
167
168 if (t3lib_extMgm::isLoaded('scheduler')) {
169 if ($GLOBALS['BE_USER']->isAdmin()) {
170 $this->firstSteps .= ' ' .
171 sprintf($GLOBALS['LANG']->getLL('first.steps.info.scheduler'),
172 '<a href="' . t3lib_div::getIndpEnv('TYPO3_SITE_URL') . 'typo3/mod.php?M=tools_txschedulerM1">', '</a>'
173 );
174 } else {
175 $this->firstSteps .= ' ' . $GLOBALS['LANG']->getLL('first.steps.info.scheduler.admin');
176 }
177 }
178
179 $this->refreshListHtml = '<input type="submit" name="refreshLinkList" value="' . $GLOBALS['LANG']->getLL('label_refresh') . '"/>';
180
181 $this->processing = t3lib_div::makeInstance('tx_linkvalidator_processing');
182 $this->updateBrokenLinks();
183
184 $brokenLinkOverView = $this->processing->getLinkCounts($this->pObj->id);
185 $this->checkOptHtml = $this->getCheckOptions($brokenLinkOverView);
186
187 $this->render();
188
189
190 return $this->flush();
191 }
192
193
194 /**
195 * Initializes the menu array internally.
196 *
197 * @return array Module menu
198 */
199 public function modMenu() {
200 $modMenu = array (
201 'checkAllLink' => 0,
202 );
203
204 if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
205 foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $value) {
206 $modMenu[$linkType] = 1;
207 }
208 }
209
210 return $modMenu;
211 }
212
213
214 /**
215 * Initializes the Module.
216 *
217 * @return void
218 */
219 protected function initialize() {
220 if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
221 foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $classRef) {
222 $this->hookObjectsArr[$linkType] = &t3lib_div::getUserObj($classRef);
223 }
224 }
225
226 $this->doc = t3lib_div::makeInstance('template');
227 $this->doc->setModuleTemplate(t3lib_extMgm::extPath('linkvalidator') . 'modfuncreport/mod_template.html');
228 $this->doc->backPath = $GLOBALS['BACK_PATH'];
229
230 $this->relativePath = t3lib_extMgm::extRelPath('linkvalidator');
231 $this->pageRecord = t3lib_BEfunc::readPageAccess($this->pObj->id, $this->perms_clause);
232
233 $this->isAccessibleForCurrentUser = FALSE;
234 if ($this->pObj->id && is_array($this->pageRecord) || !$this->pObj->id && $this->isCurrentUserAdmin()) {
235 $this->isAccessibleForCurrentUser = TRUE;
236 }
237
238 $this->loadHeaderData();
239
240 // Don't access in workspace
241 if ($GLOBALS['BE_USER']->workspace !== 0) {
242 $this->isAccessibleForCurrentUser = FALSE;
243 }
244 }
245
246
247 /**
248 * Updates the table of stored broken links.
249 *
250 * @return void
251 */
252 protected function updateBrokenLinks() {
253 $searchFields = array();
254
255 // get the searchFields from TypoScript
256 foreach ($this->modTS['searchFields.'] as $table => $fieldList) {
257 $fields = t3lib_div::trimExplode(',', $fieldList);
258 foreach ($fields as $field) {
259 if (!$searchFields || !is_array($searchFields[$table]) || array_search($field, $searchFields[$table]) == FALSE) {
260 $searchFields[$table][] = $field;
261 }
262 }
263 }
264 // get children pages
265 $pageList = $this->processing->extGetTreeList(
266 $this->pObj->id,
267 $this->search_level,
268 0,
269 $GLOBALS['BE_USER']->getPagePermsClause(1)
270 );
271 $pageList .= $this->pObj->id;
272
273 $this->processing->init($searchFields, $pageList);
274
275 // check if button press
276 $update = t3lib_div::_GP('updateLinkList');
277
278 if (!empty($update)) {
279 $this->processing->getLinkStatistics($this->availableOptions, $this->modTS['checkhidden']);
280 }
281 }
282
283
284 /**
285 * Renders the content of the module.
286 *
287 * @return void
288 */
289 protected function render() {
290 if ($this->isAccessibleForCurrentUser) {
291 $this->content = $this->drawBrokenLinksTable();
292 } else {
293 // If no access or if ID == zero
294 $message = t3lib_div::makeInstance(
295 't3lib_FlashMessage',
296 $GLOBALS['LANG']->getLL('no.access'),
297 $GLOBALS['LANG']->getLL('no.access.title'),
298 t3lib_FlashMessage::ERROR
299 );
300 $this->content .= $message->render();
301 }
302 }
303
304
305 /**
306 * Flushes the rendered content to the browser.
307 *
308 * @return void
309 */
310 protected function flush() {
311 $content.= $this->doc->moduleBody(
312 $this->pageRecord,
313 $this->getDocHeaderButtons(),
314 $this->getTemplateMarkers()
315 );
316
317 return $content;
318 }
319
320
321 /**
322 * Builds the selector for the level of pages to search.
323 *
324 * @return string Html code of that selector
325 */
326 private function getLevelSelector() {
327 // Make level selector:
328 $opt = array();
329 $parts = array(
330 0 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_0'),
331 1 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_1'),
332 2 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_2'),
333 3 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_3'),
334 999 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_infi'),
335 );
336
337 foreach ($parts as $kv => $label) {
338 $opt[] = '<option value="' . $kv . '"' . ($kv == intval($this->search_level) ? ' selected="selected"' : '') . '>' . htmlspecialchars($label) . '</option>';
339 }
340 $lMenu = '<select name="search_levels">' . implode('', $opt) . '</select>';
341 return $lMenu;
342 }
343
344 /**
345 * Displays the table of broken links or a note if there were no broken links.
346 *
347 * @return html Content of the table or of the note
348 */
349 private function drawBrokenLinksTable() {
350 $content = '';
351 $items = array();
352 $brokenLinkItems = '';
353 $keyOpt = array();
354
355 if (is_array($this->checkOpt)) {
356 $keyOpt = array_keys($this->checkOpt);
357 }
358
359 $pageList = $this->processing->extGetTreeList(
360 $this->pObj->id,
361 $this->search_level,
362 0,
363 $GLOBALS['BE_USER']->getPagePermsClause(1)
364 );
365 $pageList .= $this->pObj->id;
366
367 if (($res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
368 '*',
369 'tx_linkvalidator_link',
370 'record_pid in (' . $pageList . ') and link_type in (\'' . implode("','", $keyOpt) . '\')',
371 '',
372 'record_uid ASC, uid ASC')
373 )) {
374 // Display table with broken links
375 if ($GLOBALS['TYPO3_DB']->sql_num_rows($res) > 0) {
376 $brokenLinksTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###BROKENLINKS_CONTENT###');
377
378 $brokenLinksItemTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###BROKENLINKS_ITEM###');
379
380 // Table header
381 $brokenLinksMarker = $this->startTable();
382
383 // Table rows containing the broken links
384 while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
385 $items[] = $this->drawTableRow($row['table_name'], $row, $brokenLinksItemTemplate);
386 }
387 $brokenLinkItems = implode(chr(10), $items);
388
389 // Display note that there are no broken links to display
390 } else {
391 $brokenLinksTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###NOBROKENLINKS_CONTENT###');
392
393 $brokenLinksMarker['LIST_HEADER'] = $this->doc->sectionHeader($GLOBALS['LANG']->getLL('list.header'));
394 $message = t3lib_div::makeInstance(
395 't3lib_FlashMessage',
396 $GLOBALS['LANG']->getLL('list.no.broken.links'),
397 $GLOBALS['LANG']->getLL('list.no.broken.links.title'),
398 t3lib_FlashMessage::OK
399 );
400 $brokenLinksMarker['NO_BROKEN_LINKS'] = $message->render();
401 }
402 }
403 $brokenLinksTemplate = t3lib_parsehtml::substituteMarkerArray($brokenLinksTemplate, $brokenLinksMarker, '###|###', TRUE);
404
405 $content = t3lib_parsehtml::substituteSubpart($brokenLinksTemplate, '###BROKENLINKS_ITEM', $brokenLinkItems);
406
407 return $content;
408 }
409
410
411
412 /**
413 * Displays the table header of the table with the broken links.
414 *
415 * @return string Code of content
416 */
417 private function startTable() {
418 global $TYPO3_CONF_VARS;
419
420 // Listing head
421 $makerTableHead = array();
422
423 $makerTableHead['tablehead_path'] = $GLOBALS['LANG']->getLL('list.tableHead.path');
424 $makerTableHead['tablehead_element'] = $GLOBALS['LANG']->getLL('list.tableHead.element');
425 $makerTableHead['tablehead_headlink'] = $GLOBALS['LANG']->getLL('list.tableHead.headlink');
426 $makerTableHead['tablehead_linktarget'] = $GLOBALS['LANG']->getLL('list.tableHead.linktarget');
427 $makerTableHead['tablehead_linkmessage'] = $GLOBALS['LANG']->getLL('list.tableHead.linkmessage');
428 $makerTableHead['tablehead_lastcheck'] = $GLOBALS['LANG']->getLL('list.tableHead.lastCheck');
429
430 // Add CSH to the header of each column
431 foreach($makerTableHead as $column => $label) {
432 $label = t3lib_BEfunc::wrapInHelp('linkvalidator', $column, $label);
433 $makerTableHead[$column] = $label;
434 }
435
436 // Add section header
437 $makerTableHead['list_header'] = $this->doc->sectionHeader($GLOBALS['LANG']->getLL('list.header'));
438
439 return $makerTableHead;
440 }
441
442
443 /**
444 * Displays one line of the broken links table.
445 *
446 * @param string $table Name of database table
447 * @param array $row Record row to be processed
448 * @param string $brokenLinksItemTemplate Markup of the template to be used
449 * @return string HTML of the rendered row
450 */
451 private function drawTableRow($table, array $row, $brokenLinksItemTemplate) {
452 $markerArray = array();
453 if (is_array($row) && !empty($row['link_type'])) {
454 if (($hookObj = $this->hookObjectsArr[$row['link_type']])) {
455 $brokenUrl = $hookObj->getBrokenUrl($row);
456 }
457 }
458
459 $params = '&edit[' . $table . '][' . $row['record_uid'] . ']=edit';
460 $actionLinks = '<a href="#" onclick="' .
461 t3lib_BEfunc::editOnClick(
462 $params,
463 $GLOBALS['BACK_PATH'],
464 t3lib_div::getIndpEnv('REQUEST_URI') . '?id=' . $this->pObj->id . '&search_levels=' . $this->search_level
465 ) . '"' .
466 ' title="' . $GLOBALS['LANG']->getLL('list.edit') . '">' .
467 t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>';
468
469 $elementHeadline = $row['headline'];
470 if (empty($elementHeadline)) {
471 $elementHeadline = '<i>' . $GLOBALS['LANG']->getLL('list.no.headline') . '</i>';
472 }
473
474 // Get the language label for the field from TCA
475 if ($GLOBALS['TCA'][$table]['columns'][$row['field']]['label']) {
476 $fieldName = $GLOBALS['TCA'][$table]['columns'][$row['field']]['label'];
477 $fieldName = $GLOBALS['LANG']->sL($fieldName);
478 // Crop colon from end if present.
479 if (substr($fieldName, '-1', '1') === ':') {
480 $fieldName = substr($fieldName, '0', strlen($fieldName)-1);
481 }
482 }
483 // Fallback, if there is no label
484 $fieldName = $fieldName ? $fieldName : $row['field'];
485
486 // column "Element"
487 $element = t3lib_iconWorks::getSpriteIconForRecord($table, $row, array('title' => $table . ':' . $row['record_uid']));
488 $element .= $elementHeadline;
489 $element .= ' ' . sprintf($GLOBALS['LANG']->getLL('list.field'), $fieldName);
490
491 $markerArray['actionlink'] = $actionLinks;
492 $markerArray['path'] = t3lib_BEfunc::getRecordPath($row['record_pid'], '', 0, 0);
493 $markerArray['element'] = $element;
494 $markerArray['headlink'] = $row['link_title'];
495 $markerArray['linktarget'] = $brokenUrl;
496
497 $response = unserialize($row['url_response']);
498 if ($response['valid']) {
499 $linkMessage = '<span style="color: green;">' . $GLOBALS['LANG']->getLL('list.msg.ok') . '</span>';
500 } else {
501 $linkMessage = '<span style="color: red;">' . $hookObj->getErrorMessage($response['errorParams']) . '</span>';
502 }
503 $markerArray['linkmessage'] = $linkMessage;
504
505 $lastRunDate = date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], $row['last_check']);
506 $lastRunTime = date($GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'], $row['last_check']);
507 $message = sprintf($GLOBALS['LANG']->getLL('list.msg.lastRun'), $lastRunDate, $lastRunTime);
508 $markerArray['lastcheck'] = $message;
509
510 // Return the table html code as string
511 return t3lib_parsehtml::substituteMarkerArray($brokenLinksItemTemplate, $markerArray, '###|###', TRUE, TRUE);
512 }
513
514
515 /**
516 * Builds the checkboxes out of the hooks array.
517 *
518 * @param array $brokenLinkOverView array of broken links information
519 * @return string code content
520 */
521 private function getCheckOptions(array $brokenLinkOverView) {
522 $content = '';
523 $checkOptionsTemplate = '';
524 $checkOptionsTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###CHECKOPTIONS_SECTION###');
525
526 $hookSectionContent = '';
527 $hookSectionTemplate = t3lib_parsehtml::getSubpart($checkOptionsTemplate, '###HOOK_SECTION###');
528
529 $markerArray['statistics_header'] = $this->doc->sectionHeader($GLOBALS['LANG']->getLL('overviews.statistics.header'));
530
531 $totalCountLabel = $GLOBALS['LANG']->getLL('overviews.nbtotal');
532 $totalCountLabel = t3lib_BEfunc::wrapInHelp('linkvalidator', 'checkboxes', $totalCountLabel);
533 $markerArray['total_count_label'] = $totalCountLabel;
534
535 if (empty($brokenLinkOverView['brokenlinkCount'])) {
536 $markerArray['total_count'] = '0';
537 } else {
538 $markerArray['total_count'] = $brokenLinkOverView['brokenlinkCount'];
539 }
540
541 $linktypes = t3lib_div::trimExplode(',', $this->modTS['linktypes'], 1);
542 $hookSectionContent = '';
543
544 if (is_array($linktypes)) {
545 if (!empty($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])
546 && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])
547 ) {
548 foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $type => $value) {
549 if (in_array($type, $linktypes)) {
550 $hookSectionMarker = array();
551 if (empty($brokenLinkOverView[$type])) {
552 $hookSectionMarker['count'] = '0';
553 } else {
554 $hookSectionMarker['count'] = $brokenLinkOverView[$type];
555 }
556 $translation = $GLOBALS['LANG']->getLL('hooks.' . $type);
557 $translation = $translation ? $translation : $type;
558 $option = t3lib_BEfunc::getFuncCheck(
559 array('id' => $this->pObj->id, 'search_levels' => $this->search_level),
560 'SET[' . $type . ']',
561 $this->pObj->MOD_SETTINGS[$type],
562 '',
563 '',
564 'id="SET[' . $type . ']"'
565 ) . '<label for="SET[' . $type . ']">' . $translation . '</label>';
566 $hookSectionMarker['option'] = $option;
567 $hookSectionContent .= t3lib_parsehtml::substituteMarkerArray($hookSectionTemplate, $hookSectionMarker, '###|###', TRUE, TRUE);
568 }
569 }
570 }
571 }
572
573 $checkOptionsTemplate = t3lib_parsehtml::substituteSubpart($checkOptionsTemplate, '###HOOK_SECTION###', $hookSectionContent);
574
575 return t3lib_parsehtml::substituteMarkerArray($checkOptionsTemplate, $markerArray, '###|###', TRUE, TRUE);
576 }
577
578
579 /**
580 * Loads data in the HTML head section (e.g. JavaScript or stylesheet information).
581 *
582 * @return void
583 */
584 private function loadHeaderData() {
585 $this->doc->addStyleSheet('linkvalidator', $this->relativePath . 'res/linkvalidator.css', 'linkvalidator');
586 }
587
588
589 /**
590 * Gets the buttons that shall be rendered in the docHeader.
591 *
592 * @return array Available buttons for the docHeader
593 */
594 private function getDocHeaderButtons() {
595 $buttons = array(
596 'csh' => t3lib_BEfunc::cshItem('_MOD_web_func', '', $GLOBALS['BACK_PATH']),
597 'shortcut' => $this->getShortcutButton(),
598 'save' => ''
599 );
600 return $buttons;
601 }
602
603
604 /**
605 * Gets the button to set a new shortcut in the backend (if current user is allowed to).
606 *
607 * @return string HTML representiation of the shortcut button
608 */
609 private function getShortcutButton() {
610 $result = '';
611 if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
612 $result = $this->doc->makeShortcutIcon('', 'function', $this->MCONF['name']);
613 }
614 return $result;
615 }
616
617
618 /**
619 * Gets the filled markers that are used in the HTML template.
620 *
621 * @return array The filled marker array
622 */
623 private function getTemplateMarkers() {
624
625 $markers = array(
626 'FIRST_STEPS' => $this->firstSteps,
627 'FUNC_MENU' => $this->getLevelSelector(),
628 'CONTENT' => $this->content,
629 'TITLE' => $GLOBALS['LANG']->getLL('title'),
630 'CHECKALLLINK' => $this->checkAllHtml,
631 'CHECKOPTIONS' => $this->checkOptHtml,
632 'ID' => '<input type="hidden" name="id" value="' . $this->pObj->id . '"/>',
633 'REFRESH' => $this->refreshListHtml,
634 'UPDATE' => $this->updateListHtml
635 );
636
637 return $markers;
638 }
639
640
641 /**
642 * Determines whether the current user is an admin.
643 *
644 * @return boolean Whether the current user is admin
645 */
646 private function isCurrentUserAdmin() {
647 return ((bool) $GLOBALS['BE_USER']->user['admin']);
648 }
649 }
650
651 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/modfuncreport/class.tx_linkvalidator_modfuncreport.php'])) {
652 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/modfuncreport/class.tx_linkvalidator_modfuncreport.php']);
653 }
654
655 ?>