index.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2010 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: View
00029  *
00030  * Views the webpage
00031  *
00032  * @author  Kasper Skårhøj <kasperYYYY@typo3.com>
00033  */
00034 /**
00035  * [CLASS/FUNCTION INDEX of SCRIPT]
00036  *
00037  *
00038  *
00039  *   65: class SC_mod_web_view_index
00040  *   83:     function init()
00041  *  101:     function main()
00042  *  127:     function printContent()
00043  *
00044  * TOTAL FUNCTIONS: 3
00045  * (This index is automatically created/updated by the extension "extdeveval")
00046  *
00047  */
00048 
00049 unset($MCONF);
00050 require ('conf.php');
00051 require ($BACK_PATH.'init.php');
00052 //require ($BACK_PATH.'template.php');
00053 $BE_USER->modAccess($MCONF,1);
00054 
00055 
00056 
00057 /**
00058  * Script Class for the Web > View
00059  *
00060  * @author  Kasper Skaarhoj <kasperYYYY@typo3.com>
00061  * @package TYPO3
00062  * @subpackage core
00063  */
00064 class SC_mod_web_view_index {
00065     var $MCONF=array();
00066     var $MOD_MENU=array();
00067     var $MOD_SETTINGS=array();
00068 
00069     var $perms_clause;
00070     var $modTSconfig;
00071     var $type;
00072     var $pageinfo;
00073     var $url;
00074     var $id;
00075     var $wsInstruction='';
00076 
00077     /**
00078      * Initialization of module
00079      *
00080      * @return  void
00081      */
00082     function init() {
00083         global $BE_USER;
00084 
00085         $this->MCONF = $GLOBALS['MCONF'];
00086         $this->id = intval(t3lib_div::_GP('id'));
00087 
00088         $this->perms_clause = $BE_USER->getPagePermsClause(1);
00089 
00090             // page/be_user TSconfig settings and blinding of menu-items
00091         $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id,'mod.'.$this->MCONF['name']);
00092         $this->type = intval($this->modTSconfig['properties']['type']);
00093     }
00094 
00095     /**
00096      * Main function
00097      *
00098      * @return  void
00099      */
00100     function main() {
00101         global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
00102 
00103             // Access check...
00104             // The page will show only if there is a valid page and if this page may be viewed by the user
00105         $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
00106         $access = is_array($this->pageinfo) ? 1 : 0;
00107         $addCmd='';
00108         if ($this->id && $access)   {
00109             $addCmd = '&ADMCMD_view=1&ADMCMD_editIcons=1'.t3lib_BEfunc::ADMCMD_previewCmds($this->pageinfo);
00110         }
00111 
00112         $parts = parse_url(t3lib_div::getIndpEnv('TYPO3_SITE_URL'));
00113         $dName = t3lib_BEfunc::getDomainStartPage($parts['host'],$parts['path']) ?
00114                         t3lib_BEfunc::firstDomainRecord(t3lib_BEfunc::BEgetRootLine($this->id)):
00115                         '';
00116 
00117             // preview of mount pages
00118         $sys_page = t3lib_div::makeInstance('t3lib_pageSelect');
00119         $sys_page->init(FALSE);
00120         $mountPointInfo = $sys_page->getMountPointInfo($this->id);
00121         if ($mountPointInfo && $mountPointInfo['overlay']) {
00122             $this->id = $mountPointInfo['mount_pid'];
00123             $addCmd .= '&MP=' . $mountPointInfo['MPvar'];
00124         }
00125 
00126         $this->url.= ($dName?(t3lib_div::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://').$dName:$BACK_PATH.'..').'/index.php?id='.$this->id.($this->type?'&type='.$this->type:'').$addCmd;
00127     }
00128 
00129     /**
00130      * Redirect URL
00131      *
00132      * @return  void
00133      */
00134     function printContent() {
00135         t3lib_utility_Http::redirect($this->url);
00136     }
00137 }
00138 
00139 
00140 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/viewpage/view/index.php']) {
00141     include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/viewpage/view/index.php']);
00142 }
00143 
00144 
00145 
00146 // Make instance:
00147 $SOBE = t3lib_div::makeInstance('SC_mod_web_view_index');
00148 $SOBE->init();
00149 $SOBE->main();
00150 $SOBE->printContent();
00151 
00152 ?>

Generated on Sat Jul 24 04:17:16 2010 for TYPO3 API by  doxygen 1.4.7