Main Page | Directories | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages | Examples

example_itemArrayProcFunc.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2004 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 ***************************************************************/
00075 function user_itemArrayProcFuncTest($menuArr,$conf)   {
00076    if ($conf['demoItemStates'])  {     // Used in the example of item states
00077       reset($menuArr);
00078       $c=0;
00079       $teststates=explode(',','NO,ACT,IFSUB,CUR,USR,SPC,USERDEF1,USERDEF2');
00080       while(list($k,$v)=each($menuArr))   {
00081          $menuArr[$k]['ITEM_STATE']=$teststates[$c];
00082          $menuArr[$k]['title'].= ($teststates[$c] ? ' ['.$teststates[$c].']' : '');
00083          $c++;
00084       }
00085    } else { // used in the fake menu item example!
00086       if (!count($menuArr))   {     // There must be no menu items if we add the parent page to the submenu:
00087          $parentPageId = $conf['parentObj']->id;   // id of the parent page
00088          $parentPageRow = $GLOBALS['TSFE']->sys_page->getPage($parentPageId); // ... and get the record...
00089          if (is_array($parentPageRow)) {  // ... and if that page existed (a row was returned) then add it!
00090             $menuArr[]=$parentPageRow;
00091          }
00092       }
00093    }
00094    return $menuArr;
00095 }
00096 
00105 function user_IProcFuncTest($I,$conf)  {
00106    $itemRow = $conf['parentObj']->menuArr[$I['key']];
00107 
00108       // Setting the document status content to the value of the page title on mouse over
00109    $I['linkHREF']['onMouseover'].='extraRollover(\''.rawurlencode($itemRow['title']).'\');';
00110    $conf['parentObj']->I = $I;
00111    $conf['parentObj']->setATagParts();
00112    $I = $conf['parentObj']->I;
00113    if ($I['parts']['ATag_begin'])   $I['parts']['ATag_begin']=$I['A1'];
00114 
00115    if ($conf['debug'])  {
00116          // Outputting for debug example:
00117       echo 'ITEM: <h2>'.htmlspecialchars($itemRow['uid'].': '.$itemRow['title']).'</h2>';
00118       t3lib_div::debug($itemRow);
00119       t3lib_div::debug($I);
00120       echo '<hr />';
00121    }
00122       // Returns:
00123    return $I;
00124 }
00125 
00126 
00127 ?>

Generated on Sun Oct 3 01:06:00 2004 for TYPO3core 3.7.0 dev by  doxygen 1.3.8-20040913