Added Feature #17723: Refreshment of about module
[Packages/TYPO3.CMS.git] / typo3 / sysext / about / mod / index.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 * A copy is found in the textfile GPL.txt and important notices to the license
17 * from the author is found in LICENSE.txt distributed with these scripts.
18 *
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27 /**
28 * Module: About
29 * This document shows some standard-information for TYPO3 CMS: About-text, version number and so on.
30 *
31 * $Id$
32 * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
33 * XHTML compliant
34 *
35 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
36 * @author Steffen Kamper <steffen@typo3.org>
37 * @package TYPO3
38 */
39 /**
40 * [CLASS/FUNCTION INDEX of SCRIPT]
41 *
42 *
43 *
44 * 73: class SC_mod_help_about_index
45 * 91: function main()
46 * 125: function printContent()
47 *
48 * TOTAL FUNCTIONS: 2
49 * (This index is automatically created/updated by the extension "extdeveval")
50 *
51 */
52
53 unset($MCONF);
54 require ('conf.php');
55 require ($BACK_PATH . 'init.php');
56 require ($BACK_PATH . 'template.php');
57 $LANG->includeLLFile('EXT:lang/locallang_mod_help_about.xml');
58 $BE_USER->modAccess($MCONF, 1);
59
60
61 /**
62 * Script Class for the Help > About module
63 *
64 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
65 * @package TYPO3
66 * @subpackage core
67 */
68 class SC_mod_help_about_index {
69
70 // Internal, dynamic:
71 /**
72 * @var array
73 */
74 public $MCONF = array();
75
76 /**
77 * @var array
78 */
79 public $MOD_MENU = array();
80
81 /**
82 * @var array
83 */
84 public $MOD_SETTINGS = array();
85
86 /**
87 * @var string
88 */
89 protected $content = '';
90
91 /**
92 * @var array
93 */
94 protected $sections = array();
95
96
97 /**
98 * Main function, producing the module output.
99 * In this case, the module output is a very simple screen telling the version of TYPO3 and that's basically it...
100 * The content is set in the internal variable $this->content
101 *
102 * @return void
103 */
104 function main() {
105
106 $this->MCONF = $GLOBALS['MCONF'];
107
108 // **************************
109 // Main
110 // **************************
111 #$TBE_TEMPLATE->bgColor = '#cccccc';
112 $content = $this->renderSections();
113
114 // Renders the module page
115 $this->content = $GLOBALS['TBE_TEMPLATE']->render(
116 $GLOBALS['LANG']->getLL('title', TRUE),
117 $content
118 );
119 }
120
121 /**
122 * Renders main sections
123 *
124 * @return string $content
125 */
126 public function renderSections() {
127 $this->sections = array();
128
129 $this->renderAboutTypo3();
130 $this->renderDonation();
131 $this->renderCommunityCredits();
132 $this->renderCoreteamCredits();
133 $this->render3rdPartyCredits();
134 $this->renderExtensionAuthors();
135 $this->renderCustomSections();
136
137 // compile content
138 $content = '<div id="typo3-mod-help-about-index-php-outer">'
139 . implode('', $this->sections) . '</div>';
140
141 return $content;
142 }
143
144 /**
145 * Outputs the accumulated content to screen
146 *
147 * @return void
148 */
149 public function printContent() {
150 echo $this->content;
151 }
152
153
154 protected function renderAboutTypo3() {
155 $minorText = sprintf($GLOBALS['LANG']->getLL('minor'), 'TYPO3 Ver. ' . htmlspecialchars(TYPO3_version) . ', Copyright &copy; ' . htmlspecialchars(TYPO3_copyright_year), 'Kasper Sk&aring;rh&oslash;j');
156 $content = '
157 <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) . '" />
158 <div class="typo3-mod-help-about-index-php-inner">
159 <h2>' . $GLOBALS['LANG']->getLL('welcome', TRUE) . '</h2>
160 <p>' . $minorText . '</p>
161 </div>';
162
163 $this->sections['about'] = $content;
164 }
165
166 /**
167 * Renders TYPO3 donation
168 *
169 * @return void
170 */
171 protected function renderDonation() {
172 $content =
173 '<div class="typo3-mod-help-about-index-php-inner">
174 <h2>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:donation_header', TRUE) . '</h2>
175 <p id="donation-description">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:donation_message') . '</p>
176 <div class="donation-button">
177 <input type="button" id="donation-button" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:donation_button') . '"
178 onclick="window.open(\'' . TYPO3_URL_DONATE . '\');" />
179 </div>
180 </div>';
181
182 $this->sections['donation'] = $content;
183 }
184
185 /**
186 * Renders community credits
187 *
188 * @return void
189 */
190 protected function renderCommunityCredits() {
191 $content = '
192 <div class="typo3-mod-help-about-index-php-inner">
193 <h2>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:community_credits', TRUE) . '</h2>
194 <p>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:information_detail') . '</p>
195 </div>';
196
197 $this->sections['community'] = $content;
198 }
199
200 /**
201 * Renders community credits
202 *
203 * @return void
204 */
205 protected function render3rdPartyCredits() {
206 $content = '
207 <div class="typo3-mod-help-about-index-php-inner">
208 <h2>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:external_libraries', true) . '</h2>
209 <p>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:external_thanks', true) . '</p>
210 <br />
211 <table border="0" cellspacing="2" cellpadding="1">
212 <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>
213 <tr><td>CodeMirror</td><td><a href="http://codemirror.net/" target="_blank">codemirror.net</a></td></tr>
214 <tr><td>ExtJS</td><td><a href="http://www.sencha.com/" target="_blank">www.sencha.com</a></td></tr>
215 <tr><td>JSMin</td><td><a href="http://www.crockford.com" target="_blank">www.crockford.com</a></td></tr>
216 <tr><td>Modernizr</td><td><a href="http://www.modernizr.com" target="_blank">www.modernizr.com</a></td></tr>
217 <tr><td>Prototype JavaScript framework</td><td><a href="http://www.prototypejs.org/" target="_blank">www.prototypejs.org</a></td></tr>
218 <tr><td>RemoveXSS</td><td><a href="http://quickwired.com/smallprojects/php_xss_filter_function.php" target="_blank">quickwired.com</a></td></tr>
219 <tr><td>script.aculo.us</td><td><a href="http://script.aculo.us" target="_blank">script.aculo.us</a></td></tr>
220 <tr><td>SWFUpload</td><td><a href="http://www.swfupload.org" target="_blank">www.swfupload.org</a></td></tr>
221 <tr><td>Swift Mailer</td><td><a href="http://swiftmailer.org" target="_blank">swiftmailer.org</a></td></tr>
222 </table>
223 </div>';
224
225 $this->sections['3rdparty'] = $content;
226 }
227
228 /**
229 * Renders core team credits
230 *
231 * @return void
232 */
233 protected function renderCoreteamCredits() {
234 $content = '
235 <div class="typo3-mod-help-about-index-php-inner">
236 <h2>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:coredevs', TRUE) . '</h2>
237 <p>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:coredevs_detail') . '</p>
238 </div>';
239
240 $this->sections['coreteam'] = $content;
241 }
242
243 /**
244 * Renders custom sections
245 *
246 * @return void
247 */
248 protected function renderCustomSections() {
249 //hook for custom sections
250 if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['about/index.php']['addSection'])) {
251 foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['about/index.php']['addSection'] as $classRef) {
252 $hookObject = t3lib_div::getUserObj($classRef);
253 if (!($hookObject instanceof tx_about_customSections)) {
254 throw new UnexpectedValueException('$hookObject must implement interface tx_about_customSections', 1298121573);
255 }
256 $hookObject->addSection($this->sections);
257 }
258 }
259 }
260
261 /**
262 * Renders extension authors credits
263 *
264 * @return void
265 */
266 protected function renderExtensionAuthors() {
267 $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>';
268
269 $loadedExtensions = $GLOBALS['TYPO3_LOADED_EXT'];
270 foreach ($loadedExtensions as $extensionKey => $extension) {
271 if (is_array($extension) && $extension['type'] != 'S') {
272 $emconfPath = PATH_site . $extension['siteRelPath'] . 'ext_emconf.php';
273 include($emconfPath);
274
275 $emconf = $EM_CONF['']; // ext key is not set when loading the ext_emconf.php directly
276
277 $content .= '<tr><td width="280">' . $emconf['title'] . ' (' . $extensionKey . ')</td>' .
278 '<td><a href="mailto:' . $emconf['author_email'] . '?subject=' . rawurlencode('Thanks for your ' . $emconf['title'] . ' extension') . '">' . $emconf['author'] . '</a></td></tr>';
279 }
280 }
281 }
282
283 }
284
285 // Include extension?
286 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/mod/help/about/index.php'])) {
287 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/mod/help/about/index.php']);
288 }
289
290
291 // Make instance:
292 $SOBE = t3lib_div::makeInstance('SC_mod_help_about_index');
293 $SOBE->main();
294 $SOBE->printContent();
295 ?>