Documentation TYPO3 par Ameos

index.php

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2005 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 ***************************************************************/
00049 unset($MCONF);
00050 require ("conf.php");
00051 require ($BACK_PATH."init.php");
00052 //require ($BACK_PATH."template.php");
00053 require_once (PATH_t3lib."class.t3lib_page.php");
00054 $BE_USER->modAccess($MCONF,1);
00055 
00056 
00057 
00065 class SC_mod_web_view_index {
00066         var $MCONF=array();
00067         var $MOD_MENU=array();
00068         var $MOD_SETTINGS=array();
00069 
00070         var $perms_clause;
00071         var $modTSconfig;
00072         var $type;
00073         var $pageinfo;
00074         var $url;
00075         var $id;
00076 
00080         function init() {
00081                 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
00082                 $this->MCONF = $GLOBALS["MCONF"];
00083                 $this->id = intval(t3lib_div::_GP("id"));
00084 
00085                 $this->perms_clause = $BE_USER->getPagePermsClause(1);
00086 
00087                         // page/be_user TSconfig settings and blinding of menu-items
00088                 $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id,"mod.".$this->MCONF["name"]);
00089                 $this->type = intval($this->modTSconfig["properties"]["type"]);
00090         }
00091 
00097         function main() {
00098                 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
00099                 // Access check...
00100                 // The page will show only if there is a valid page and if this page may be viewed by the user
00101                 $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
00102                 $access = is_array($this->pageinfo) ? 1 : 0;
00103                 $addCmd="";
00104                 if ($this->id && $access)       {
00105                         $addCmd = "&ADMCMD_view=1&ADMCMD_editIcons=1".t3lib_BEfunc::ADMCMD_previewCmds($this->pageinfo);
00106                 }
00107 
00108                 $parts = parse_url(t3lib_div::getIndpEnv("TYPO3_SITE_URL"));
00109                 $dName = t3lib_BEfunc::getDomainStartPage($parts["host"],$parts["path"]) ?
00110                                                 t3lib_BEfunc::firstDomainRecord(t3lib_BEfunc::BEgetRootLine($this->id)):
00111                                                 "";
00112 
00113                 $this->url.= ($dName?(t3lib_div::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://').$dName:$BACK_PATH."..")."/index.php?id=".$this->id.($this->type?"&type=".$this->type:"").$addCmd;
00114                 //debug($this->url);
00115         }
00116 
00122         function printContent() {
00123                 Header("Location: ".t3lib_div::locationHeaderUrl($this->url));
00124         }
00125 }
00126 
00127 // Include extension?
00128 if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/viewpage/view/index.php"])     {
00129         include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/viewpage/view/index.php"]);
00130 }
00131 
00132 
00133 
00134 
00135 
00136 
00137 
00138 
00139 
00140 
00141 
00142 
00143 // Make instance:
00144 $SOBE = t3lib_div::makeInstance("SC_mod_web_view_index");
00145 $SOBE->init();
00146 $SOBE->main();
00147 $SOBE->printContent();
00148 ?>


Généré par TYPO3 Ameos avec  doxygen 1.4.6