Documentation TYPO3 par Ameos |
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 require_once(PATH_t3lib.'class.t3lib_tsparser_ext.php'); 00050 require_once(PATH_t3lib.'class.t3lib_extobjbase.php'); 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00074 class tx_infopagetsconfig_webinfo extends t3lib_extobjbase { 00075 00076 00082 function modMenu() { 00083 global $LANG; 00084 00085 $modMenuAdd = array( 00086 'tsconf_parts' => array( 00087 0 => $LANG->getLL('tsconf_parts_0'), 00088 1 => $LANG->getLL('tsconf_parts_1'), 00089 '1a' => $LANG->getLL('tsconf_parts_1a'), 00090 '1b' => $LANG->getLL('tsconf_parts_1b'), 00091 '1c' => $LANG->getLL('tsconf_parts_1c'), 00092 '1d' => $LANG->getLL('tsconf_parts_1d'), 00093 '1e' => $LANG->getLL('tsconf_parts_1e'), 00094 '1f' => $LANG->getLL('tsconf_parts_1f'), 00095 '1g' => $LANG->getLL('tsconf_parts_1g'), 00096 2 => 'RTE.', 00097 5 => 'TCEFORM.', 00098 6 => 'TCEMAIN.', 00099 3 => 'TSFE.', 00100 4 => 'user.', 00101 99 => $LANG->getLL('tsconf_configFields') 00102 ), 00103 'tsconf_alphaSort' => '1', 00104 ); 00105 00106 if (!$GLOBALS['BE_USER']->isAdmin()) unset($modMenuAdd['tsconf_parts'][99]); 00107 return $modMenuAdd; 00108 } 00109 00115 function main() { 00116 global $LANG; 00117 00118 $menu = t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[tsconf_parts]',$this->pObj->MOD_SETTINGS['tsconf_parts'],$this->pObj->MOD_MENU['tsconf_parts']); 00119 $menu .= '<br /><label for="checkTsconf_alphaSort">Sort alphabetically:</label> '.t3lib_BEfunc::getFuncCheck($this->pObj->id,'SET[tsconf_alphaSort]',$this->pObj->MOD_SETTINGS['tsconf_alphaSort'],'','','id="checkTsconf_alphaSort"'); 00120 $menu .= '<br /><br />'; 00121 00122 if ($this->pObj->MOD_SETTINGS['tsconf_parts']==99) { 00123 $TSparts = t3lib_BEfunc::getPagesTSconfig($this->pObj->id,'',1); 00124 $lines = array(); 00125 $pUids = array(); 00126 00127 foreach($TSparts as $k => $v) { 00128 if ($k!='uid_0') { 00129 if ($k=='defaultPageTSconfig') { 00130 $pTitle = '<strong>'.$GLOBALS['LANG']->getLL('editTSconfig_default',1).'</strong>'; 00131 $editIcon = ''; 00132 } else { 00133 $pUids[] = substr($k,4); 00134 $row = t3lib_BEfunc::getRecordWSOL('pages',substr($k,4)); 00135 $pTitle = $this->pObj->doc->getHeader('pages',$row,'',0); 00136 00137 $editIdList = substr($k,4); 00138 $params = '&edit[pages]['.$editIdList.']=edit&columnsOnly=TSconfig'; 00139 $onclickUrl = t3lib_BEfunc::editOnClick($params,$GLOBALS['BACK_PATH'],''); 00140 $editIcon = '<a href="#" onclick="'.htmlspecialchars($onclickUrl).'">'. 00141 '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/edit2.gif','width="11" height="12"').' vspace="2" align="top" title="'.$GLOBALS['LANG']->getLL('editTSconfig',1).'" alt="" />'. 00142 '</a>'; 00143 } 00144 00145 $TScontent = nl2br(htmlspecialchars(trim($v).chr(10))); 00146 00147 $tsparser = t3lib_div::makeInstance('t3lib_TSparser'); 00148 $tsparser->lineNumberOffset=0; 00149 $TScontent = $tsparser->doSyntaxHighlight(trim($v).chr(10),'',1); 00150 00151 $lines[]=' 00152 <tr><td nowrap="nowrap" class="bgColor5">'.$pTitle.'</td></tr> 00153 <tr><td nowrap="nowrap" class="bgColor4">'.$TScontent.$editIcon.'</td></tr> 00154 <tr><td> </td></tr> 00155 '; 00156 } 00157 } 00158 00159 if (count($pUids)) { 00160 $params = '&edit[pages]['.implode(',',$pUids).']=edit&columnsOnly=TSconfig'; 00161 $onclickUrl = t3lib_BEfunc::editOnClick($params,$GLOBALS['BACK_PATH'],''); 00162 $editIcon = '<a href="#" onclick="'.htmlspecialchars($onclickUrl).'">'. 00163 '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/edit2.gif','width="11" height="12"').' vspace="2" align="top" title="'.$GLOBALS['LANG']->getLL('editTSconfig_all',1).'" alt="" />'. 00164 '<strong>'.$GLOBALS['LANG']->getLL('editTSconfig_all',1).'</strong>'. 00165 '</a>'; 00166 } else $editIcon = ''; 00167 00168 00169 $theOutput.= $this->pObj->doc->section($LANG->getLL('tsconf_title'), 00170 t3lib_BEfunc::cshItem('_MOD_'.$GLOBALS['MCONF']['name'],'tsconfig_edit',$GLOBALS['BACK_PATH'],'|<br/>'). 00171 $menu. 00172 ' 00173 <br /><br /> 00174 00175 <!-- Edit fields: --> 00176 <table border="0" cellpadding="0" cellspacing="1">'.implode('',$lines).'</table><br/>'.$editIcon, 00177 0, 00178 1 00179 ); 00180 } else { 00181 $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext'); // Defined global here! 00182 $tmpl->tt_track = 0; // Do not log time-performance information 00183 00184 $tmpl->fixedLgd = 0; 00185 $tmpl->linkObjects = 0; 00186 $tmpl->bType = ''; 00187 $tmpl->ext_expandAllNotes = 1; 00188 $tmpl->ext_noPMicons = 1; 00189 00190 switch($this->pObj->MOD_SETTINGS['tsconf_parts']) { 00191 case '1': 00192 $modTSconfig = t3lib_BEfunc::getModTSconfig($this->pObj->id,'mod'); 00193 break; 00194 case '1a': 00195 $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_layout',t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); 00196 break; 00197 case '1b': 00198 $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_view',t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); 00199 break; 00200 case '1c': 00201 $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_modules',t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); 00202 break; 00203 case '1d': 00204 $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_list',t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); 00205 break; 00206 case '1e': 00207 $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_info',t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); 00208 break; 00209 case '1f': 00210 $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_func',t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); 00211 break; 00212 case '1g': 00213 $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_ts',t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); 00214 break; 00215 case '2': 00216 $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('RTE',t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); 00217 break; 00218 case '5': 00219 $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('TCEFORM',t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); 00220 break; 00221 case '6': 00222 $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('TCEMAIN',t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); 00223 break; 00224 case '3': 00225 $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('TSFE',t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); 00226 break; 00227 case '4': 00228 $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('user',t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); 00229 break; 00230 default: 00231 $modTSconfig['properties'] = t3lib_BEfunc::getPagesTSconfig($this->pObj->id); 00232 break; 00233 } 00234 $modTSconfig = $modTSconfig['properties']; 00235 00236 if (!is_array($modTSconfig)) $modTSconfig = array(); 00237 00238 $theOutput.= $this->pObj->doc->section($LANG->getLL('tsconf_title'), 00239 t3lib_BEfunc::cshItem('_MOD_'.$GLOBALS['MCONF']['name'],'tsconfig_hierarchy',$GLOBALS['BACK_PATH'],'|<br/>'). 00240 $menu. 00241 ' 00242 00243 <!-- Page TSconfig Tree: --> 00244 <table border="0" cellpadding="0" cellspacing="0"> 00245 <tr> 00246 <td nowrap="nowrap">'.$tmpl->ext_getObjTree($modTSconfig,'','','','',$this->pObj->MOD_SETTINGS['tsconf_alphaSort']).'</td> 00247 </tr> 00248 </table>', 00249 0, 00250 1 00251 ); 00252 } 00253 00254 // Return output: 00255 return $theOutput; 00256 } 00257 } 00258 00259 00260 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/info_pagetsconfig/class.tx_infopagetsconfig_webinfo.php']) { 00261 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/info_pagetsconfig/class.tx_infopagetsconfig_webinfo.php']); 00262 } 00263 ?>