Added Feature #17723: Refreshment of about module
authorsteffenk <steffenk@709f56b5-9817-0410-a4d7-c38de5d9e867>
Sat, 26 Feb 2011 15:11:39 +0000 (15:11 +0000)
committersteffenk <steffenk@709f56b5-9817-0410-a4d7-c38de5d9e867>
Sat, 26 Feb 2011 15:11:39 +0000 (15:11 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10652 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/about/ext_autoload.php [new file with mode: 0644]
typo3/sysext/about/ext_emconf.php
typo3/sysext/about/interfaces/interface.tx_about_customsections.php [new file with mode: 0644]
typo3/sysext/about/mod/index.php
typo3/sysext/lang/locallang_mod_help_about.xml

index b893ea0..74acfc0 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-02-26  Steffen Kamper  <steffen@typo3.org>
+
+       * Added Feature #17723: Refreshment of about module
+
 2011-02-26  Steffen Gebert  <steffen.gebert@typo3.org>
 
        * Fixed bug #17775: Compression Level Upgrade Wizard refers to old .htaccess path (Thanks to Markus Klein)
diff --git a/typo3/sysext/about/ext_autoload.php b/typo3/sysext/about/ext_autoload.php
new file mode 100644 (file)
index 0000000..2661d89
--- /dev/null
@@ -0,0 +1,13 @@
+<?php
+/*
+ * Register necessary class names with autoloader
+ *
+ */
+
+$extensionPath = dirname(__FILE__);
+
+return array(
+       'tx_about_customsections' => $extensionPath . '/interfaces/interface.tx_about_customsections.php',
+);
+
+?>
index de9bab9..0c2505a 100644 (file)
@@ -3,7 +3,7 @@
 ########################################################################
 # Extension Manager/Repository config file for ext "about".
 #
-# Auto generated 26-01-2011 20:08
+# Auto generated 23-02-2011 18:44
 #
 # Manual updates:
 # Only the data in the array - everything else is removed by next
@@ -33,8 +33,8 @@ $EM_CONF[$_EXTKEY] = array(
        'author_company' => 'Curby Soft Multimedia',
        'CGLcompliance' => '',
        'CGLcompliance_note' => '',
-       'version' => '1.0.0',
-       '_md5_values_when_last_written' => 'a:6:{s:12:"ext_icon.gif";s:4:"f3ab";s:14:"ext_tables.php";s:4:"57f3";s:13:"mod/clear.gif";s:4:"cc11";s:12:"mod/conf.php";s:4:"f523";s:13:"mod/index.php";s:4:"5569";s:12:"mod/info.gif";s:4:"2723";}',
+       'version' => '1.1.0',
+       '_md5_values_when_last_written' => 'a:8:{s:16:"ext_autoload.php";s:4:"5a89";s:12:"ext_icon.gif";s:4:"f3ab";s:14:"ext_tables.php";s:4:"57f3";s:48:"interfaces/interface.tx_about_customsections.php";s:4:"3f4a";s:13:"mod/clear.gif";s:4:"cc11";s:12:"mod/conf.php";s:4:"f523";s:13:"mod/index.php";s:4:"9a1d";s:12:"mod/info.gif";s:4:"2723";}',
        'constraints' => array(
                'depends' => array(
                        'php' => '5.1.0-0.0.0',
@@ -49,4 +49,4 @@ $EM_CONF[$_EXTKEY] = array(
        ),
 );
 
-?>
\ No newline at end of file
+?>
diff --git a/typo3/sysext/about/interfaces/interface.tx_about_customsections.php b/typo3/sysext/about/interfaces/interface.tx_about_customsections.php
new file mode 100644 (file)
index 0000000..431e80f
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2011 Steffen Kamper <steffen@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.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  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!
+ ***************************************************************/
+
+
+interface tx_about_customSections {
+
+       /**
+        * Adds custom sections to the about module
+        *
+        * @abstract
+        * @param  array $sections
+        * @return void
+        */
+       public function addSection(array &$sections);
+}
+
+?>
index b6a79b3..6582e7e 100644 (file)
@@ -1,29 +1,29 @@
 <?php
 /***************************************************************
-*  Copyright notice
-*
-*  (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
-*  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.
-*  A copy is found in the textfile GPL.txt and important notices to the license
-*  from the author is found in LICENSE.txt distributed with these scripts.
-*
-*
-*  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) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
+ *  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.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  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!
+ ***************************************************************/
 /**
  * Module: About
  * This document shows some standard-information for TYPO3 CMS: About-text, version number and so on.
@@ -32,8 +32,9 @@
  * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
  * XHTML compliant
  *
- * @todo       This module could use a major overhaul in general.
  * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author     Steffen Kamper <steffen@typo3.org>
+ * @package TYPO3
  */
 /**
  * [CLASS/FUNCTION INDEX of SCRIPT]
@@ -41,8 +42,8 @@
  *
  *
  *   73: class SC_mod_help_about_index
- *   91:     function main()
- *  125:     function printContent()
+ *   91:        function main()
+ *  125:        function printContent()
  *
  * TOTAL FUNCTIONS: 2
  * (This index is automatically created/updated by the extension "extdeveval")
 
 unset($MCONF);
 require ('conf.php');
-require ($BACK_PATH.'init.php');
-require ($BACK_PATH.'template.php');
+require ($BACK_PATH . 'init.php');
+require ($BACK_PATH . 'template.php');
 $LANG->includeLLFile('EXT:lang/locallang_mod_help_about.xml');
-$BE_USER->modAccess($MCONF,1);
-
-
-
-
-
-
+$BE_USER->modAccess($MCONF, 1);
 
 
 /**
@@ -72,13 +67,31 @@ $BE_USER->modAccess($MCONF,1);
  */
 class SC_mod_help_about_index {
 
-               // Internal, dynamic:
-       var $MCONF=array();
-       var $MOD_MENU=array();
-       var $MOD_SETTINGS=array();
-       var $content;
+       // Internal, dynamic:
+       /**
+        * @var array
+        */
+       public $MCONF = array();
 
+       /**
+        * @var array
+        */
+       public $MOD_MENU = array();
 
+       /**
+        * @var array
+        */
+       public $MOD_SETTINGS = array();
+
+       /**
+        * @var string
+        */
+       protected $content = '';
+
+       /**
+        * @var array
+        */
+       protected $sections = array();
 
 
        /**
@@ -88,8 +101,7 @@ class SC_mod_help_about_index {
         *
         * @return      void
         */
-       function main() {
-               global $TBE_TEMPLATE,$LANG,$BACK_PATH;
+       function main() {
 
                $this->MCONF = $GLOBALS['MCONF'];
 
@@ -97,86 +109,177 @@ class SC_mod_help_about_index {
                // Main
                // **************************
                #$TBE_TEMPLATE->bgColor = '#cccccc';
-               $TBE_TEMPLATE->backPath = $GLOBALS['BACK_PATH'];
+               $content = $this->renderSections();
 
-               $minorText = sprintf($LANG->getLL('minor'), 'TYPO3 Ver. '.htmlspecialchars(TYPO3_version).', Copyright &copy; '.htmlspecialchars(TYPO3_copyright_year), 'Kasper Sk&aring;rh&oslash;j');
+               // Renders the module page
+               $this->content = $GLOBALS['TBE_TEMPLATE']->render(
+                       $GLOBALS['LANG']->getLL('title', TRUE),
+                       $content
+               );
+       }
 
-               $content='
-                       <div id="typo3-mod-help-about-index-php-outer">
-                               <img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/typo3logo.gif', 'width="123" height="34"') . ' alt="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:typo3_logo', true) . '" />
-                               <div class="typo3-mod-help-about-index-php-inner">
-                                       <h2>' . $LANG->getLL('welcome', TRUE) . '</h2>
-                                       <p>'.$minorText.'</p>
-                               </div>
+       /**
+        * Renders main sections
+        *
+        * @return string $content
+        */
+       public function renderSections() {
+               $this->sections = array();
 
-                               <div class="typo3-mod-help-about-index-php-inner">
-                                       <h2>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:donation_header', TRUE) . '</h2>
-                                       <p id="donation-description">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:donation_message') . '</p>
-                                       <div class="donation-button">
-                                               <input type="button" id="donation-button" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:donation_button') . '"
-                                               onclick="window.open(\'' . TYPO3_URL_DONATE . '\');" />
-                                       </div>
-                               </div>
+               $this->renderAboutTypo3();
+               $this->renderDonation();
+               $this->renderCommunityCredits();
+               $this->renderCoreteamCredits();
+               $this->render3rdPartyCredits();
+               $this->renderExtensionAuthors();
+               $this->renderCustomSections();
 
-                               <div class="typo3-mod-help-about-index-php-inner">
-                                       <h2>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:community_credits', true).'</h2>
-                                       <p>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:information_detail').'</p>
-                               </div>
+               // compile content
+               $content = '<div id="typo3-mod-help-about-index-php-outer">'
+                               . implode('', $this->sections) . '</div>';
 
-                               <div class="typo3-mod-help-about-index-php-inner">
-                                       <h2>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:coredevs', true) . '</h2>
-                                       <p>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:coredevs_detail') . '</p>
-                               </div>
+               return $content;
+       }
+
+       /**
+        * Outputs the accumulated content to screen
+        *
+        * @return      void
+        */
+       public function printContent() {
+               echo $this->content;
+       }
+
+
+       protected function renderAboutTypo3() {
+               $minorText = sprintf($GLOBALS['LANG']->getLL('minor'), 'TYPO3 Ver. ' . htmlspecialchars(TYPO3_version) . ', Copyright &copy; ' . htmlspecialchars(TYPO3_copyright_year), 'Kasper Sk&aring;rh&oslash;j');
+               $content = '
+                       <img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/typo3logo.gif', 'width="123" height="34"') . ' alt="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:typo3_logo', true) . '" />
+                       <div class="typo3-mod-help-about-index-php-inner">
+                               <h2>' . $GLOBALS['LANG']->getLL('welcome', TRUE) . '</h2>
+                                       <p>' . $minorText . '</p>
+                       </div>';
 
-                               <div class="typo3-mod-help-about-index-php-inner">
-                                       <h2>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:extension_authors', true).'</h2>
-                                       <p>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:extension_list_info', true).'</p>
-                                       <br />'.$this->getExtensionAuthors().'
+               $this->sections['about'] = $content;
+       }
+
+       /**
+        * Renders TYPO3 donation
+        *
+        * @return void
+        */
+       protected function renderDonation() {
+               $content =
+                               '<div class="typo3-mod-help-about-index-php-inner">
+                               <h2>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:donation_header', TRUE) . '</h2>
+                               <p id="donation-description">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:donation_message') . '</p>
+                               <div class="donation-button">
+                                       <input type="button" id="donation-button" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:donation_button') . '"
+                                       onclick="window.open(\'' . TYPO3_URL_DONATE . '\');" />
                                </div>
-                       </div>
-               ';
+                       </div>';
 
-                       // Renders the module page
-               $this->content = $TBE_TEMPLATE->render(
-                       'About',
-                       $content
-               );
+               $this->sections['donation'] = $content;
        }
 
        /**
-        * Outputting the accumulated content to screen
+        * Renders community credits
         *
-        * @return      void
+        * @return void
         */
-       function printContent() {
-               echo $this->content;
+       protected function renderCommunityCredits() {
+               $content = '
+                       <div class="typo3-mod-help-about-index-php-inner">
+                               <h2>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:community_credits', TRUE) . '</h2>
+                               <p>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:information_detail') . '</p>
+                       </div>';
+
+               $this->sections['community'] = $content;
        }
 
        /**
-        * gets the author names from the installed extensions
+        * Renders community credits
         *
-        * @return      string  list of extensions authors and their e-mail
+        * @return void
         */
-       function getExtensionAuthors() {
-               $content = '<table border="0" cellspacing="2" cellpadding="1"><tr><th>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:extension', true).'</th><th>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:extension_author', true).'</th></tr>';
+       protected function render3rdPartyCredits() {
+               $content = '
+                       <div class="typo3-mod-help-about-index-php-inner">
+                               <h2>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:external_libraries', true) . '</h2>
+                               <p>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:external_thanks', true) . '</p>
+                               <br />
+                               <table border="0" cellspacing="2" cellpadding="1">
+                               <tr><td width="280">Audio player Plugin</td><td><a href="http://www.1pixelout.net/code/audio-player-wordpress-plugin/" target="_blank">www.1pixelout.net</a></td></tr>
+                               <tr><td>CodeMirror</td><td><a href="http://codemirror.net/" target="_blank">codemirror.net</a></td></tr>
+                               <tr><td>ExtJS</td><td><a href="http://www.sencha.com/" target="_blank">www.sencha.com</a></td></tr>
+                               <tr><td>JSMin</td><td><a href="http://www.crockford.com" target="_blank">www.crockford.com</a></td></tr>
+                               <tr><td>Modernizr</td><td><a href="http://www.modernizr.com" target="_blank">www.modernizr.com</a></td></tr>
+                               <tr><td>Prototype JavaScript framework</td><td><a href="http://www.prototypejs.org/" target="_blank">www.prototypejs.org</a></td></tr>
+                               <tr><td>RemoveXSS</td><td><a href="http://quickwired.com/smallprojects/php_xss_filter_function.php" target="_blank">quickwired.com</a></td></tr>
+                               <tr><td>script.aculo.us</td><td><a href="http://script.aculo.us" target="_blank">script.aculo.us</a></td></tr>
+                               <tr><td>SWFUpload</td><td><a href="http://www.swfupload.org" target="_blank">www.swfupload.org</a></td></tr>
+                               <tr><td>Swift Mailer</td><td><a href="http://swiftmailer.org" target="_blank">swiftmailer.org</a></td></tr>
+                               </table>
+                       </div>';
+
+               $this->sections['3rdparty'] = $content;
+       }
+
+       /**
+        * Renders core team credits
+        *
+        * @return void
+        */
+       protected function renderCoreteamCredits() {
+               $content = '
+                       <div class="typo3-mod-help-about-index-php-inner">
+                               <h2>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:coredevs', TRUE) . '</h2>
+                               <p>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:coredevs_detail') . '</p>
+                       </div>';
+
+               $this->sections['coreteam'] = $content;
+       }
+
+       /**
+        * Renders custom sections
+        *
+        * @return void
+        */
+       protected function renderCustomSections() {
+               //hook for custom sections
+               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['about/index.php']['addSection'])) {
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['about/index.php']['addSection'] as $classRef) {
+                               $hookObject = t3lib_div::getUserObj($classRef);
+                               if (!($hookObject instanceof tx_about_customSections)) {
+                                       throw new UnexpectedValueException('$hookObject must implement interface tx_about_customSections', 1298121573);
+                               }
+                               $hookObject->addSection($this->sections);
+                       }
+               }
+       }
+
+       /**
+        * Renders extension authors credits
+        *
+        * @return void
+        */
+       protected function renderExtensionAuthors() {
+               $content = '<table border="0" cellspacing="2" cellpadding="1"><tr><th>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:extension', true) . '</th><th>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:extension_author', true) . '</th></tr>';
 
                $loadedExtensions = $GLOBALS['TYPO3_LOADED_EXT'];
                foreach ($loadedExtensions as $extensionKey => $extension) {
                        if (is_array($extension) && $extension['type'] != 'S') {
-                               $emconfPath = PATH_site.$extension['siteRelPath'].'ext_emconf.php';
+                               $emconfPath = PATH_site . $extension['siteRelPath'] . 'ext_emconf.php';
                                include($emconfPath);
 
                                $emconf = $EM_CONF['']; // ext key is not set when loading the ext_emconf.php directly
 
-                               $content.= '<tr><td>'.$emconf['title'].' ('.$extensionKey.')</td>'.
-                                                               '<td><a href="mailto:'.$emconf['author_email'].'?subject='.rawurlencode('Thanks for your '.$emconf['title'].' extension').'">'.$emconf['author'].'</a></td></tr>';
+                               $content .= '<tr><td width="280">' . $emconf['title'] . ' (' . $extensionKey . ')</td>' .
+                                               '<td><a href="mailto:' . $emconf['author_email'] . '?subject=' . rawurlencode('Thanks for your ' . $emconf['title'] . ' extension') . '">' . $emconf['author'] . '</a></td></tr>';
                        }
                }
-
-               $content.= '</table>';
-
-               return $content;
        }
+
 }
 
 // Include extension?
@@ -185,18 +288,8 @@ if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLA
 }
 
 
-
-
-
-
-
-
-
-
-
-
 // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_mod_help_about_index');
 $SOBE->main();
 $SOBE->printContent();
-?>
+?>
\ No newline at end of file
index 09b9b8d..d2bcda9 100755 (executable)
@@ -25,6 +25,8 @@
                        <label index="donation_header">TYPO3 Donation</label>
                        <label index="donation_message">It would be great if you could donate. TYPO3 is Open Source and relies heavily on donations from its users and supporters.&lt;br/&gt; &lt;b&gt;Thank you&lt;/b&gt; for making this great Content Management System even better with your help!</label>
                        <label index="donation_button">Donate now</label>
+                       <label index="external_libraries">External Libraries</label>
+                       <label index="external_thanks">TYPO3 core uses and thanks these external Open Source projects:</label>
                </languageKey>
        </data>
 </T3locallang>