2 /***************************************************************
5 * (c) 1999-2010 Kasper Skaarhoj (kasperYYYY@typo3.com)
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.
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.
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.
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
29 * Presents various page related information from extensions
32 * Revised for TYPO3 3.6 November/2003 by Kasper Skaarhoj
35 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
38 * [CLASS/FUNCTION INDEX of SCRIPT]
42 * 70: class SC_mod_web_info_index extends t3lib_SCbase
44 * 178: function printContent()
47 * (This index is automatically created/updated by the extension "extdeveval")
53 require($BACK_PATH.'init.php');
54 require($BACK_PATH.'template.php');
55 $LANG->includeLLFile('EXT:lang/locallang_mod_web_info.xml');
57 $BE_USER->modAccess($MCONF,1);
62 * Script Class for the Web > Info module
63 * This class creates the framework to which other extensions can connect their sub-modules
65 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
69 class SC_mod_web_info_index
extends t3lib_SCbase
{
77 * Document Template Object
84 * Initialize module header etc and call extObjContent function
89 global $BE_USER,$LANG,$BACK_PATH;
92 // The page will show only if there is a valid page and if this page may be viewed by the user
93 $this->pageinfo
= t3lib_BEfunc
::readPageAccess($this->id
,$this->perms_clause
);
94 $access = is_array($this->pageinfo
) ?
1 : 0;
96 if (($this->id
&& $access) ||
($BE_USER->user
['admin'] && !$this->id
)) {
97 $this->CALC_PERMS
= $BE_USER->calcPerms($this->pageinfo
);
98 if ($BE_USER->user
['admin'] && !$this->id
) {
99 $this->pageinfo
=array('title' => '[root-level]','uid'=>0,'pid'=>0);
102 $this->doc
= t3lib_div
::makeInstance('template');
103 $this->doc
->backPath
= $BACK_PATH;
104 $this->doc
->setModuleTemplate('templates/info.html');
105 $this->doc
->tableLayout
= Array (
107 '0' => Array('<td valign="top"><strong>','</strong></td>'),
108 "defCol" => Array('<td><img src="'.$this->doc
->backPath
.'clear.gif" width="10" height="1" alt="" /></td><td valign="top"><strong>','</strong></td>')
111 "0" => Array('<td valign="top">','</td>'),
112 "defCol" => Array('<td><img src="'.$this->doc
->backPath
.'clear.gif" width="10" height="1" alt="" /></td><td valign="top">','</td>')
117 $this->doc
->JScode
= $this->doc
->wrapScriptTags('
119 function jumpToUrl(URL) { //
120 window.location.href = URL;
123 $this->doc
->postCode
= $this->doc
->wrapScriptTags('
125 if (top.fsMod) top.fsMod.recentIds["web"] = '.intval($this->id
).';
128 // Setting up the context sensitive menu:
129 $this->doc
->getContextMenuCode();
130 $this->doc
->form
= '<form action="index.php" method="post" name="webinfoForm">';
132 $vContent = $this->doc
->getVersionSelector($this->id
,1);
134 $this->content
.=$this->doc
->section('',$vContent);
137 $this->extObjContent();
139 // Setting up the buttons and markers for docheader
140 $docHeaderButtons = $this->getButtons();
142 'CSH' => $docHeaderButtons['csh'],
143 'FUNC_MENU' => t3lib_BEfunc
::getFuncMenu($this->id
, 'SET[function]', $this->MOD_SETTINGS
['function'], $this->MOD_MENU
['function']),
144 'CONTENT' => $this->content
147 // Build the <body> for the module
148 $this->content
= $this->doc
->startPage($LANG->getLL('title'));
149 $this->content
.= $this->doc
->moduleBody($this->pageinfo
, $docHeaderButtons, $markers);
150 $this->content
.= $this->doc
->endPage();
151 $this->content
= $this->doc
->insertStylesAndJS($this->content
);
153 // If no access or if ID == zero
154 $this->doc
= t3lib_div
::makeInstance('mediumDoc');
155 $this->doc
->backPath
= $BACK_PATH;
157 $this->content
.=$this->doc
->startPage($LANG->getLL('title'));
158 $this->content
.=$this->doc
->header($LANG->getLL('title'));
159 $this->content
.=$this->doc
->spacer(5);
160 $this->content
.=$this->doc
->spacer(10);
161 $this->content
.= $this->doc
->endPage();
162 $this->content
= $this->doc
->insertStylesAndJS($this->content
);
167 * Print module content (from $this->content)
171 function printContent() {
172 $this->content
= $this->doc
->insertStylesAndJS($this->content
);
177 * Create the panel of buttons for submitting the form or otherwise perform operations.
179 * @return array all available buttons as an assoc. array
181 protected function getButtons() {
182 global $TCA, $LANG, $BACK_PATH, $BE_USER;
191 $buttons['csh'] = t3lib_BEfunc
::cshItem('_MOD_web_info', '', $GLOBALS['BACK_PATH'], '', TRUE);
194 $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc
::viewOnClick($this->pageinfo
['uid'], $BACK_PATH, t3lib_BEfunc
::BEgetRootLine($this->pageinfo
['uid']))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', 1) . '">' .
195 t3lib_iconWorks
::getSpriteIcon('actions-document-view') .
199 if ($BE_USER->mayMakeShortcut()) {
200 $buttons['shortcut'] = $this->doc
->makeShortcutIcon('id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', implode(',', array_keys($this->MOD_MENU
)), $this->MCONF
['name']);
203 // If access to Web>List for user, then link to that module.
204 if ($BE_USER->check('modules','web_list')) {
205 $href = $BACK_PATH . 'db_list.php?id=' . $this->pageinfo
['uid'] . '&returnUrl=' . rawurlencode(t3lib_div
::getIndpEnv('REQUEST_URI'));
206 $buttons['record_list'] = '<a href="' . htmlspecialchars($href) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList', 1) . '">' .
207 t3lib_iconWorks
::getSpriteIcon('actions-system-list-open') .
215 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE
]['XCLASS']['typo3/mod/web/info/index.php']) {
216 include_once($TYPO3_CONF_VARS[TYPO3_MODE
]['XCLASS']['typo3/mod/web/info/index.php']);
222 $SOBE = t3lib_div
::makeInstance('SC_mod_web_info_index');
226 foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
227 $SOBE->checkExtObj(); // Checking for first level external objects
229 // Repeat Include files! - if any files has been added by second-level extensions
230 foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
231 $SOBE->checkSubExtObj(); // Checking second level external objects
234 $SOBE->printContent();