[TASK] Remove function index
[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 * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
32 * XHTML compliant
33 *
34 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
35 * @author Steffen Kamper <steffen@typo3.org>
36 * @package TYPO3
37 */
38
39 unset($MCONF);
40 require ('conf.php');
41 require ($BACK_PATH . 'init.php');
42 require ($BACK_PATH . 'template.php');
43 $LANG->includeLLFile('EXT:lang/locallang_mod_help_about.xml');
44 $BE_USER->modAccess($MCONF, 1);
45
46
47 /**
48 * Script Class for the Help > About module
49 *
50 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
51 * @package TYPO3
52 * @subpackage core
53 */
54 class SC_mod_help_about_index {
55
56 // Internal, dynamic:
57 /**
58 * @var array
59 */
60 public $MCONF = array();
61
62 /**
63 * @var array
64 */
65 public $MOD_MENU = array();
66
67 /**
68 * @var array
69 */
70 public $MOD_SETTINGS = array();
71
72 /**
73 * @var string
74 */
75 protected $content = '';
76
77 /**
78 * @var array
79 */
80 protected $sections = array();
81
82
83 /**
84 * Main function, producing the module output.
85 * In this case, the module output is a very simple screen telling the version of TYPO3 and that's basically it...
86 * The content is set in the internal variable $this->content
87 *
88 * @return void
89 */
90 function main() {
91
92 $this->MCONF = $GLOBALS['MCONF'];
93
94 // **************************
95 // Main
96 // **************************
97 #$TBE_TEMPLATE->bgColor = '#cccccc';
98 $content = $this->renderSections();
99
100 // Renders the module page
101 $this->content = $GLOBALS['TBE_TEMPLATE']->render(
102 $GLOBALS['LANG']->getLL('title', TRUE),
103 $content
104 );
105 }
106
107 /**
108 * Renders main sections
109 *
110 * @return string $content
111 */
112 public function renderSections() {
113 $this->sections = array();
114
115 $this->renderAboutTypo3();
116 $this->renderDonation();
117 $this->renderCommunityCredits();
118 $this->renderCoreteamCredits();
119 $this->render3rdPartyCredits();
120 $this->renderExtensionAuthors();
121 $this->renderCustomSections();
122
123 // compile content
124 $content = '<div id="typo3-mod-help-about-index-php-outer">'
125 . implode('', $this->sections) . '</div>';
126
127 return $content;
128 }
129
130 /**
131 * Outputs the accumulated content to screen
132 *
133 * @return void
134 */
135 public function printContent() {
136 echo $this->content;
137 }
138
139
140 protected function renderAboutTypo3() {
141 $minorText = sprintf($GLOBALS['LANG']->getLL('minor'), 'TYPO3 Ver. ' . htmlspecialchars(TYPO3_version) . ', Copyright &copy; ' . htmlspecialchars(TYPO3_copyright_year), 'Kasper Sk&aring;rh&oslash;j');
142 $content = '
143 <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) . '" />
144 <div class="typo3-mod-help-about-index-php-inner">
145 <h2>' . $GLOBALS['LANG']->getLL('welcome', TRUE) . '</h2>
146 <p>' . $minorText . '</p>
147 </div>';
148
149 $this->sections['about'] = $content;
150 }
151
152 /**
153 * Renders TYPO3 donation
154 *
155 * @return void
156 */
157 protected function renderDonation() {
158 $content =
159 '<div class="typo3-mod-help-about-index-php-inner">
160 <h2>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:donation_header', TRUE) . '</h2>
161 <p id="donation-description">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:donation_message') . '</p>
162 <div class="donation-button">
163 <input type="button" id="donation-button" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:donation_button') . '"
164 onclick="window.open(\'' . TYPO3_URL_DONATE . '\');" />
165 </div>
166 </div>';
167
168 $this->sections['donation'] = $content;
169 }
170
171 /**
172 * Renders community credits
173 *
174 * @return void
175 */
176 protected function renderCommunityCredits() {
177 $content = '
178 <div class="typo3-mod-help-about-index-php-inner">
179 <h2>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:community_credits', TRUE) . '</h2>
180 <p>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:information_detail') . '</p>
181 </div>';
182
183 $this->sections['community'] = $content;
184 }
185
186 /**
187 * Renders community credits
188 *
189 * @return void
190 */
191 protected function render3rdPartyCredits() {
192 $content = '
193 <div class="typo3-mod-help-about-index-php-inner">
194 <h2>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:external_libraries', TRUE) . '</h2>
195 <p>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:external_thanks', TRUE) . '</p>
196 <br />
197 <table border="0" cellspacing="2" cellpadding="1">
198 <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>
199 <tr><td>CodeMirror</td><td><a href="http://codemirror.net/" target="_blank">codemirror.net</a></td></tr>
200 <tr><td>ExtJS</td><td><a href="http://www.sencha.com/" target="_blank">www.sencha.com</a></td></tr>
201 <tr><td>JSMin</td><td><a href="http://www.crockford.com" target="_blank">www.crockford.com</a></td></tr>
202 <tr><td>Modernizr</td><td><a href="http://www.modernizr.com" target="_blank">www.modernizr.com</a></td></tr>
203 <tr><td>Prototype JavaScript framework</td><td><a href="http://www.prototypejs.org/" target="_blank">www.prototypejs.org</a></td></tr>
204 <tr><td>RemoveXSS</td><td><a href="http://quickwired.com/smallprojects/php_xss_filter_function.php" target="_blank">quickwired.com</a></td></tr>
205 <tr><td>script.aculo.us</td><td><a href="http://script.aculo.us" target="_blank">script.aculo.us</a></td></tr>
206 <tr><td>SWFUpload</td><td><a href="http://www.swfupload.org" target="_blank">www.swfupload.org</a></td></tr>
207 <tr><td>Swift Mailer</td><td><a href="http://swiftmailer.org" target="_blank">swiftmailer.org</a></td></tr>
208 </table>
209 </div>';
210
211 $this->sections['3rdparty'] = $content;
212 }
213
214 /**
215 * Renders core team credits
216 *
217 * @return void
218 */
219 protected function renderCoreteamCredits() {
220 $content = '
221 <div class="typo3-mod-help-about-index-php-inner">
222 <h2>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:coredevs', TRUE) . '</h2>
223 <p>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_help_about.xml:coredevs_detail') . '</p>
224 </div>';
225
226 $this->sections['coreteam'] = $content;
227 }
228
229 /**
230 * Renders custom sections
231 *
232 * @return void
233 */
234 protected function renderCustomSections() {
235 //hook for custom sections
236 if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['about/index.php']['addSection'])) {
237 foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['about/index.php']['addSection'] as $classRef) {
238 $hookObject = t3lib_div::getUserObj($classRef);
239 if (!($hookObject instanceof tx_about_customSections)) {
240 throw new UnexpectedValueException('$hookObject must implement interface tx_about_customSections', 1298121573);
241 }
242 $hookObject->addSection($this->sections);
243 }
244 }
245 }
246
247 /**
248 * Renders extension authors credits
249 *
250 * @return void
251 */
252 protected function renderExtensionAuthors() {
253 $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>';
254
255 $loadedExtensions = $GLOBALS['TYPO3_LOADED_EXT'];
256 foreach ($loadedExtensions as $extensionKey => $extension) {
257 if (is_array($extension) && $extension['type'] != 'S') {
258 $emconfPath = PATH_site . $extension['siteRelPath'] . 'ext_emconf.php';
259 include($emconfPath);
260
261 $emconf = $EM_CONF['']; // ext key is not set when loading the ext_emconf.php directly
262
263 $content .= '<tr><td width="280">' . $emconf['title'] . ' (' . $extensionKey . ')</td>' .
264 '<td><a href="mailto:' . $emconf['author_email'] . '?subject=' . rawurlencode('Thanks for your ' . $emconf['title'] . ' extension') . '">' . $emconf['author'] . '</a></td></tr>';
265 }
266 }
267 }
268
269 }
270
271 // Include extension?
272 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/mod/help/about/index.php'])) {
273 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/mod/help/about/index.php']);
274 }
275
276
277 // Make instance:
278 $SOBE = t3lib_div::makeInstance('SC_mod_help_about_index');
279 $SOBE->main();
280 $SOBE->printContent();
281 ?>