<?php include_once '../doc-typo3-funcs.php'; $doxygen_vars = array( "title" => "TYPO3 4.0.1: typo3_src-4.0.1/t3lib/class.t3lib_scbase.php Source File", "datetime" => "Sat Dec 2 19:22:18 2006", "date" => "2 Dec 2006", "doxygenversion" => "1.4.6", "projectname" => "TYPO3 4.0.1", "projectnumber" => "4.0.1" ); get_header($doxygen_vars); ?> <!-- Generated by Doxygen 1.4.6 --> <div class="tabs"> <ul> <li><a href="main.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="classes.html"><span>Classes</span></a></li> <li id="current"><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> <li> <form action="search.php" method="get"> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td><label> <u>S</u>earch for </label></td> <td><input type="text" name="query" value="" size="20" accesskey="s"/></td> </tr> </table> </form> </li> </ul></div> <div class="nav"> <a class="el" href="dir_c8daf1ad746050abf985cc546c89e248.html">typo3_src-4.0.1</a> » <a class="el" href="dir_9d0e5c424a38b69aeeedc616a9634e5f.html">t3lib</a></div> <h1>class.t3lib_scbase.php</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <?php <a name="l00002"></a>00002 <span class="comment">/***************************************************************</span> <a name="l00003"></a>00003 <span class="comment">* Copyright notice</span> <a name="l00004"></a>00004 <span class="comment">*</span> <a name="l00005"></a>00005 <span class="comment">* (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)</span> <a name="l00006"></a>00006 <span class="comment">* All rights reserved</span> <a name="l00007"></a>00007 <span class="comment">*</span> <a name="l00008"></a>00008 <span class="comment">* This script is part of the TYPO3 project. The TYPO3 project is</span> <a name="l00009"></a>00009 <span class="comment">* free software; you can redistribute it and/or modify</span> <a name="l00010"></a>00010 <span class="comment">* it under the terms of the GNU General Public License as published by</span> <a name="l00011"></a>00011 <span class="comment">* the Free Software Foundation; either version 2 of the License, or</span> <a name="l00012"></a>00012 <span class="comment">* (at your option) any later version.</span> <a name="l00013"></a>00013 <span class="comment">*</span> <a name="l00014"></a>00014 <span class="comment">* The GNU General Public License can be found at</span> <a name="l00015"></a>00015 <span class="comment">* http://www.gnu.org/copyleft/gpl.html.</span> <a name="l00016"></a>00016 <span class="comment">* A copy is found in the textfile GPL.txt and important notices to the license</span> <a name="l00017"></a>00017 <span class="comment">* from the author is found in LICENSE.txt distributed with these scripts.</span> <a name="l00018"></a>00018 <span class="comment">*</span> <a name="l00019"></a>00019 <span class="comment">*</span> <a name="l00020"></a>00020 <span class="comment">* This script is distributed in the hope that it will be useful,</span> <a name="l00021"></a>00021 <span class="comment">* but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00022"></a>00022 <span class="comment">* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> <a name="l00023"></a>00023 <span class="comment">* GNU General Public License for more details.</span> <a name="l00024"></a>00024 <span class="comment">*</span> <a name="l00025"></a>00025 <span class="comment">* This copyright notice MUST APPEAR in all copies of the script!</span> <a name="l00026"></a>00026 <span class="comment">***************************************************************/</span> <a name="l00133"></a><a class="code" href="classt3lib__SCbase.html">00133</a> <span class="keyword">class </span><a class="code" href="classt3lib__SCbase.html">t3lib_SCbase</a> { <a name="l00134"></a>00134 <a name="l00139"></a><a class="code" href="classt3lib__SCbase.html#4626a22e4c6c8ae1943811f4c9241833">00139</a> var <a class="code" href="classt3lib__SCbase.html#4626a22e4c6c8ae1943811f4c9241833">$MCONF</a> = array(); <a name="l00140"></a>00140 <a name="l00145"></a><a class="code" href="classt3lib__SCbase.html#0447d43ab6f9dc2f70b6f775a34e20f2">00145</a> var <a class="code" href="classt3lib__SCbase.html#0447d43ab6f9dc2f70b6f775a34e20f2">$id</a>; <a name="l00146"></a>00146 <a name="l00151"></a><a class="code" href="classt3lib__SCbase.html#586399280ad150c01c107c3b34754871">00151</a> var <a class="code" href="classt3lib__SCbase.html#586399280ad150c01c107c3b34754871">$CMD</a>; <a name="l00152"></a>00152 <a name="l00157"></a><a class="code" href="classt3lib__SCbase.html#8980f0d4d1f1c6410fb37ce976f0cab9">00157</a> var <a class="code" href="classt3lib__SCbase.html#8980f0d4d1f1c6410fb37ce976f0cab9">$perms_clause</a>; <a name="l00158"></a>00158 <a name="l00159"></a>00159 <a name="l00160"></a>00160 <a name="l00165"></a><a class="code" href="classt3lib__SCbase.html#a768303f3850b31a833147c9193719be">00165</a> var <a class="code" href="classt3lib__SCbase.html#a768303f3850b31a833147c9193719be">$MOD_MENU</a> = Array ( <a name="l00166"></a>00166 'function' => array() <a name="l00167"></a>00167 ); <a name="l00168"></a>00168 <a name="l00173"></a><a class="code" href="classt3lib__SCbase.html#1c7c3b842fe044d9b1974b69729e03c7">00173</a> var <a class="code" href="classt3lib__SCbase.html#1c7c3b842fe044d9b1974b69729e03c7">$MOD_SETTINGS</a> = array(); <a name="l00174"></a>00174 <a name="l00179"></a><a class="code" href="classt3lib__SCbase.html#9becb91c80230ee6ac6d11d0e796f0a5">00179</a> var <a class="code" href="classt3lib__SCbase.html#9becb91c80230ee6ac6d11d0e796f0a5">$modTSconfig</a>; <a name="l00180"></a>00180 <a name="l00187"></a><a class="code" href="classt3lib__SCbase.html#338b8b3c5ba1297ae906c6728d834418">00187</a> var <a class="code" href="classt3lib__SCbase.html#338b8b3c5ba1297ae906c6728d834418">$modMenu_type</a> = ''; <a name="l00188"></a>00188 <a name="l00195"></a><a class="code" href="classt3lib__SCbase.html#7c895025f24bca57438bef4c3ee353b5">00195</a> var <a class="code" href="classt3lib__SCbase.html#7c895025f24bca57438bef4c3ee353b5">$modMenu_dontValidateList</a> = ''; <a name="l00196"></a>00196 <a name="l00203"></a><a class="code" href="classt3lib__SCbase.html#478206d6f35334519a3b9cee641b0057">00203</a> var <a class="code" href="classt3lib__SCbase.html#478206d6f35334519a3b9cee641b0057">$modMenu_setDefaultList</a> = ''; <a name="l00204"></a>00204 <a name="l00210"></a><a class="code" href="classt3lib__SCbase.html#f46e231b8b9552db0fcb871489786e90">00210</a> var <a class="code" href="classt3lib__SCbase.html#f46e231b8b9552db0fcb871489786e90">$extClassConf</a>; <a name="l00211"></a>00211 <a name="l00217"></a><a class="code" href="classt3lib__SCbase.html#1f086af5c2c11bde823f8e35da48af73">00217</a> var <a class="code" href="classt3lib__SCbase.html#1f086af5c2c11bde823f8e35da48af73">$include_once</a> = array(); <a name="l00218"></a>00218 <a name="l00222"></a><a class="code" href="classt3lib__SCbase.html#974b9470af0eaf94898e35c81dafb736">00222</a> var <a class="code" href="classt3lib__SCbase.html#974b9470af0eaf94898e35c81dafb736">$content</a> = ''; <a name="l00223"></a>00223 <a name="l00227"></a><a class="code" href="classt3lib__SCbase.html#9c58c66ec87579349c5d13b1b27a2b67">00227</a> var <a class="code" href="classt3lib__SCbase.html#9c58c66ec87579349c5d13b1b27a2b67">$doc</a>; <a name="l00228"></a>00228 <a name="l00234"></a><a class="code" href="classt3lib__SCbase.html#ba2922df813939f549238915f43066d7">00234</a> var <a class="code" href="classt3lib__SCbase.html#ba2922df813939f549238915f43066d7">$extObj</a>; <a name="l00235"></a>00235 <a name="l00236"></a>00236 <a name="l00237"></a>00237 <a name="l00238"></a>00238 <a name="l00239"></a>00239 <a name="l00240"></a>00240 <a name="l00241"></a>00241 <a name="l00242"></a>00242 <a name="l00249"></a><a class="code" href="classt3lib__SCbase.html#d8182d4745a524e6a07513acbc3b00bc">00249</a> function <a class="code" href="classt3lib__SCbase.html#d8182d4745a524e6a07513acbc3b00bc">init</a>() { <a name="l00250"></a>00250 <span class="comment">// name might be set from outside</span> <a name="l00251"></a>00251 <span class="keywordflow">if</span> (!$this->MCONF['name']) { <a name="l00252"></a>00252 $this->MCONF = $GLOBALS['MCONF']; <a name="l00253"></a>00253 } <a name="l00254"></a>00254 $this-><span class="keywordtype">id</span> = intval(<a class="code" href="classt3lib__div.html#016d2190758279b2dbb953826c690118">t3lib_div::_GP</a>('<span class="keywordtype">id</span>')); <a name="l00255"></a>00255 $this->CMD = <a class="code" href="classt3lib__div.html#016d2190758279b2dbb953826c690118">t3lib_div::_GP</a>('CMD'); <a name="l00256"></a>00256 $this->perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1); <a name="l00257"></a>00257 $this-><a class="code" href="classt3lib__SCbase.html#cc3a85e8b8ec6f4375b4f69cb5e31082">menuConfig</a>(); <a name="l00258"></a>00258 $this-><a class="code" href="classt3lib__SCbase.html#2c5016c8d40d7bba6d672bba5d8c8df5">handleExternalFunctionValue</a>(); <a name="l00259"></a>00259 } <a name="l00260"></a>00260 <a name="l00269"></a><a class="code" href="classt3lib__SCbase.html#cc3a85e8b8ec6f4375b4f69cb5e31082">00269</a> function <a class="code" href="classt3lib__SCbase.html#cc3a85e8b8ec6f4375b4f69cb5e31082">menuConfig</a>() { <a name="l00270"></a>00270 <span class="comment">// page/be_user TSconfig settings and blinding of menu-items</span> <a name="l00271"></a>00271 $this->modTSconfig = <a class="code" href="classt3lib__BEfunc.html#3e3f63eb1c3bb4ae0d5ad009dea00cc5">t3lib_BEfunc::getModTSconfig</a>($this-><span class="keywordtype">id</span>,'mod.'.$this->MCONF['name']); <a name="l00272"></a>00272 $this->MOD_MENU['function'] = $this-><a class="code" href="classt3lib__SCbase.html#125f6944a49c3e47590fe56aecc44612">mergeExternalItems</a>($this->MCONF['name'],'function',$this->MOD_MENU['function']); <a name="l00273"></a>00273 $this->MOD_MENU['function'] = <a class="code" href="classt3lib__BEfunc.html#5eff2813bae095fe73110aafc0133b58">t3lib_BEfunc::unsetMenuItems</a>($this->modTSconfig['properties'],$this->MOD_MENU['function'],'menu.function'); <a name="l00274"></a>00274 <a name="l00275"></a>00275 <span class="preprocessor"> #debug($this->MOD_MENU['function'],$this->MCONF['name']);</span> <a name="l00276"></a>00276 <span class="preprocessor"></span><span class="preprocessor"> #debug($this->modTSconfig['properties']);</span> <a name="l00277"></a>00277 <span class="preprocessor"></span> <a name="l00278"></a>00278 <span class="comment">// CLEANSE 'function' SETTINGS</span> <a name="l00279"></a>00279 $this->MOD_SETTINGS = <a class="code" href="classt3lib__BEfunc.html#d5b55158accbc63f6bb71de27e03f708">t3lib_BEfunc::getModuleData</a>($this->MOD_MENU, <a class="code" href="classt3lib__div.html#016d2190758279b2dbb953826c690118">t3lib_div::_GP</a>('SET'), $this->MCONF['name'], $this->modMenu_type, $this->modMenu_dontValidateList, $this->modMenu_setDefaultList); <a name="l00280"></a>00280 } <a name="l00281"></a>00281 <a name="l00292"></a><a class="code" href="classt3lib__SCbase.html#125f6944a49c3e47590fe56aecc44612">00292</a> function <a class="code" href="classt3lib__SCbase.html#125f6944a49c3e47590fe56aecc44612">mergeExternalItems</a>($modName,$menuKey,$menuArr) { <a name="l00293"></a>00293 $mergeArray = $GLOBALS['TBE_MODULES_EXT'][$modName]['MOD_MENU'][$menuKey]; <a name="l00294"></a>00294 <span class="keywordflow">if</span> (is_array($mergeArray)) { <a name="l00295"></a>00295 reset($mergeArray); <a name="l00296"></a>00296 <span class="keywordflow">while</span>(list($k,$v)=each($mergeArray)) { <a name="l00297"></a>00297 <span class="keywordflow">if</span> ((string)$v['ws']==='' || <a name="l00298"></a>00298 ($GLOBALS['BE_USER']->workspace===0 && <a class="code" href="classt3lib__div.html#d994a5608365c288d051d6022d4e9976">t3lib_div::inList</a>($v['ws'],'online')) || <a name="l00299"></a>00299 ($GLOBALS['BE_USER']->workspace===-1 && <a class="code" href="classt3lib__div.html#d994a5608365c288d051d6022d4e9976">t3lib_div::inList</a>($v['ws'],'offline')) || <a name="l00300"></a>00300 ($GLOBALS['BE_USER']->workspace>0 && <a class="code" href="classt3lib__div.html#d994a5608365c288d051d6022d4e9976">t3lib_div::inList</a>($v['ws'],'custom'))) { <a name="l00301"></a>00301 $menuArr[$k]=$GLOBALS['LANG']->sL($v['title']); <a name="l00302"></a>00302 } <a name="l00303"></a>00303 } <a name="l00304"></a>00304 } <a name="l00305"></a>00305 <span class="keywordflow">return</span> $menuArr; <a name="l00306"></a>00306 } <a name="l00307"></a>00307 <a name="l00317"></a><a class="code" href="classt3lib__SCbase.html#2c5016c8d40d7bba6d672bba5d8c8df5">00317</a> function <a class="code" href="classt3lib__SCbase.html#2c5016c8d40d7bba6d672bba5d8c8df5">handleExternalFunctionValue</a>($MM_key='function', $MS_value=NULL) { <a name="l00318"></a>00318 $MS_value = is_null($MS_value) ? $this->MOD_SETTINGS[$MM_key] : $MS_value; <a name="l00319"></a>00319 $this->extClassConf = $this-><a class="code" href="classt3lib__SCbase.html#482d3d987e457cbf1e4fec04075d4115">getExternalItemConfig</a>($this->MCONF['name'],$MM_key,$MS_value); <a name="l00320"></a>00320 <span class="keywordflow">if</span> (is_array($this->extClassConf) && $this->extClassConf['path']) { <a name="l00321"></a>00321 $this->include_once[]=$this->extClassConf['path']; <a name="l00322"></a>00322 } <a name="l00323"></a>00323 } <a name="l00324"></a>00324 <a name="l00335"></a><a class="code" href="classt3lib__SCbase.html#482d3d987e457cbf1e4fec04075d4115">00335</a> function <a class="code" href="classt3lib__SCbase.html#482d3d987e457cbf1e4fec04075d4115">getExternalItemConfig</a>($modName,$menuKey,$value='') { <a name="l00336"></a>00336 <span class="keywordflow">return</span> strcmp($value,'')?$GLOBALS['TBE_MODULES_EXT'][$modName]['MOD_MENU'][$menuKey][$value]:$GLOBALS['TBE_MODULES_EXT'][$modName]['MOD_MENU'][$menuKey]; <a name="l00337"></a>00337 } <a name="l00338"></a>00338 <a name="l00349"></a><a class="code" href="classt3lib__SCbase.html#1f95f4bcd6f7282f78801280202173e8">00349</a> function <a class="code" href="classt3lib__SCbase.html#1f95f4bcd6f7282f78801280202173e8">checkExtObj</a>() { <a name="l00350"></a>00350 <span class="keywordflow">if</span> (is_array($this->extClassConf) && $this->extClassConf['name']) { <a name="l00351"></a>00351 $this->extObj = <a class="code" href="classt3lib__div.html#b47f8a8e8be44b79a0b8064dcd427bc1">t3lib_div::makeInstance</a>($this->extClassConf['name']); <a name="l00352"></a>00352 $this->extObj->init($this,$this->extClassConf); <a name="l00353"></a>00353 <span class="comment">// Re-write:</span> <a name="l00354"></a>00354 $this->MOD_SETTINGS = <a class="code" href="classt3lib__BEfunc.html#d5b55158accbc63f6bb71de27e03f708">t3lib_BEfunc::getModuleData</a>($this->MOD_MENU, <a class="code" href="classt3lib__div.html#016d2190758279b2dbb953826c690118">t3lib_div::_GP</a>('SET'), $this->MCONF['name']); <a name="l00355"></a>00355 } <a name="l00356"></a>00356 } <a name="l00357"></a>00357 <a name="l00363"></a><a class="code" href="classt3lib__SCbase.html#ce68f7f0762e4714743310e3e9a96c5b">00363</a> function <a class="code" href="classt3lib__SCbase.html#ce68f7f0762e4714743310e3e9a96c5b">checkSubExtObj</a>() { <a name="l00364"></a>00364 <span class="keywordflow">if</span> (is_object($this->extObj)) $this->extObj->checkExtObj(); <a name="l00365"></a>00365 } <a name="l00366"></a>00366 <a name="l00375"></a><a class="code" href="classt3lib__SCbase.html#814af90956d97146b033698e300e834c">00375</a> function <a class="code" href="classt3lib__SCbase.html#814af90956d97146b033698e300e834c">extObjHeader</a>() { <a name="l00376"></a>00376 <span class="keywordflow">if</span> (is_callable(array($this->extObj,'head'))) $this->extObj->head(); <a name="l00377"></a>00377 } <a name="l00378"></a>00378 <a name="l00384"></a><a class="code" href="classt3lib__SCbase.html#7734b0d1e351d161e03a54f811e0d63b">00384</a> function <a class="code" href="classt3lib__SCbase.html#7734b0d1e351d161e03a54f811e0d63b">extObjContent</a>() { <a name="l00385"></a>00385 $this->extObj->pObj = &$this; <a name="l00386"></a>00386 <span class="keywordflow">if</span> (is_callable(array($this->extObj, 'main'))) $this->content.=$this->extObj->main(); <a name="l00387"></a>00387 } <a name="l00388"></a>00388 } <a name="l00389"></a>00389 ?> </pre></div><?php include_once '../doc-typo3-funcs.php'; get_footer(); ?>