"TYPO3 4.0.1: typo3_src-4.0.1/typo3/sysext/info_pagetsconfig/class.tx_infopagetsconfig_webinfo.php Source File", "datetime" => "Sat Dec 2 19:22:33 2006", "date" => "2 Dec 2006", "doxygenversion" => "1.4.6", "projectname" => "TYPO3 4.0.1", "projectnumber" => "4.0.1" ); get_header($doxygen_vars); ?>

class.tx_infopagetsconfig_webinfo.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 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                 );
00104 
00105                 if (!$GLOBALS['BE_USER']->isAdmin())    unset($modMenuAdd['tsconf_parts'][99]);
00106                 return $modMenuAdd;
00107         }
00108 
00114         function main() {
00115                 global $LANG;
00116 
00117                 $menu = t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[tsconf_parts]',$this->pObj->MOD_SETTINGS['tsconf_parts'],$this->pObj->MOD_MENU['tsconf_parts']);
00118 
00119                 if ($this->pObj->MOD_SETTINGS['tsconf_parts']==99)      {
00120                         $TSparts = t3lib_BEfunc::getPagesTSconfig($this->pObj->id,'',1);
00121                         $lines = array();
00122                         $pUids = array();
00123 
00124                         foreach($TSparts as $k => $v)   {
00125                                 if ($k!='uid_0')        {
00126                                         if ($k=='defaultPageTSconfig')  {
00127                                                 $pTitle = '<strong>'.$GLOBALS['LANG']->getLL('editTSconfig_default',1).'</strong>';
00128                                                 $editIcon = '';
00129                                         } else {
00130                                                 $pUids[] = substr($k,4);
00131                                                 $row = t3lib_BEfunc::getRecordWSOL('pages',substr($k,4));
00132                                                 $pTitle = $this->pObj->doc->getHeader('pages',$row,'',0);
00133 
00134                                                 $editIdList = substr($k,4);
00135                                                 $params = '&edit[pages]['.$editIdList.']=edit&columnsOnly=TSconfig';
00136                                                 $onclickUrl = t3lib_BEfunc::editOnClick($params,$GLOBALS['BACK_PATH'],'');
00137                                                 $editIcon = '<a href="#" onclick="'.htmlspecialchars($onclickUrl).'">'.
00138                                                                 '<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="" />'.
00139                                                                 '</a>';
00140                                         }
00141 
00142                                         $TScontent = nl2br(htmlspecialchars(trim($v).chr(10)));
00143 
00144                                         $tsparser = t3lib_div::makeInstance('t3lib_TSparser');
00145                                         $tsparser->lineNumberOffset=0;
00146                                         $TScontent = $tsparser->doSyntaxHighlight(trim($v).chr(10),'',1);
00147 
00148                                         $lines[]='
00149                                                 <tr><td nowrap="nowrap" class="bgColor5">'.$pTitle.'</td></tr>
00150                                                 <tr><td nowrap="nowrap" class="bgColor4">'.$TScontent.$editIcon.'</td></tr>
00151                                                 <tr><td>&nbsp;</td></tr>
00152                                         ';
00153                                 }
00154                         }
00155 
00156                         if (count($pUids))      {
00157                                 $params = '&edit[pages]['.implode(',',$pUids).']=edit&columnsOnly=TSconfig';
00158                                 $onclickUrl = t3lib_BEfunc::editOnClick($params,$GLOBALS['BACK_PATH'],'');
00159                                 $editIcon = '<a href="#" onclick="'.htmlspecialchars($onclickUrl).'">'.
00160                                                 '<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="" />'.
00161                                                 '<strong>'.$GLOBALS['LANG']->getLL('editTSconfig_all',1).'</strong>'.
00162                                                 '</a>';
00163                         } else $editIcon = '';
00164 
00165 
00166                         $theOutput.= $this->pObj->doc->section($LANG->getLL('tsconf_title'),
00167                                 t3lib_BEfunc::cshItem('_MOD_'.$GLOBALS['MCONF']['name'],'tsconfig_edit',$GLOBALS['BACK_PATH'],'|<br/>').
00168                                         $menu.
00169                                         '
00170                                         <br /><br />
00171 
00172                                         <!-- Edit fields: -->
00173                                         <table border="0" cellpadding="0" cellspacing="1">'.implode('',$lines).'</table><br/>'.$editIcon,
00174                                 0,
00175                                 1
00176                         );
00177                 } else {
00178                         $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext');  // Defined global here!
00179                         $tmpl->tt_track = 0;    // Do not log time-performance information
00180 
00181                         $tmpl->fixedLgd = 0;
00182                         $tmpl->linkObjects = 0;
00183                         $tmpl->bType = '';
00184                         $tmpl->ext_expandAllNotes = 1;
00185                         $tmpl->ext_noPMicons = 1;
00186 
00187                         switch($this->pObj->MOD_SETTINGS['tsconf_parts'])       {
00188                                 case '1':
00189                                         $modTSconfig = t3lib_BEfunc::getModTSconfig($this->pObj->id,'mod');
00190                                 break;
00191                                 case '1a':
00192                                         $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_layout',t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
00193                                 break;
00194                                 case '1b':
00195                                         $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_view',t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
00196                                 break;
00197                                 case '1c':
00198                                         $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_modules',t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
00199                                 break;
00200                                 case '1d':
00201                                         $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_list',t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
00202                                 break;
00203                                 case '1e':
00204                                         $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_info',t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
00205                                 break;
00206                                 case '1f':
00207                                         $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_func',t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
00208                                 break;
00209                                 case '1g':
00210                                         $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_ts',t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
00211                                 break;
00212                                 case '2':
00213                                         $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('RTE',t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
00214                                 break;
00215                                 case '5':
00216                                         $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('TCEFORM',t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
00217                                 break;
00218                                 case '6':
00219                                         $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('TCEMAIN',t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
00220                                 break;
00221                                 case '3':
00222                                         $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('TSFE',t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
00223                                 break;
00224                                 case '4':
00225                                         $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('user',t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
00226                                 break;
00227                                 default:
00228                                         $modTSconfig['properties'] = t3lib_BEfunc::getPagesTSconfig($this->pObj->id);
00229                                 break;
00230                         }
00231                         $modTSconfig = $modTSconfig['properties'];
00232 
00233                         if (!is_array($modTSconfig))    $modTSconfig = array();
00234 
00235                         $theOutput.= $this->pObj->doc->section($LANG->getLL('tsconf_title'),
00236                                         t3lib_BEfunc::cshItem('_MOD_'.$GLOBALS['MCONF']['name'],'tsconfig_hierarchy',$GLOBALS['BACK_PATH'],'|<br/>').
00237                                         $menu.
00238                                         '
00239 
00240                                         <!-- Page TSconfig Tree: -->
00241                                         <table border="0" cellpadding="0" cellspacing="0">
00242                                                 <tr>
00243                                                         <td nowrap="nowrap">'.$tmpl->ext_getObjTree($modTSconfig,'','').'</td>
00244                                                 </tr>
00245                                         </table>',
00246                                 0,
00247                                 1
00248                         );
00249                 }
00250 
00251                         // Return output:
00252                 return $theOutput;
00253         }
00254 }
00255 
00256 
00257 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/info_pagetsconfig/class.tx_infopagetsconfig_webinfo.php'])     {
00258         include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/info_pagetsconfig/class.tx_infopagetsconfig_webinfo.php']);
00259 }
00260 ?>