index.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2008 Kasper Skaarhoj (kasperYYYY@typo3.com)
00006 *  All rights reserved
00007 *
00008 *  This script is part of the TYPO3 project. The TYPO3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *  A copy is found in the textfile GPL.txt and important notices to the license
00017 *  from the author is found in LICENSE.txt distributed with these scripts.
00018 *
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
00027 /**
00028  * Module: Web>Info
00029  * Presents various page related information from extensions
00030  *
00031  * $Id: index.php 4433 2008-11-07 04:13:12Z flyguide $
00032  * Revised for TYPO3 3.6 November/2003 by Kasper Skaarhoj
00033  * XHTML compliant
00034  *
00035  * @author  Kasper Skaarhoj <kasperYYYY@typo3.com>
00036  */
00037 /**
00038  * [CLASS/FUNCTION INDEX of SCRIPT]
00039  *
00040  *
00041  *
00042  *   70: class SC_mod_web_info_index extends t3lib_SCbase
00043  *   82:     function main()
00044  *  178:     function printContent()
00045  *
00046  * TOTAL FUNCTIONS: 2
00047  * (This index is automatically created/updated by the extension "extdeveval")
00048  *
00049  */
00050 
00051 unset($MCONF);
00052 require('conf.php');
00053 require($BACK_PATH.'init.php');
00054 require($BACK_PATH.'template.php');
00055 $LANG->includeLLFile('EXT:lang/locallang_mod_web_info.xml');
00056 require_once (PATH_t3lib.'class.t3lib_scbase.php');
00057 require_once (PATH_t3lib.'class.t3lib_parsehtml.php');
00058 
00059 $BE_USER->modAccess($MCONF,1);
00060 
00061 
00062 
00063 /**
00064  * Script Class for the Web > Info module
00065  * This class creates the framework to which other extensions can connect their sub-modules
00066  *
00067  * @author  Kasper Skaarhoj <kasperYYYY@typo3.com>
00068  * @package TYPO3
00069  * @subpackage core
00070  */
00071 class SC_mod_web_info_index extends t3lib_SCbase {
00072 
00073         // Internal, dynamic:
00074     var $be_user_Array;
00075     var $CALC_PERMS;
00076     var $pageinfo;
00077 
00078     /**
00079      * Document Template Object
00080      *
00081      * @var mediumDoc
00082      */
00083     var $doc;
00084 
00085     /**
00086      * Initialize module header etc and call extObjContent function
00087      *
00088      * @return  void
00089      */
00090     function main() {
00091         global $BE_USER,$LANG,$BACK_PATH;
00092 
00093         // Access check...
00094         // The page will show only if there is a valid page and if this page may be viewed by the user
00095         $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
00096         $access = is_array($this->pageinfo) ? 1 : 0;
00097 
00098         if (($this->id && $access) || ($BE_USER->user['admin'] && !$this->id))  {
00099             $this->CALC_PERMS = $BE_USER->calcPerms($this->pageinfo);
00100             if ($BE_USER->user['admin'] && !$this->id)  {
00101                 $this->pageinfo=array('title' => '[root-level]','uid'=>0,'pid'=>0);
00102             }
00103 
00104             $this->doc = t3lib_div::makeInstance('template');
00105             $this->doc->backPath = $BACK_PATH;
00106             $this->doc->setModuleTemplate('templates/info.html');
00107             $this->doc->tableLayout = Array (
00108                 '0' => Array (
00109                     '0' => Array('<td valign="top"><b>','</b></td>'),
00110                     "defCol" => Array('<td><img src="'.$this->doc->backPath.'clear.gif" width="10" height="1" alt="" /></td><td valign="top"><b>','</b></td>')
00111                 ),
00112                 "defRow" => Array (
00113                     "0" => Array('<td valign="top">','</td>'),
00114                     "defCol" => Array('<td><img src="'.$this->doc->backPath.'clear.gif" width="10" height="1" alt="" /></td><td valign="top">','</td>')
00115                 )
00116             );
00117 
00118                 // JavaScript
00119             $this->doc->JScode = $this->doc->wrapScriptTags('
00120                 script_ended = 0;
00121                 function jumpToUrl(URL) {   //
00122                     window.location.href = URL;
00123                 }
00124             ');
00125             $this->doc->postCode = $this->doc->wrapScriptTags('
00126                 script_ended = 1;
00127                 if (top.fsMod) top.fsMod.recentIds["web"] = '.intval($this->id).';
00128             ');
00129 
00130                 // Setting up the context sensitive menu:
00131             $this->doc->getContextMenuCode();
00132             $this->doc->form = '<form action="index.php" method="post" name="webinfoForm">';
00133 
00134             $vContent = $this->doc->getVersionSelector($this->id,1);
00135             if ($vContent)  {
00136                 $this->content.=$this->doc->section('',$vContent);
00137             }
00138 
00139             $this->extObjContent();
00140 
00141                 // Setting up the buttons and markers for docheader
00142             $docHeaderButtons = $this->getButtons();
00143             $markers = array(
00144                 'CSH' => $docHeaderButtons['csh'],
00145                 'FUNC_MENU' => t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']),
00146                 'CONTENT' => $this->content
00147             );
00148 
00149                 // Build the <body> for the module
00150             $this->content = $this->doc->startPage($LANG->getLL('title'));
00151             $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
00152             $this->content.= $this->doc->endPage();
00153             $this->content = $this->doc->insertStylesAndJS($this->content);
00154         } else {
00155                 // If no access or if ID == zero
00156             $this->doc = t3lib_div::makeInstance('mediumDoc');
00157             $this->doc->backPath = $BACK_PATH;
00158 
00159             $this->content.=$this->doc->startPage($LANG->getLL('title'));
00160             $this->content.=$this->doc->header($LANG->getLL('title'));
00161             $this->content.=$this->doc->spacer(5);
00162             $this->content.=$this->doc->spacer(10);
00163             $this->content.= $this->doc->endPage();
00164             $this->content = $this->doc->insertStylesAndJS($this->content);
00165         }
00166     }
00167 
00168     /**
00169      * Print module content (from $this->content)
00170      *
00171      * @return  void
00172      */
00173     function printContent() {
00174         $this->content = $this->doc->insertStylesAndJS($this->content);
00175         echo $this->content;
00176     }
00177 
00178     /**
00179      * Create the panel of buttons for submitting the form or otherwise perform operations.
00180      *
00181      * @return  array   all available buttons as an assoc. array
00182      */
00183     protected function getButtons() {
00184         global $TCA, $LANG, $BACK_PATH, $BE_USER;
00185 
00186         $buttons = array(
00187             'csh' => '',
00188             'view' => '',
00189             'record_list' => '',
00190             'shortcut' => '',
00191         );
00192             // CSH
00193         $buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_web_info', '', $GLOBALS['BACK_PATH'], '', TRUE);
00194 
00195             // View page
00196         $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->pageinfo['uid'], $BACK_PATH, t3lib_BEfunc::BEgetRootLine($this->pageinfo['uid']))) . '">' .
00197                 '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/zoom.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', 1) . '" hspace="3" alt="" />' .
00198                 '</a>';
00199 
00200             // Shortcut
00201         if ($BE_USER->mayMakeShortcut())    {
00202             $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']);
00203         }
00204 
00205             // If access to Web>List for user, then link to that module.
00206         if ($BE_USER->check('modules','web_list'))  {
00207             $href = $BACK_PATH . 'db_list.php?id=' . $this->pageinfo['uid'] . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'));
00208             $buttons['record_list'] = '<a href="' . htmlspecialchars($href) . '">' .
00209                     '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/list.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList', 1) . '" alt="" />' .
00210                     '</a>';
00211         }
00212         return $buttons;
00213     }
00214 
00215 }
00216 
00217 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/web/info/index.php'])    {
00218     include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/web/info/index.php']);
00219 }
00220 
00221 
00222 
00223 // Make instance:
00224 $SOBE = t3lib_div::makeInstance('SC_mod_web_info_index');
00225 $SOBE->init();
00226 
00227 // Include files?
00228 foreach($SOBE->include_once as $INC_FILE)   include_once($INC_FILE);
00229 $SOBE->checkExtObj();   // Checking for first level external objects
00230 
00231 // Repeat Include files! - if any files has been added by second-level extensions
00232 foreach($SOBE->include_once as $INC_FILE)   include_once($INC_FILE);
00233 $SOBE->checkSubExtObj();    // Checking second level external objects
00234 
00235 $SOBE->main();
00236 $SOBE->printContent();
00237 
00238 ?>

Generated on Sat Jan 3 04:23:25 2009 for TYPO3 API by  doxygen 1.4.7