Documentation TYPO3 par Ameos

class.tx_impexp_clickmenu.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 ***************************************************************/
00067 class tx_impexp_clickmenu {
00068 
00079         function main(&$backRef,$menuItems,$table,$uid) {
00080                 global $BE_USER,$TCA;
00081 
00082                 $localItems=array();
00083                 if (($backRef->cmLevel && t3lib_div::_GP('subname')=='moreoptions') || ($table==='pages' && $uid==0))   {       // Show import/export on second level menu OR root level.
00084 
00085                         $LL = $this->includeLL();
00086 
00087                         $url = 'mod.php?M=xMOD_tximpexp&tx_impexp[action]=export';
00088                         if ($table=='pages')    {
00089                                 $url.='&tx_impexp[pagetree][id]='.$uid;
00090                                 $url.='&tx_impexp[pagetree][levels]=0';
00091                                 $url.='&tx_impexp[pagetree][tables][]=_ALL';
00092                         } else {
00093                                 $url.='&tx_impexp[record][]='.rawurlencode($table.':'.$uid);
00094                                 $url.='&tx_impexp[external_ref][tables][]=_ALL';
00095                         }
00096                         $localItems[] = $backRef->linkItem(
00097                                 $GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLLL('export',$LL)),
00098                                 $backRef->excludeIcon('<img'.t3lib_iconWorks::skinImg($backRef->backPath,t3lib_extMgm::extRelPath('impexp').'export.gif','width="18" height="16"').' alt="" />'),
00099                                 $backRef->urlRefForCM($url),
00100                                 1       // Disables the item in the top-bar
00101                         );
00102 
00103                         if ($table=='pages')    {
00104                                 $url = 'mod.php?M=xMOD_tximpexp&id='.$uid.'&table='.$table.'&tx_impexp[action]=import';
00105                                 $localItems[] = $backRef->linkItem(
00106                                         $GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLLL('import',$LL)),
00107                                         $backRef->excludeIcon('<img'.t3lib_iconWorks::skinImg($backRef->backPath,t3lib_extMgm::extRelPath('impexp').'import.gif','width="18" height="16"').' alt="" />'),
00108                                         $backRef->urlRefForCM($url),
00109                                         1       // Disables the item in the top-bar
00110                                 );
00111                         }
00112                 }
00113                 return array_merge($menuItems,$localItems);
00114         }
00115 
00121         function includeLL()    {
00122                 global $LANG;
00123 
00124                 return $LANG->includeLLFile('EXT:impexp/app/locallang.php',FALSE);
00125         }
00126 }
00127 
00128 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/impexp/class.tx_impexp_clickmenu.php'])        {
00129         include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/impexp/class.tx_impexp_clickmenu.php']);
00130 }
00131 ?>


Généré par TYPO3 Ameos avec  doxygen 1.4.6