TYPO3 API  SVNRelease
example_typolinkpop.php
Go to the documentation of this file.
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  * Typo Link PopUp EXAMPLE!
00029  *
00030  * $Id: example_typolinkpop.php 5165 2009-03-09 18:28:59Z ohader $
00031  * Revised for TYPO3 3.6 June/2003 by Kasper Skårhøj
00032  * XHTML compliant
00033  *
00034  * @author  Kasper Skårhøj <kasperYYYY@typo3.com>
00035  */
00036 
00037 
00038 
00039 
00040 
00041 
00042 
00043 
00044 
00045 
00046 
00047 
00048 
00049 
00050 /**
00051  * Demonstrates how to make typolink tags (<link ...>) open in a pop-up window
00052  *
00053  * Example can be found in the testsite package at the page-path "/Intro/TypoScript examples/Small Tricks/Making Pop-up links/"
00054  * This TypoScript configuration will also demonstrate it:
00055  *
00056  * tt_content.text.20.parseFunc.tags.link.typolink.userFunc = user_typoLinkPopUp
00057  * includeLibs.popup = media/scripts/example_typolinkpop.php
00058  * config.setJS_openPic = 1
00059  *
00060  * page = PAGE
00061  * page.10 < styles.content.get
00062  *
00063  * (Plus the "content (default)" static template included as well)
00064  *
00065  * @param   array       In this case: An array with data you can use for processing; keys "url" and "aTagParams" contains something at least
00066  * @param   array       TypoScript array with custom properties for this function call.
00067  * @return  string      Return the new <a> tag
00068  * @see tslib_cObj::typoLink()
00069  */
00070 function user_typoLinkPopUp($content,$conf) {
00071     $aOnClick = 'openPic(\''.$GLOBALS['TSFE']->baseUrlWrap($content['url']).'\',\'popupwin\',\'width=400,height=500,status=0,menubar=0\'); return false;';
00072     $TAG =  '<a href="#" onclick="'.htmlspecialchars($aOnClick).'"'.$content['aTagParams'].'>';
00073     return $TAG;
00074 }
00075 
00076 
00077 ?>