Documentation TYPO3 par Ameos

index.php

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *  
00005 *  (c) 1999-2004 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 ***************************************************************/
00036 unset($MCONF);
00037 require ("conf.php");
00038 require ($BACK_PATH."init.php");
00039 //require ($BACK_PATH."template.php");
00040 require_once (PATH_t3lib."class.t3lib_page.php");
00041 $BE_USER->modAccess($MCONF,1);
00042 
00043 
00044 
00045 // ***************************
00046 // Script Classes
00047 // ***************************
00048 class SC_mod_web_view_index {
00049         var $MCONF=array();
00050         var $MOD_MENU=array();
00051         var $MOD_SETTINGS=array();
00052 
00053         var $perms_clause;
00054         var $modTSconfig;
00055         var $type;
00056         var $pageinfo;
00057         var $url;
00058         var $id;
00059 
00060         function init() {
00061                 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
00062                 $this->MCONF = $GLOBALS["MCONF"];
00063                 $this->id = intval(t3lib_div::_GP("id"));
00064                 
00065                 $this->perms_clause = $BE_USER->getPagePermsClause(1);
00066                 
00067                         // page/be_user TSconfig settings and blinding of menu-items
00068                 $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id,"mod.".$this->MCONF["name"]);
00069                 $this->type = intval($this->modTSconfig["properties"]["type"]);
00070         }
00071         function main() {
00072                 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
00073                 // Access check...
00074                 // The page will show only if there is a valid page and if this page may be viewed by the user
00075                 $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
00076                 $access = is_array($this->pageinfo) ? 1 : 0;
00077                 $addCmd="";
00078                 if ($this->id && $access)       {
00079                         $addCmd = "&ADMCMD_view=1&ADMCMD_editIcons=1".t3lib_BEfunc::ADMCMD_previewCmds($this->pageinfo);
00080                 }
00081                 
00082                 $parts = parse_url(t3lib_div::getIndpEnv("TYPO3_SITE_URL"));
00083                 $dName = t3lib_BEfunc::getDomainStartPage($parts["host"],$parts["path"]) ?
00084                                                 t3lib_BEfunc::firstDomainRecord(t3lib_BEfunc::BEgetRootLine($this->id)):
00085                                                 "";
00086                 
00087                 $this->url.= ($dName?"http://".$dName:$BACK_PATH."..")."/index.php?id=".$this->id.($this->type?"&type=".$this->type:"").$addCmd;
00088                 //debug($this->url);
00089         }
00090         function printContent() {
00091                 Header("Location: ".t3lib_div::locationHeaderUrl($this->url));
00092         }
00093 }
00094 
00095 // Include extension?
00096 if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/viewpage/view/index.php"])     {
00097         include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/viewpage/view/index.php"]);
00098 }
00099 
00100 
00101 
00102 
00103 
00104 
00105 
00106 
00107 
00108 
00109 
00110 
00111 // Make instance:
00112 $SOBE = t3lib_div::makeInstance("SC_mod_web_view_index");
00113 $SOBE->init();
00114 $SOBE->main();
00115 $SOBE->printContent();
00116 ?>


Généré par L'expert TYPO3 avec  doxygen 1.4.6