[TASK] Reports module based on extbase
authorGeorg Ringer <mail@ringerge.org>
Tue, 31 Jul 2012 16:48:29 +0000 (18:48 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 13 Aug 2012 20:57:12 +0000 (22:57 +0200)
The reports module can be done with extbase

Change-Id: I6f40dca7d3d5dc84af0788a573f1caa669d773ec
Resolves: #39427
Releases: 6.0
Reviewed-on: http://review.typo3.org/13418
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
20 files changed:
typo3/sysext/reports/ChangeLog [deleted file]
typo3/sysext/reports/Classes/Controller/ReportController.php [new file with mode: 0644]
typo3/sysext/reports/Classes/ViewHelpers/ActionMenuItemViewHelper.php [new file with mode: 0644]
typo3/sysext/reports/Classes/ViewHelpers/IconViewHelper.php [new file with mode: 0644]
typo3/sysext/reports/Resources/Private/Language/locallang.xlf [new file with mode: 0644]
typo3/sysext/reports/Resources/Private/Layouts/Default.html [new file with mode: 0644]
typo3/sysext/reports/Resources/Private/Partials/Menu.html [new file with mode: 0644]
typo3/sysext/reports/Resources/Private/Templates/Report/Detail.html [new file with mode: 0644]
typo3/sysext/reports/Resources/Private/Templates/Report/Index.html [new file with mode: 0644]
typo3/sysext/reports/Resources/Public/moduleicon.gif [new file with mode: 0644]
typo3/sysext/reports/Resources/Public/styles.css [new file with mode: 0644]
typo3/sysext/reports/ext_autoload.php
typo3/sysext/reports/ext_tables.php
typo3/sysext/reports/mod/conf.php [deleted file]
typo3/sysext/reports/mod/index.php [deleted file]
typo3/sysext/reports/mod/locallang.xlf [deleted file]
typo3/sysext/reports/mod/mod_styles.css [deleted file]
typo3/sysext/reports/mod/mod_template.html [deleted file]
typo3/sysext/reports/mod/moduleicon.gif [deleted file]
typo3/sysext/sv/reports/class.tx_sv_reports_serviceslist.php

diff --git a/typo3/sysext/reports/ChangeLog b/typo3/sysext/reports/ChangeLog
deleted file mode 100644 (file)
index fbfcc07..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-2011-01-22  Ingo Renner  <ingo@typo3.org>
-
-       * Changed version to 1.1.0
-
-2011-01-21  Ingo Renner  <ingo@typo3.org>
-
-       * Fixed issues #17188: change status update task to use the new default From email address setting from config_default
-
-2011-01-18  Ingo Renner  <ingo@typo3.org>
-
-       * Added feature #17101: Warning in reports module for enabled PHP safe_mode, credits Christian Kuhn
-
-2011-01-17  Ingo Renner  <ingo@typo3.org>
-
-       * Added feature #17033: Notification Emails for system status updates
-       * Fixed issue #17082: XSS in reports scheduler job
-
-2011-01-13  Ingo Renner  <ingo@typo3.org>
-
-       * Fixed issue #17012: Use javascript goToModule() function in the warning message
-
-2010-11-14  Ingo Renner  <ingo@typo3.org>
-
-       * Changed the overview menu to use the core t3-overview-list CSS class for styling
-
-2010-11-13  Ingo Renner  <ingo@typo3.org>
-
-       * Fixed some minor style issues caused by Ext Js' style reset definitions
-
-2010-11-12  Ingo Renner  <ingo@typo3.org>
-
-       * Added feature #16337: System health status self monitoring
-       * Added feature #16338: Scheduler task to regularly execute the status report checks
-
-2009-09-18  Ingo Renner  <ingo@typo3.org>
-
-       * Integration of the reports module as a system extension
diff --git a/typo3/sysext/reports/Classes/Controller/ReportController.php b/typo3/sysext/reports/Classes/Controller/ReportController.php
new file mode 100644 (file)
index 0000000..41515e5
--- /dev/null
@@ -0,0 +1,127 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Georg Ringer <typo3@ringerge.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Reports controller
+ *
+ * @package TYPO3
+ * @subpackage tx_reports
+ */
+class Tx_Reports_Controller_ReportController extends Tx_Extbase_MVC_Controller_ActionController {
+
+
+       /**
+        * Redirect to the saved report
+        *
+        * @return void
+        */
+       public function initializeAction() {
+               $vars = t3lib_div::_GET('tx_reports_tools_reportstxreportsm1');
+
+               if (!isset($vars['redirect']) && $vars['action'] !== 'index' && !isset($vars['extension']) && is_array($GLOBALS['BE_USER']->uc['reports']['selection'])) {
+                       $previousSelection = $GLOBALS['BE_USER']->uc['reports']['selection'];
+                       if (!empty($previousSelection['extension']) && !empty($previousSelection['report'])) {
+                               $this->redirect('detail', 'Report', NULL, array('extension' => $previousSelection['extension'], 'report' => $previousSelection['report'], 'redirect' => 1));
+                       } else {
+                               $this->redirect('index');
+                       }
+               }
+       }
+
+       /**
+        * Overview
+        *
+        * @return void
+        */
+       public function indexAction() {
+               $this->view->assignMultiple(array(
+                       'reports' => $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'],
+                       'menu' => $this->getMenu()
+               ));
+               $this->saveState();
+       }
+
+       /**
+        * Display a single report
+        *
+        * @param string $extension Extension
+        * @param string $report Report
+        * @return void
+        */
+       public function detailAction($extension, $report) {
+               $content = $error = '';
+               $reportClass = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'][$extension][$report]['report'];
+
+               $reportInstance = t3lib_div::makeInstance($reportClass, $this);
+
+               if ($reportInstance instanceof tx_reports_Report) {
+                       $content = $reportInstance->getReport();
+                       $this->saveState($extension, $report);
+               } else {
+                       $error = $reportClass . ' does not implement the Report Interface which is necessary to be displayed here.';
+               }
+
+               $this->view->assignMultiple(array(
+                       'content' => $content,
+                       'error' => $error,
+                       'report' => $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'][$extension][$report],
+                       'menu' => $this->getMenu()
+               ));
+       }
+
+       /**
+        * Generate the menu
+        *
+        * @return array Menu items
+        */
+       protected function getMenu() {
+               $reportsMenuItems = array();
+
+               foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'] as $extKey => $reports) {
+                       foreach ($reports as $reportName => $report) {
+                               $reportsMenuItems[] = array(
+                                       'title' => $GLOBALS['LANG']->sL($report['title']),
+                                       'extension' => $extKey,
+                                       'report' => $reportName
+                               );
+                       }
+               }
+               return $reportsMenuItems;
+       }
+
+       /**
+        * Save the selected report
+        *
+        * @param string $extension Extension name
+        * @param string $report Report name
+        * @return void
+        */
+       protected function saveState($extension = '', $report = '') {
+               $GLOBALS['BE_USER']->uc['reports']['selection'] = array('extension' => $extension, 'report' => $report);
+               $GLOBALS['BE_USER']->writeUC();
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/reports/Classes/ViewHelpers/ActionMenuItemViewHelper.php b/typo3/sysext/reports/Classes/ViewHelpers/ActionMenuItemViewHelper.php
new file mode 100644 (file)
index 0000000..e475ad2
--- /dev/null
@@ -0,0 +1,71 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Georg Ringer <typo3@ringerge.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Render an item of the menu
+ *
+ * @package TYPO3
+ * @subpackage tx_reports
+ */
+class Tx_Reports_ViewHelpers_ActionMenuItemViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractTagBasedViewHelper {
+
+       /**
+        * @var string
+        */
+       protected $tagName = 'option';
+
+       /**
+        * Renders an ActionMenu option tag
+        *
+        * @param string $label label of the option tag
+        * @param string $controller controller to be associated with this ActionMenuItem
+        * @param string $action the action to be associated with this ActionMenuItem
+        * @param array $arguments additional controller arguments to be passed to the action when this ActionMenuItem is selected
+        * @return string the rendered option tag
+        * @see Tx_Fluid_ViewHelpers_Be_Menus_ActionMenuViewHelper
+        */
+       public function render($label, $controller, $action, array $arguments = array()) {
+               $uriBuilder = $this->controllerContext->getUriBuilder();
+               $uri = $uriBuilder
+                       ->reset()
+                       ->uriFor($action, $arguments, $controller);
+               $this->tag->addAttribute('value', $uri);
+
+               $currentRequest = $this->controllerContext->getRequest();
+               $currentController = $currentRequest->getControllerName();
+               $currentAction = $currentRequest->getControllerActionName();
+               $currentArguments = $currentRequest->getArguments();
+
+               unset($currentArguments['action']);
+               unset($currentArguments['controller']);
+               if ($action === $currentAction && $controller === $currentController && $currentArguments === $arguments) {
+                       $this->tag->addAttribute('selected', 'selected');
+               }
+
+               $this->tag->setContent($label);
+
+               return $this->tag->render();
+       }
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/reports/Classes/ViewHelpers/IconViewHelper.php b/typo3/sysext/reports/Classes/ViewHelpers/IconViewHelper.php
new file mode 100644 (file)
index 0000000..4eb1d19
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Georg Ringer <typo3@ringerge.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Render the icon of a report
+ *
+ * @package TYPO3
+ * @subpackage tx_reports
+ */
+class Tx_Reports_ViewHelpers_IconViewHelper extends Tx_Fluid_ViewHelpers_Be_AbstractBackendViewHelper {
+
+       /**
+        * Renders the icon
+        *
+        * @param string $icon Icon to be used
+        * @param string $title Optional title
+        * @return strin Content rendered image
+        */
+       public function render($icon, $title = '') {
+               if (!empty($icon)) {
+                       $absIconPath = t3lib_div::getFileAbsFilename($icon);
+
+                       if (file_exists($absIconPath)) {
+                               $icon = $GLOBALS['BACK_PATH'] . '../' . str_replace(PATH_site, '', $absIconPath);
+                       }
+               } else {
+                       $icon = t3lib_extMgm::extRelPath('reports') . 'Resources/Public/moduleicon.gif';
+               }
+
+               $content = '<img' . t3lib_iconworks::skinImg($GLOBALS['BACK_PATH'], $icon, 'width="16" height="16"') .
+                       ' title="' . htmlspecialchars($title) . '" alt="' . htmlspecialchars($title) . '" />';
+
+               return $content;
+       }
+
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/reports/Resources/Private/Language/locallang.xlf b/typo3/sysext/reports/Resources/Private/Language/locallang.xlf
new file mode 100644 (file)
index 0000000..12f5a8d
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xliff version="1.0">
+       <file source-language="en" datatype="plaintext" original="messages" date="2011-10-17T20:22:35Z" product-name="reports">
+               <header/>
+               <body>
+                       <trans-unit id="mlang_tabs_tab" xml:space="preserve">
+                               <source>Reports</source>
+                       </trans-unit>
+                       <trans-unit id="mlang_labels_tabdescr" xml:space="preserve">
+                               <source>A collection of several system reports.</source>
+                       </trans-unit>
+                       <trans-unit id="mlang_labels_tablabel" xml:space="preserve">
+                               <source>System Reports</source>
+                       </trans-unit>
+                       <trans-unit id="title" xml:space="preserve">
+                               <source>Reports</source>
+                       </trans-unit>
+                       <trans-unit id="reports_overview" xml:space="preserve">
+                               <source>Overview</source>
+                       </trans-unit>
+                       <trans-unit id="choose_report" xml:space="preserve">
+                               <source>Report:</source>
+                       </trans-unit>
+               </body>
+       </file>
+</xliff>
diff --git a/typo3/sysext/reports/Resources/Private/Layouts/Default.html b/typo3/sysext/reports/Resources/Private/Layouts/Default.html
new file mode 100644 (file)
index 0000000..023870f
--- /dev/null
@@ -0,0 +1,27 @@
+<f:be.container addCssFile="{f:uri.resource(path:'styles.css')}">
+       <div class="typo3-fullDoc" id="ext-reports-mod-index-php">
+               <div id="typo3-docheader">
+                       <div class="typo3-docheader-functions">
+                               <div class="left">
+                                       <f:render section="iconButtons" />
+                               </div>
+                               <div class="right">
+                               </div>
+                       </div>
+                       <div class="typo3-docheader-buttons">
+                               <div class="left">
+                               </div>
+                               <div class="right">
+                                       <f:be.buttons.shortcut />
+                               </div>
+                       </div>
+               </div>
+               <div id="typo3-docbody">
+                       <div id="typo3-inner-docbody">
+                               <f:flashMessages class="tx-extbase-flash-message" />
+
+                               <f:render section="content" />
+                       </div>
+               </div>
+       </div>
+</f:be.container>
\ No newline at end of file
diff --git a/typo3/sysext/reports/Resources/Private/Partials/Menu.html b/typo3/sysext/reports/Resources/Private/Partials/Menu.html
new file mode 100644 (file)
index 0000000..10252bf
--- /dev/null
@@ -0,0 +1,8 @@
+{namespace r=Tx_Reports_ViewHelpers}
+
+<f:be.menus.actionMenu>
+       <f:be.menus.actionMenuItem label="{f:translate(key:'reports_overview')}" controller="Report" action="index" />
+       <f:for each="{menu}" as="item">
+               <r:actionMenuItem label="{item.title}" controller="Report" action="detail" arguments="{extension:item.extension,report:item.report}" />
+       </f:for>
+</f:be.menus.actionMenu>
\ No newline at end of file
diff --git a/typo3/sysext/reports/Resources/Private/Templates/Report/Detail.html b/typo3/sysext/reports/Resources/Private/Templates/Report/Detail.html
new file mode 100644 (file)
index 0000000..d119944
--- /dev/null
@@ -0,0 +1,20 @@
+{namespace r=Tx_Reports_ViewHelpers}
+
+<f:layout name="Default" />
+
+<f:section name="iconButtons">
+       <f:render partial="Menu" arguments="{menu:menu}" />
+</f:section>
+
+<f:section name="content">
+       <h2><f:translate key="title" /></h2>
+       <f:if condition="{error}">
+               <f:then>
+                       {error}
+               </f:then>
+               <f:else>
+                       <h3 class="uppercase"><f:translate key="{report.title}" /></h3>
+                       <f:format.html parseFuncTSPath="">{content}</f:format.html>
+               </f:else>
+       </f:if>
+</f:section>
\ No newline at end of file
diff --git a/typo3/sysext/reports/Resources/Private/Templates/Report/Index.html b/typo3/sysext/reports/Resources/Private/Templates/Report/Index.html
new file mode 100644 (file)
index 0000000..712a56d
--- /dev/null
@@ -0,0 +1,27 @@
+{namespace r=Tx_Reports_ViewHelpers}
+
+<f:layout name="Default" />
+
+<f:section name="iconButtons">
+       <f:render partial="Menu" arguments="{menu:menu}" />
+</f:section>
+
+<f:section name="content">
+       <h2><f:translate key="title" /></h2>
+
+       <h3 class="uppercase"><f:translate key="reports_overview" /></h3>
+
+       <dl class="t3-overview-list">
+               <f:for each="{reports}" as="reportOverview" key="extensionKey">
+                       <f:for each="{reportOverview}" key="reportName" as="report">
+                               <dt>
+                                       <f:link.action action="detail" arguments="{extension:extensionKey,report:reportName}">
+                                               <r:icon icon="{report.icon}" title="{f:translate(key:report.title)}" />
+                                               <f:translate key="{report.title}" />
+                                       </f:link.action>
+                               </dt>
+                               <dd><f:translate key="{report.description}" /></dd>
+                       </f:for>
+               </f:for>
+       </dl>
+</f:section>
\ No newline at end of file
diff --git a/typo3/sysext/reports/Resources/Public/moduleicon.gif b/typo3/sysext/reports/Resources/Public/moduleicon.gif
new file mode 100644 (file)
index 0000000..04abfd4
Binary files /dev/null and b/typo3/sysext/reports/Resources/Public/moduleicon.gif differ
diff --git a/typo3/sysext/reports/Resources/Public/styles.css b/typo3/sysext/reports/Resources/Public/styles.css
new file mode 100644 (file)
index 0000000..b93ef76
--- /dev/null
@@ -0,0 +1,58 @@
+body#ext-reports-mod-index-php {
+       margin: 0px;
+}
+
+#typo3-inner-docbody p.help {
+       margin-bottom: 10px;
+}
+
+
+/* ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- */
+/* status report */
+
+#ext-reports-mod-index-php h2.section-header {
+       margin: 15px 0 10px 0;
+       padding: 2px 0 0 20px;
+       cursor: pointer;
+       clear: left;
+}
+#ext-reports-mod-index-php h2.collapsed {
+       background-image:url(../../../../gfx/arrowright.png);
+       background-repeat:no-repeat;
+}
+#ext-reports-mod-index-php h2.expanded {
+       background-image:url(../../../../gfx/arrowdown.png);
+       background-repeat:no-repeat;
+}
+#ext-reports-mod-index-php h2.section-header img {
+       margin-right:2px;
+       vertical-align:bottom;
+}
+
+#ext-reports-mod-index-php .message-body {
+       clear: left;
+}
+
+#ext-reports-mod-index-php .message-body p {
+       padding: 5px 0;
+}
+
+#ext-reports-mod-index-php .message-body ul {
+       padding-top: 5px;
+       list-style: disc;
+}
+
+#ext-reports-mod-index-php .message-body ol {
+       padding-top: 5px;
+       list-style: decimal;
+}
+
+#ext-reports-mod-index-php .message-left {
+       float: left;
+       width: 400px;
+}
+
+#ext-reports-mod-index-php .message-right {
+       float: left;
+}
+
index a213e6e..a2acf53 100644 (file)
@@ -6,7 +6,6 @@ $extensionPath = t3lib_extMgm::extPath('reports');
 return array(
        'tx_reports_statusprovider' => $extensionPath . 'interfaces/interface.tx_reports_statusprovider.php',
        'tx_reports_report' => $extensionPath . 'interfaces/interface.tx_reports_report.php',
-       'tx_reports_module' => $extensionPath . 'mod/index.php',
        'tx_reports_reports_status' => $extensionPath . 'reports/class.tx_reports_reports_status.php',
        'tx_reports_reports_status_typo3status' => $extensionPath . 'reports/status/class.tx_reports_reports_status_typo3status.php',
        'tx_reports_reports_status_systemstatus' => $extensionPath . 'reports/status/class.tx_reports_reports_status_systemstatus.php',
index 8f7c967..cd6a5f7 100644 (file)
@@ -3,9 +3,22 @@ if (!defined('TYPO3_MODE')) {
        die('Access denied.');
 }
 
-if (TYPO3_MODE == 'BE') {
-       t3lib_extMgm::addModulePath('tools_txreportsM1', t3lib_extMgm::extPath($_EXTKEY) . 'mod/');
-       t3lib_extMgm::addModule('tools', 'txreportsM1', '', t3lib_extMgm::extPath($_EXTKEY) . 'mod/');
+if (TYPO3_MODE === 'BE') {
+
+       Tx_Extbase_Utility_Extension::registerModule(
+               $_EXTKEY,
+               'tools',
+               'txreportsM1',
+               '',
+               array(
+                       'Report' => 'index,detail',
+               ),
+               array(
+                       'access' => 'admin',
+                       'icon'   => 'EXT:' . $_EXTKEY . '/Resources/Public/moduleicon.gif',
+                       'labels' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang.xlf',
+               )
+       );
 
        $statusReport = array(
                'title'       => 'LLL:EXT:reports/reports/locallang.xml:status_report_title',
diff --git a/typo3/sysext/reports/mod/conf.php b/typo3/sysext/reports/mod/conf.php
deleted file mode 100644 (file)
index 1b1504f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-
-       // DO NOT REMOVE OR CHANGE THESE 2 LINES:
-$MCONF['name'] = 'tools_txreportsM1';
-$MCONF['script'] = '_DISPATCH';
-
-$MCONF['access'] = 'admin';
-
-$MLANG['default']['tabs_images']['tab'] = 'moduleicon.gif';
-$MLANG['default']['ll_ref'] = 'LLL:EXT:reports/mod/locallang.xml';
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/reports/mod/index.php b/typo3/sysext/reports/mod/index.php
deleted file mode 100644 (file)
index a37575c..0000000
+++ /dev/null
@@ -1,267 +0,0 @@
-<?php
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2009-2011 Ingo Renner <ingo@typo3.org>
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-$LANG->includeLLFile('EXT:reports/mod/locallang.xml');
-       // This checks permissions and exits if the users has no permission for entry.
-$BE_USER->modAccess($MCONF, 1);
-
-/**
- * Module 'Reports' for the 'reports' extension.
- *
- * @author Ingo Renner <ingo@typo3.org>
- * @package TYPO3
- * @subpackage tx_reports
- */
-class tx_reports_Module extends t3lib_SCbase {
-
-       protected $pageinfo;
-
-       /**
-        * Initializes the Module
-        *
-        * @return void
-        */
-       public function __construct() {
-               parent::init();
-
-                       // Initialize document
-               $this->doc = t3lib_div::makeInstance('template');
-               $this->doc->setModuleTemplate(
-                       t3lib_extMgm::extPath('reports') . 'mod/mod_template.html'
-               );
-               $this->doc->backPath = $GLOBALS['BACK_PATH'];
-               $this->doc->addStyleSheet(
-                       'tx_reports',
-                       '../' . t3lib_extMgm::siteRelPath('reports') . 'mod/mod_styles.css'
-               );
-       }
-
-       /**
-        * Adds items to the ->MOD_MENU array. Used for the function menu selector.
-        *
-        * @return void
-        */
-       public function menuConfig() {
-               $reportsMenuItems = array();
-               $this->MOD_MENU = array('function' => array());
-
-               foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'] as $extKey => $reports) {
-                       foreach ($reports as $reportName => $report) {
-                               $reportsMenuItems[$extKey . '.' . $reportName] = $GLOBALS['LANG']->sL($report['title']);
-                       }
-               }
-
-               asort($reportsMenuItems);
-               $reportsMenuItems = array_merge(
-                       array('index' => $GLOBALS['LANG']->getLL('reports_overview')),
-                       $reportsMenuItems
-               );
-
-               foreach ($reportsMenuItems as $key => $title) {
-                       $this->MOD_MENU['function'][$key] = $title;
-               }
-
-               parent::menuConfig();
-       }
-
-       /**
-        * Creates the module's content. In this case it rather acts as a kind of #
-        * dispatcher redirecting requests to specific reports.
-        *
-        * @return void
-        */
-       public function main() {
-               $docHeaderButtons = $this->getButtons();
-
-                       // Access check!
-                       // The page will show only if user has admin rights
-               if ($GLOBALS['BE_USER']->user['admin']) {
-
-                               // Draw the form
-                       $this->doc->form = '<form action="" method="post" enctype="multipart/form-data">';
-                               // JavaScript
-                       $this->doc->JScodeArray[] = '
-                               script_ended = 0;
-                               function jumpToUrl(URL) {
-                                       document.location = URL;
-                               }
-                       ';
-                       $this->doc->postCode='
-                               <script language="javascript" type="text/javascript">
-                                       script_ended = 1;
-                                       if (top.fsMod) {
-                                               top.fsMod.recentIds["web"] = 0;
-                                       }
-                               </script>
-                       ';
-                               // Render content:
-                       $this->renderModuleContent();
-               } else {
-                               // If no access or if ID == 0
-                       $docHeaderButtons['save'] = '';
-                       $this->content .= $this->doc->spacer(10);
-               }
-
-                       // compile document
-               $markers['FUNC_MENU'] = t3lib_BEfunc::getFuncMenu(
-                               0,
-                               'SET[function]',
-                               $this->MOD_SETTINGS['function'],
-                               $this->MOD_MENU['function']
-                       );
-               $markers['CONTENT'] = $this->content;
-
-                       // Build the <body> for the module
-
-               $this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
-
-                       // Renders the module page
-               $this->content = $this->doc->render(
-                       '',
-                       $this->content
-               );
-       }
-
-       /**
-        * Prints out the module's HTML
-        *
-        * @return void
-        */
-       public function printContent() {
-               echo $this->content;
-       }
-
-       /**
-        * Generates the module content by calling the selected report
-        *
-        * @return void
-        */
-       protected function renderModuleContent() {
-               $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));
-
-               $action  = (string) $this->MOD_SETTINGS['function'];
-               $title   = '';
-               $content = '';
-
-               if ($action == 'index') {
-                       $content .= $this->indexAction();
-                       $title = $GLOBALS['LANG']->getLL('reports_overview');
-               } else {
-                       list($extensionKey, $reportName) = explode('.', $action, 2);
-
-                       $reportClass = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'][$extensionKey][$reportName]['report'];
-                       $title = $GLOBALS['LANG']->sL($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'][$extensionKey][$reportName]['title']);
-
-                       $reportInstance = t3lib_div::makeInstance($reportClass, $this);
-
-                       if ($reportInstance instanceof tx_reports_Report) {
-                               $content .= $reportInstance->getReport();
-                       } else {
-                               $content .= $reportClass . ' does not implement the Report Interface which is necessary to be displayed here.';
-                       }
-               }
-
-               $this->content .= $this->doc->section($title, $content, FALSE, TRUE);
-       }
-
-       /**
-        * Shows an overview list of available reports.
-        *
-        * @return string List of available reports
-        */
-       protected function indexAction() {
-               $defaultIcon = t3lib_extMgm::extRelPath('reports') . 'mod/moduleicon.gif';
-               $content = '<dl class="t3-overview-list">';
-               $reports = array();
-
-               foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'] as $extKey => $extensionReports) {
-                       foreach ($extensionReports as $reportName => $report) {
-                               $action = $extKey . '.' . $reportName;
-                               $link = 'mod.php?M=tools_txreportsM1' . htmlspecialchars('&SET[function]=') . $action;
-
-                               $reportTitle = $GLOBALS['LANG']->sL($report['title']);
-
-                                       // Set default report icon
-                               $icon = $defaultIcon;
-                                       // Check for custom icon
-                               if (!empty($report['icon'])) {
-                                       $absIconPath = t3lib_div::getFileAbsFilename($report['icon']);
-                                               // If the file indeed exists, assemble relative path to it
-                                       if (file_exists($absIconPath)) {
-                                               $icon = $GLOBALS['BACK_PATH'] . '../' . str_replace(PATH_site, '', $absIconPath);
-                                       }
-                               }
-                               $icon = '<img' . t3lib_iconworks::skinImg($GLOBALS['BACK_PATH'], $icon, 'width="16" height="16"') . ' title="' . $reportTitle . '" alt="' . $reportTitle . '" />';
-                               $reportContent  = '<dt><a href="' . $link . '">' . $icon . $reportTitle . '</a></dt>';
-                               $reportContent .= '<dd>' . $GLOBALS['LANG']->sL($report['description']) . '</dd>';
-
-                               $reports[$reportTitle] = $reportContent;
-                       }
-               }
-
-               ksort($reports);
-
-               foreach ($reports as $reportContent) {
-                       $content .= $reportContent;
-               }
-
-               return $content . '</dl>';
-       }
-
-       /**
-        * Create the panel of buttons for submitting the form or otherwise
-        * perform operations.
-        *
-        * @return array All available buttons as an assoc. array
-        */
-       protected function getButtons() {
-               $buttons = array(
-                       'csh' => '',
-                       'shortcut' => '',
-                       'save' => ''
-               );
-                       // CSH
-               $buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_web_func', '', $GLOBALS['BACK_PATH']);
-
-                       // Shortcut
-               if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
-                       $buttons['shortcut'] = $this->doc->makeShortcutIcon('', 'function', $this->MCONF['name']);
-               }
-
-               return $buttons;
-       }
-}
-
-       // Make instance:
-$SOBE = t3lib_div::makeInstance('tx_reports_Module');
-
-// Include files?
-foreach($SOBE->include_once as $INC_FILE) {
-       include_once($INC_FILE);
-}
-
-$SOBE->main();
-$SOBE->printContent();
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/reports/mod/locallang.xlf b/typo3/sysext/reports/mod/locallang.xlf
deleted file mode 100644 (file)
index 12f5a8d..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xliff version="1.0">
-       <file source-language="en" datatype="plaintext" original="messages" date="2011-10-17T20:22:35Z" product-name="reports">
-               <header/>
-               <body>
-                       <trans-unit id="mlang_tabs_tab" xml:space="preserve">
-                               <source>Reports</source>
-                       </trans-unit>
-                       <trans-unit id="mlang_labels_tabdescr" xml:space="preserve">
-                               <source>A collection of several system reports.</source>
-                       </trans-unit>
-                       <trans-unit id="mlang_labels_tablabel" xml:space="preserve">
-                               <source>System Reports</source>
-                       </trans-unit>
-                       <trans-unit id="title" xml:space="preserve">
-                               <source>Reports</source>
-                       </trans-unit>
-                       <trans-unit id="reports_overview" xml:space="preserve">
-                               <source>Overview</source>
-                       </trans-unit>
-                       <trans-unit id="choose_report" xml:space="preserve">
-                               <source>Report:</source>
-                       </trans-unit>
-               </body>
-       </file>
-</xliff>
diff --git a/typo3/sysext/reports/mod/mod_styles.css b/typo3/sysext/reports/mod/mod_styles.css
deleted file mode 100644 (file)
index 9d38d4e..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-body#ext-reports-mod-index-php {
-       margin: 0px;
-}
-
-#typo3-inner-docbody p.help {
-       margin-bottom: 10px;
-}
-
-
-/* ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- */
-/* status report */
-
-#ext-reports-mod-index-php h2.section-header {
-       margin: 15px 0 10px 0;
-       padding: 2px 0 0 20px;
-       cursor: pointer;
-       clear: left;
-}
-#ext-reports-mod-index-php h2.collapsed {
-       background-image:url(../../../gfx/arrowright.png);
-       background-repeat:no-repeat;
-}
-#ext-reports-mod-index-php h2.expanded {
-       background-image:url(../../../gfx/arrowdown.png);
-       background-repeat:no-repeat;
-}
-#ext-reports-mod-index-php h2.section-header img {
-       margin-right:2px;
-       vertical-align:bottom;
-}
-
-#ext-reports-mod-index-php .message-body {
-       clear: left;
-}
-
-#ext-reports-mod-index-php .message-body p {
-       padding: 5px 0;
-}
-
-#ext-reports-mod-index-php .message-body ul {
-       padding-top: 5px;
-       list-style: disc;
-}
-
-#ext-reports-mod-index-php .message-body ol {
-       padding-top: 5px;
-       list-style: decimal;
-}
-
-#ext-reports-mod-index-php .message-left {
-       float: left;
-       width: 400px;
-}
-
-#ext-reports-mod-index-php .message-right {
-       float: left;
-}
-
diff --git a/typo3/sysext/reports/mod/mod_template.html b/typo3/sysext/reports/mod/mod_template.html
deleted file mode 100644 (file)
index 828b149..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<!-- ###FULLDOC### begin -->
-<div class="typo3-fullDoc">
-       <div id="typo3-docheader">
-               <div class="typo3-docheader-functions">
-                       <div class="left">###FUNC_MENU###</div>
-                       <div class="right"></div>
-               </div>
-               <div class="typo3-docheader-buttons">
-                       <div class="left">###BUTTONLIST_LEFT###</div>
-                       <div class="right">###BUTTONLIST_RIGHT###</div>
-               </div>
-       </div>
-
-       <div id="typo3-docbody">
-               <div id="typo3-inner-docbody">
-                       ###CONTENT###
-               </div>
-       </div>
-</div>
-<!-- ###FULLDOC### end -->
-
-<!-- Grouping the icons on top -->
-
-<!-- ###BUTTON_GROUP_WRAP### -->
-<div class="buttongroup">###BUTTONS###</div>
-<!-- ###BUTTON_GROUP_WRAP### -->
-
-<!-- ###BUTTON_GROUPS_LEFT### -->
-
-<!-- ###BUTTON_GROUPS_LEFT### -->
-
-<!-- ###BUTTON_GROUPS_RIGHT### -->
-<!-- ###BUTTON_GROUP1### -->###SHORTCUT###<!-- ###BUTTON_GROUP1### -->
-<!-- ###BUTTON_GROUPS_RIGHT### -->
\ No newline at end of file
diff --git a/typo3/sysext/reports/mod/moduleicon.gif b/typo3/sysext/reports/mod/moduleicon.gif
deleted file mode 100644 (file)
index 04abfd4..0000000
Binary files a/typo3/sysext/reports/mod/moduleicon.gif and /dev/null differ
index 119b48a..8667637 100644 (file)
@@ -1,26 +1,26 @@
 <?php
 /***************************************************************
-*  Copyright notice
-*
-*  (c) 2009-2011 Francois Suter <francois@typo3.org>
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
+ *  Copyright notice
+ *
+ *  (c) 2009-2011 Francois Suter <francois@typo3.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
 
 /**
  * This class provides a report displaying a list of all installed services
@@ -35,7 +35,7 @@ class tx_sv_reports_ServicesList implements tx_reports_Report {
        /**
         * Back-reference to the calling reports module
         *
-        * @var tx_reports_Module
+        * @var Tx_Reports_Controller_ReportController
         */
        protected $reportsModule;
 
@@ -44,7 +44,7 @@ class tx_sv_reports_ServicesList implements tx_reports_Report {
         *
         * @param tx_reports_Module $reportsModule Back-reference to the calling reports module
         */
-       public function __construct(tx_reports_Module $reportsModule) {
+       public function __construct(Tx_Reports_Controller_ReportController $reportsModule) {
                $this->reportsModule = $reportsModule;
                $GLOBALS['LANG']->includeLLFile('EXT:sv/reports/locallang.xml');
        }
@@ -57,15 +57,8 @@ class tx_sv_reports_ServicesList implements tx_reports_Report {
        public function getReport() {
                $content = '';
 
-                       // Add custom stylesheet
-               $this->reportsModule->doc->getPageRenderer()->addCssFile(
-                       t3lib_extMgm::extRelPath('sv') . 'reports/tx_sv_report.css'
-               );
-
                $content .= $this->renderHelp();
-               $content .= $this->reportsModule->doc->spacer(10);
                $content .= $this->renderServicesList();
-               $content .= $this->reportsModule->doc->spacer(10);
                $content .= $this->renderExecutablesSearchPathList();
 
                return $content;
@@ -82,7 +75,7 @@ class tx_sv_reports_ServicesList implements tx_reports_Report {
                        . '</p>';
                $help .= '<p class="help">'
                        . $GLOBALS['LANG']->getLL('externals_explanation')
-                       . '</p>';
+                       . '</p><br />';
 
                return $help;
        }
@@ -136,7 +129,7 @@ class tx_sv_reports_ServicesList implements tx_reports_Report {
                </table>
                ';
 
-               return $header . $serviceList . $this->reportsModule->doc->spacer(10);
+               return $header . $serviceList;
        }
 
        /**
@@ -202,7 +195,7 @@ class tx_sv_reports_ServicesList implements tx_reports_Report {
        protected function renderExecutablesSearchPathList() {
                $searchPaths = t3lib_exec::getPaths(TRUE);
 
-               $content = '<h3 class="divider">' . $GLOBALS['LANG']->getLL('search_paths') . '</h3>';
+               $content = '<br /><h3 class="divider">' . $GLOBALS['LANG']->getLL('search_paths') . '</h3>';
 
                if (count($searchPaths) == 0) {
                        $content .= '<p>' . $GLOBALS['LANG']->getLL('no_search_paths') . '</p>';