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: Advanced functions
00029  * Advanced Functions related to pages
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  *   71: class SC_mod_web_func_index extends t3lib_SCbase
00043  *   84:     function main()
00044  *  172:     function printContent()
00045  *
00046  * TOTAL FUNCTIONS: 2
00047  * (This index is automatically created/updated by the extension "extdeveval")
00048  *
00049  */
00050 
00051 
00052 unset($MCONF);
00053 require('conf.php');
00054 require($BACK_PATH.'init.php');
00055 require($BACK_PATH.'template.php');
00056 $LANG->includeLLFile('EXT:lang/locallang_mod_web_func.xml');
00057 require_once(PATH_t3lib.'class.t3lib_scbase.php');
00058 require_once (PATH_t3lib.'class.t3lib_parsehtml.php');
00059 
00060 $BE_USER->modAccess($MCONF,1);
00061 
00062 
00063 
00064 /**
00065  * Script Class for the Web > Functions module
00066  * This class creates the framework to which other extensions can connect their sub-modules
00067  *
00068  * @author  Kasper Skaarhoj <kasperYYYY@typo3.com>
00069  * @package TYPO3
00070  * @subpackage core
00071  */
00072 class SC_mod_web_func_index extends t3lib_SCbase {
00073 
00074         // Internal, dynamic:
00075     var $pageinfo;
00076     var $fileProcessor;
00077 
00078     /**
00079      * Document Template Object
00080      *
00081      * @var mediumDoc
00082      */
00083     var $doc;
00084 
00085 
00086 
00087     /**
00088      * Initialize module header etc and call extObjContent function
00089      *
00090      * @return  void
00091      */
00092     function main() {
00093         global $BE_USER,$LANG,$BACK_PATH;
00094 
00095         // Access check...
00096         // The page will show only if there is a valid page and if this page may be viewed by the user
00097         $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
00098         $access = is_array($this->pageinfo) ? 1 : 0;
00099 
00100             // Template markers
00101         $markers = array(
00102             'CSH' => '',
00103             'FUNC_MENU' => '',
00104             'CONTENT' => ''
00105         );
00106 
00107         $this->doc = t3lib_div::makeInstance('template');
00108         $this->doc->backPath = $BACK_PATH;
00109         $this->doc->setModuleTemplate('templates/func.html');
00110 
00111         // **************************
00112         // Main
00113         // **************************
00114         if ($this->id && $access)   {
00115                 // JavaScript
00116             $this->doc->JScode = $this->doc->wrapScriptTags('
00117                 script_ended = 0;
00118                 function jumpToUrl(URL) {   //
00119                     window.location.href = URL;
00120                 }
00121             ');
00122             $this->doc->postCode=$this->doc->wrapScriptTags('
00123                 script_ended = 1;
00124                 if (top.fsMod) top.fsMod.recentIds["web"] = '.intval($this->id).';
00125             ');
00126 
00127 
00128                 // Setting up the context sensitive menu:
00129             $this->doc->getContextMenuCode();
00130 
00131             $this->doc->form='<form action="index.php" method="post"><input type="hidden" name="id" value="'.$this->id.'" />';
00132 
00133             $vContent = $this->doc->getVersionSelector($this->id,1);
00134             if ($vContent)  {
00135                 $this->content.=$this->doc->section('',$vContent);
00136             }
00137 
00138 
00139             $this->extObjContent();
00140 
00141                 // Setting up the buttons and markers for docheader
00142             $docHeaderButtons = $this->getButtons();
00143             $markers['CSH'] = $docHeaderButtons['csh'];
00144             $markers['FUNC_MENU'] = t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']);
00145             $markers['CONTENT'] = $this->content;
00146         } else {
00147                 // If no access or if ID == zero
00148             $this->content = $this->doc->section($LANG->getLL('title'), $LANG->getLL('clickAPage_content'), 0, 1);
00149 
00150                 // Setting up the buttons and markers for docheader
00151             $docHeaderButtons = $this->getButtons();
00152             $markers['CSH'] = $docHeaderButtons['csh'];
00153             $markers['CONTENT'] = $this->content;
00154         }
00155             // Build the <body> for the module
00156         $this->content = $this->doc->startPage($LANG->getLL('title'));
00157         $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
00158         $this->content.= $this->doc->endPage();
00159         $this->content = $this->doc->insertStylesAndJS($this->content);
00160     }
00161 
00162     /**
00163      * Print module content (from $this->content)
00164      *
00165      * @return  void
00166      */
00167     function printContent() {
00168         echo $this->content;
00169     }
00170 
00171     /**
00172      * Create the panel of buttons for submitting the form or otherwise perform operations.
00173      *
00174      * @return  array   all available buttons as an assoc. array
00175      */
00176     protected function getButtons() {
00177         global $TCA, $LANG, $BACK_PATH, $BE_USER;
00178 
00179         $buttons = array(
00180             'csh' => '',
00181             'view' => '',
00182             'record_list' => '',
00183             'shortcut' => '',
00184         );
00185             // CSH
00186         $buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_web_func', '', $GLOBALS['BACK_PATH'], '', TRUE);
00187 
00188         if($this->id && is_array($this->pageinfo)) {
00189 
00190                 // View page
00191             $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->pageinfo['uid'], $BACK_PATH, t3lib_BEfunc::BEgetRootLine($this->pageinfo['uid']))) . '">' .
00192                     '<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="" />' .
00193                     '</a>';
00194 
00195                 // Shortcut
00196             if ($BE_USER->mayMakeShortcut())    {
00197                 $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']);
00198             }
00199 
00200                 // If access to Web>List for user, then link to that module.
00201             if ($BE_USER->check('modules','web_list'))  {
00202                 $href = $BACK_PATH . 'db_list.php?id=' . $this->pageinfo['uid'] . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'));
00203                 $buttons['record_list'] = '<a href="' . htmlspecialchars($href) . '">' .
00204                         '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/list.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList', 1) . '" alt="" />' .
00205                         '</a>';
00206             }
00207         }
00208 
00209         return $buttons;
00210     }
00211 }
00212 
00213 
00214 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/web/func/index.php'])    {
00215     include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/web/func/index.php']);
00216 }
00217 
00218 
00219 
00220 // Make instance:
00221 $SOBE = t3lib_div::makeInstance('SC_mod_web_func_index');
00222 $SOBE->init();
00223 
00224 // Include files?
00225 foreach($SOBE->include_once as $INC_FILE)   include_once($INC_FILE);
00226 $SOBE->checkExtObj();   // Checking for first level external objects
00227 
00228 // Repeat Include files! - if any files has been added by second-level extensions
00229 foreach($SOBE->include_once as $INC_FILE)   include_once($INC_FILE);
00230 $SOBE->checkSubExtObj();    // Checking second level external objects
00231 
00232 $SOBE->main();
00233 $SOBE->printContent();
00234 
00235 ?>

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