|
TYPO3 API
SVNRelease
|
00001 <?php 00002 /*************************************************************** 00003 * Copyright notice 00004 * 00005 * (c) 1999-2011 Kasper Skårhøj (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 ***************************************************************/ 00027 /** 00028 * Demonstrates how to manipulate menu generation so that a click on a menu item will trigger two (or more) frames to load an URL 00029 * Used in the "testsite" package 00030 * 00031 * $Id: example_keepRollover.php 5165 2009-03-09 18:28:59Z ohader $ 00032 * Revised for TYPO3 3.6 June/2003 by Kasper Skårhøj 00033 * XHTML compliant 00034 * 00035 * @author Kasper Skårhøj <kasperYYYY@typo3.com> 00036 */ 00037 00038 00039 00040 00041 00042 00043 00044 /** 00045 * Example can be found in the testsite package at the page-path "/Intro/TypoScript examples/Menu object examples/Loading multiple.../" 00046 * 00047 * @param array The menu item array, $this->I (in the parent object) 00048 * @param array TypoScript configuration for the function. Notice that the property "parentObj" is a reference to the parent (calling) object (the tslib_Xmenu class instantiated) 00049 * @return array The processed $I array returned (and stored in $this->I of the parent object again) 00050 * @see tslib_menu::userProcess(), tslib_tmenu::writeMenu(), tslib_gmenu::writeMenu() 00051 */ 00052 function user_keepRolloverAtOnClick($I,$conf) { 00053 $itemRow = $conf['parentObj']->menuArr[$I['key']]; 00054 00055 // Setting the document status content to the value of the page title on mouse over 00056 if (!$I['linkHREF']['TARGET']) { 00057 $I['linkHREF']['HREF']='#'; 00058 $I['linkHREF']['onClick'].='ARO_setLocation'.($conf['setLocation']).'('.$itemRow['uid'].',\''.$I['theName'].'\'); return false;'; 00059 } else { 00060 $I['linkHREF']['onClick'].='ARO_setActiveImg'.'(\''.$I['theName'].'\');'; 00061 } 00062 if ($I['linkHREF']['onMouseover']) $I['linkHREF']['onMouseover']='ARO_'.$I['linkHREF']['onMouseover']; 00063 if ($I['linkHREF']['onMouseout']) $I['linkHREF']['onMouseout']='ARO_'.$I['linkHREF']['onMouseout']; 00064 00065 if ($conf['parentObj']->isActive($itemRow['uid'])) { 00066 $conf['parentObj']->WMextraScript.=' 00067 <script type="text/javascript"> 00068 /*<![CDATA[*/ 00069 ARO_Image = "'.$I['theName'].'"; 00070 '.$I['linkHREF']['onMouseover'].' 00071 /*]]>*/ 00072 </script> 00073 '; 00074 } 00075 00076 // Update the link in the parent object: 00077 $conf['parentObj']->I = $I; // setting internal $I - needed by setATagParts() function! 00078 $conf['parentObj']->setATagParts(); // Setting the A1 and A2 of the internal $I 00079 $I = $conf['parentObj']->I; // retrieving internal $I 00080 $I['parts']['ATag_begin']=$I['A1']; // Setting the ATag_begin to the value of this $I 00081 00082 // Debug: 00083 if ($conf['debug']) { 00084 // Outputting for debug example: 00085 echo 'ITEM: <h2>'.htmlspecialchars($itemRow['uid'].': '.$itemRow['title']).'</h2>'; 00086 t3lib_utility_Debug::debug($itemRow); 00087 t3lib_utility_Debug::debug($I); 00088 echo '<hr />'; 00089 } 00090 00091 // Returns $I: 00092 return $I; 00093 } 00094 00095 ?>
1.8.0