Commit 0c34dac0 authored by Michael Stucki's avatar Michael Stucki
Browse files

* Merging all changes from TYPO3_4-0 branch back into HEAD


git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1421 709f56b5-9817-0410-a4d7-c38de5d9e867
parent 5aa2893e
This diff is collapsed.
---------------------------------
The TYPO3 licensing conditions
2003, Kasper Skårhøj (kasper@typo3.com)
Document version 2.00, 24-02-2003
2003-2006, Kasper Skårhøj (kasperYYYY@typo3.com)
Document version 2.02, 03-2006
---------------------------------
The TYPO3 project is free software under the terms of the GNU General Public License.
The GNU/GPL license is found in the file GPL.txt
For information about what this license means and how copyright law applies to a product like TYPO3, please refer to http://typo3.org/1310.0.html
For information about what this license means and how copyright law applies to a product like TYPO3, please refer to http://typo3.com/1316.0.html
......@@ -3,48 +3,94 @@ CHANGES & IMPROVEMENTS in TYPO3 4.0
(for technical details see ChangeLog)
************************************************************************
New features / improvements
===========================
* Workspaces
* indexed search (template support, speed improvements) - many thanks to Udo von Eynern for implementing the template support!
* Integrated kb_cont_slide extension into core
* tab indenting in textareas in the backend
* display of BE clickmenus with XMLHTTP / AJAX
Installation/Upgrade
====================
* TYPO3 4.0 ships with an empty typo3/ext folder. Sites which depend on them must reinstall this extensions.
* TYPO3 4.0 uses a new localization scheme (typo3conf/l10n/). To install language packs use the extension managers function for translation handling. (Exensions csh_<language> are obsolete!)
* TYPO3 4.0 doesn't need symbolic links anymore (on Unix systems); no more duplicate files (on Windows systems)
* Existing symbolic links from index.php to <TYPO3_root>/tslib/index_ts.php must be changed to <TYPO3_src>/index.php (Unix).
* The symbolic links from nimbus.ttf and vera.ttf to arial.ttf and verdana.ttf have been removed. If you need those fonts create the symbolic links manually (Unix) or copy the fonts (Windows).
New features
============
* Workspaces: this new system extension brings offline editing to TYPO3 (using the built-in versioning) - add/change content in a "draft" workspace and publish the changes into the "live" workspace
* DBAL 1.0: this new system extension offers database independence (currently working with Oracle and PostgreSQL)
* The 1-2-3 quick install has been enhanced
* a new update wizard of the installer handles compatibility issues
* the new default RTE (rtehtmlarea) is compatible with more browsers and operating systems (Firefox, Opera; Linux, BSD, Mac OS X)
* "sliding" of content elements similar to TypoScript's getText level* feature (integration of extension "kb_cont_slide" by Bernhard Kraft)
* User admin module: switch back to admin user after user switch (SU-mode), "create new user" link
* Zapped a lot of gremlins
* Update Wizard taking care of non-backwards compatible changes
* System log (eg DB errors; configured via $CONF_VARS['SYS']['systemLog']
* Sharing of sessions between subdomains (configured via $CONF_VARS['SYS']['domainCookie'])
Improvements
============
* the undo and history feature has been enhanced: rollback/preview on page and record level; history includes now inserts and deletes
* improved indexed search (template support, faster) - many thanks to Udo von Eynern for implementing the template support!
* The import/export tool now automatically resolves extension dependencies of T3D files (.t3d)
* the page type "external link" supports HTTPS (thanks to Marc Bastian Heinrichs)
* the extension manager has been overhauled and benefits from new enhancements of TER 2.0
* the GIFBUILDER objects may create true colour images (PNG and JPEG)
* typolinks and HMENUs (type "language") may preserve the query parameters
Usability
=========
* pages can be moved by drag and drop within the page tree (thanks to Stephane Schitter)
* faster context menues (implemented with AJAX)
* fixed fonts are used in BE configuration fields for increased readability
* tab indenting in BE configuration fields for enhanced layout
* files can be created or uploaded with buttons in the Web>List content frame
* improved content element wizard (eg empty categories are removed)
* RTE wizard has now a save-and-close button
* the admin panel uses HTTP GET instead of POST (no more browser warnings when reloading a previewed page)
Access Control
==============
* FE-groups are now nested. Additionally, pages and content elements can have more than one group assigned. (Michael Stucki, integrating extension "fenestgrp" by Glen Gibb and extension "ingmar_accessctrl" by Ingmar Schlecht)
* FE-groups may now be nested (integration of extension "fenestgrp" by Glenn Gibb)
* pages and content elements can have more than one group assigned (integration of extension "ingmar_accessctrl" by Ingmar Schlecht)
Security
=========
* New option for lockSSL: get redirected to standard http after BE login with SSL
Bugfixes
========
Accessibility
=============
* config.disablePrefixComment was ignored by plugins
* When copying a file into the same folder in the "Filelist" module, it is automatically renamed
* TYPO3's output is now valid XHTML (the conforming DTD is configurable)
* the overall DTD and the XHTML-DTD may be set indepenently (config.docytpe and config.xhtmlDoctype)
* output of CSS styled content is now accessible by default (mailforms, menus, sitemaps) - many thanks to Ernesto Baschny, kudos also to Sebastian Kurfuerst and Michael Stucki
* images have accessibility features (integration of extension "cron_cssstyledimgtext" by Ernesto Baschny)
* the "table" content element has now limited accessibility support (integration of extension "accessible_tables" by Rupert Germann)
* indexed search comes with an additional template without any HTML tables - thanks to Robert Markula and Michael Stucki
Usability
=========
Configuration
=============
* on timeout in BE, popup won't appear again after clicking "No"
* made new content element wizard easier to use (removed empty categories)
* RTE wizard has save and close buttons now
* the new := assignment for Typoscript allows now parse time maniplation of TS values (eg "obj.val := appendString(foobar)", "obj.list := addToList(3,5,9)")
* TypoScript conditions may be combined with OR and AND
Accessibility
=============
API
===
* loading of scripts into the default URL with index.php?eID=<key> (using this feature showpic.php has been removed from the TYPO3 root directory)
* TCA form fields may have custom PHP and Javascript evaluation (thanks to Thomas Hempel)
* TCA form fields may be set to readonly (HTML attribute)
* TCA fields of type "none" have new rendering options (date and other formats)
* Direct mail has been removed from the core (t3lib/class.t3lib_dmailer.php)
* the currenty XHTML-DTD setting may be queried via $GLOBALS['TSFE']->xhtmlDoctype
* t3lib_div::sysLog() may be used to log errors
* output of CSS styled content is now accessible by default
* (mailforms, menus, sitemaps)
Notable Bugfixes
================
Speed
=====
* versioning works with all MySQL versions (3.23.x and higher)
* the relogin popup on session timeout in BE won't appear again after clicking "No"
* when copying a file into the same folder in the "Filelist" module, it is automatically renamed
* JSMENU, editPanel and feAdmin works now with multi-byte character sets (eg UTF-8)
* HTML Parsing class got a speed improvement (use faster preg instead of ereg, report bugs with inproperly replaced markers or subparts with previously working setup or TV problems with HTML templates having no problems before at http://bugs.typo3.org/view.php?id=1685)
#!/bin/sh
# This procedure is only needed when you check out the source for the first time ever.
# Create symlink for tslib:
ln -s typo3/sysext/cms/tslib
# Go to typo3/ folder:
cd typo3/
# Create symlinks for t3lib/ and other things:
ln -s ../t3lib
ln -s ../t3lib/thumbs.php
ln -s ../t3lib/gfx
# Finally, go to the t3lib/fonts/ dir:
cd t3lib/fonts/
#Create two symlinks to fonts:
ln -s vera.ttf verdana.ttf
ln -s nimbus.ttf arial.ttf
<?php
/***************************************************************
* Copyright notice
*
* (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* This is the MAIN DOCUMENT of the TypoScript driven standard front-end (from the "cms" extension)
* Basically this is the "index.php" script which all requests for TYPO3 delivered pages goes to in the frontend (the website)
*
* $Id$
*
* @author Ren Fritz <r.fritz@colorcube.de>
* @package TYPO3
* @subpackage tslib
*/
// *******************************
// Set error reporting
// *******************************
error_reporting (E_ALL ^ E_NOTICE);
// ******************
// Constants defined
// ******************
define('PATH_thisScript',str_replace('//','/', str_replace('\\','/', (php_sapi_name()=='cgi'||php_sapi_name()=='isapi' ||php_sapi_name()=='cgi-fcgi')&&($_SERVER['ORIG_PATH_TRANSLATED']?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED'])? ($_SERVER['ORIG_PATH_TRANSLATED']?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED']):($_SERVER['ORIG_SCRIPT_FILENAME']?$_SERVER['ORIG_SCRIPT_FILENAME']:$_SERVER['SCRIPT_FILENAME']))));
define('PATH_site', dirname(PATH_thisScript).'/');
if (@is_dir(PATH_site.'typo3/sysext/cms/tslib/')) {
define('PATH_tslib', PATH_site.'typo3/sysext/cms/tslib/');
} elseif (@is_dir(PATH_site.'tslib/')) {
define('PATH_tslib', PATH_site.'tslib/');
} else {
// define path to tslib/ here:
$configured_tslib_path = '';
// example:
// $configured_tslib_path = '/var/www/mysite/typo3/sysext/cms/tslib/';
define('PATH_tslib', $configured_tslib_path);
}
if (PATH_tslib=='') {
die('Cannot find tslib/. Please set path by defining $configured_tslib_path in '.basename(PATH_thisScript).'.');
}
// ******************
// include TSFE
// ******************
require (PATH_tslib.'index_ts.php');
?>
\ No newline at end of file
......@@ -3,12 +3,7 @@
<meta type="array">
<description>[Insert Title]</description>
<type>[Insert type: module/CSH/database]</type>
<fileId>EXT:[extkey]/[filepath]</fileId>
<csh_table>[first argument of the t3lib_extMgm::addLLrefForTCAdescr() function call including this file inside of ext_tables.php]</csh_table>
<keep_original_text></keep_original_text>
<ext_filename_template>EXT:test_###LANGKEY###/test/###LANGKEY###.locallang_test.xml</ext_filename_template>
<labelContext type="array">
</labelContext>
</meta>
<data type="array">
<languageKey index="default" type="array">
......
......@@ -318,6 +318,7 @@ class gzip_encode {
*/
function freebsd_loadavg() {
$buffer= `uptime`;
$load = array();
ereg("averag(es|e): ([0-9][.][0-9][0-9]), ([0-9][.][0-9][0-9]), ([0-9][.][0-9][0-9]*)", $buffer, $load);
return max((float)$load[2], (float)$load[3], (float)$load[4]);
......
......@@ -2,7 +2,7 @@
/***************************************************************
* Copyright notice
*
* (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
* (c) 1999-2006 Kasper Skaarhoj (kasperYYYY@typo3.com)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
......@@ -26,6 +26,7 @@
***************************************************************/
/**
* Contains a class for evaluation of database integrity according to $TCA
* Most of these functions are considered obsolete!
*
* $Id$
* Revised for TYPO3 3.6 July/2003 by Kasper Skaarhoj
......@@ -38,21 +39,23 @@
*
*
*
* 90: class t3lib_admin
* 116: function genTree($theID, $depthData)
* 156: function lostRecords($pid_list)
* 187: function fixLostRecord($table,$uid)
* 208: function countRecords($pid_list)
* 236: function getGroupFields($mode)
* 270: function getFileFields($uploadfolder)
* 293: function getDBFields($theSearchTable)
* 321: function selectNonEmptyRecordsWithFkeys($fkey_arrays)
* 410: function testFileRefs ()
* 461: function testDBRefs($theArray)
* 499: function whereIsRecordReferenced($searchTable,$id)
* 536: function whereIsFileReferenced($uploadfolder,$filename)
* 93: class t3lib_admin
* 128: function genTree($theID, $depthData, $versions=FALSE)
* 217: function genTree_records($theID, $depthData, $table='', $versions=FALSE)
* 292: function genTreeStatus()
* 315: function lostRecords($pid_list)
* 346: function fixLostRecord($table,$uid)
* 367: function countRecords($pid_list)
* 395: function getGroupFields($mode)
* 429: function getFileFields($uploadfolder)
* 452: function getDBFields($theSearchTable)
* 480: function selectNonEmptyRecordsWithFkeys($fkey_arrays)
* 569: function testFileRefs ()
* 620: function testDBRefs($theArray)
* 658: function whereIsRecordReferenced($searchTable,$id)
* 695: function whereIsFileReferenced($uploadfolder,$filename)
*
* TOTAL FUNCTIONS: 12
* TOTAL FUNCTIONS: 14
* (This index is automatically created/updated by the extension "extdeveval")
*
*/
......@@ -88,65 +91,221 @@
* @subpackage t3lib
*/
class t3lib_admin {
var $genTree_includeDeleted = 1; // if set, genTree() includes deleted pages. This is default.
var $perms_clause=''; // extra where-clauses for the tree-selection
var $genTree_includeDeleted = TRUE; // if set, genTree() includes deleted pages. This is default.
var $genTree_includeVersions = TRUE; // if set, genTree() includes verisonized pages/records. This is default.
var $genTree_includeRecords = FALSE; // if set, genTree() includes records from pages.
var $perms_clause = ''; // extra where-clauses for the tree-selection
var $genTree_makeHTML = 0; // if set, genTree() generates HTML, that visualizes the tree.
// internal
var $genTree_idlist = ''; // Will hold the id-list from genTree()
var $getTree_HTML = ''; // Will hold the HTML-code visualising the tree. genTree()
var $backPath='';
var $page_idArray = Array(); // Will hod id/rec pais from genTree()
var $rec_idArray = Array();
var $getTree_HTML = ''; // Will hold the HTML-code visualising the tree. genTree()
var $backPath = '';
// internal
var $checkFileRefs = Array();
var $checkSelectDBRefs = Array(); // From the select-fields
var $checkGroupDBRefs = Array(); // From the group-fields
var $page_idArray=Array();
var $recStat = Array();
var $recStats = Array(
'allValid' => array(),
'published_versions' => array(),
'deleted' => array(),
);
var $lRecords = Array();
var $lostPagesList = '';
/**
* Generates a list of Page-uid's that corresponds to the tables in the tree. This list should ideally include all records in the pages-table.
*
* @param integer a pid (page-record id) from which to start making the tree
* @param string HTML-code (image-tags) used when this function calls itself recursively.
* @return integer Number of $GLOBALS['TYPO3_DB']->sql_num_rows (most recent query)
* @param boolean Internal variable, don't set from outside!
* @return void
*/
function genTree($theID, $depthData) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'uid,title,doktype,deleted'.(t3lib_extMgm::isLoaded('cms')?',hidden':''),
'pages',
'pid='.intval($theID).' '.((!$this->genTree_includeDeleted)?'AND deleted=0':'').$this->perms_clause,
'',
'sorting'
);
$a=0;
function genTree($theID, $depthData, $versions=FALSE) {
if ($versions) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'uid,title,doktype,deleted,t3ver_wsid,t3ver_id,t3ver_count,t3ver_swapmode'.(t3lib_extMgm::isLoaded('cms')?',hidden':''),
'pages',
'pid=-1 AND t3ver_oid='.intval($theID).' '.((!$this->genTree_includeDeleted)?'AND deleted=0':'').$this->perms_clause,
'',
'sorting'
);
} else {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'uid,title,doktype,deleted'.(t3lib_extMgm::isLoaded('cms')?',hidden':''),
'pages',
'pid='.intval($theID).' '.((!$this->genTree_includeDeleted)?'AND deleted=0':'').$this->perms_clause,
'',
'sorting'
);
}
// Traverse the records selected:
$a = 0;
$c = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
// Prepare the additional label used in the HTML output in case of versions:
if ($versions) {
$versionLabel = '[v1.'.$row['t3ver_id'].'; WS#'.$row['t3ver_wsid'].']';
} else $versionLabel='';
$a++;
$newID =$row['uid'];
$newID = $row['uid'];
// Build HTML output:
if ($this->genTree_makeHTML) {
$this->genTree_HTML.=chr(10).'<div><span class="nobr">';
$PM = 'join';
$LN = ($a==$c)?'blank':'line';
$BTM = ($a==$c)?'bottom':'';
$this->genTree_HTML.= $depthData.'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.$PM.$BTM.'.gif','width="18" height="16"').' align="top" alt="" />'.t3lib_iconWorks::getIconImage('pages',$row,$this->backPath,'align="top"').htmlspecialchars($row['uid'].': '.t3lib_div::fixed_lgd_cs(strip_tags($row['title']),50)).'</span></div>';
$this->genTree_HTML.= $depthData.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.$PM.$BTM.'.gif','width="18" height="16"').' align="top" alt="" />'.
$versionLabel.
t3lib_iconWorks::getIconImage('pages',$row,$this->backPath,'align="top"').
htmlspecialchars($row['uid'].': '.t3lib_div::fixed_lgd_cs(strip_tags($row['title']),50)).'</span></div>';
}
if (isset($page_idlist[$newID])) {
$this->recStat['doublePageID'][]=$newID;
// Register various data for this item:
$this->page_idArray[$newID]=$row;
$this->recStats['all_valid']['pages'][$newID] = $newID;
# if ($versions) $this->recStats['versions']['pages'][$newID] = $newID;
if ($row['deleted']) $this->recStats['deleted']['pages'][$newID] = $newID;
if ($versions && $row['t3ver_count']>=1) {
$this->recStats['published_versions']['pages'][$newID] = $newID;
}
$this->page_idArray[$newID]=$newID;
if ($row['deleted']) {$this->recStat['deleted']++;}
if ($row['hidden']) {$this->recStat['hidden']++;}
$this->recStat['doktype'][$row['doktype']]++;
$this->genTree($newID,$this->genTree_HTML ? $depthData.'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.$LN.'.gif','width="18" height="16"').' align="top" alt="" />' : '');
// Create the HTML code prefix for recursive call:
$genHTML = $depthData.'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.$LN.'.gif','width="18" height="16"').' align="top" alt="" />'.$versionLabel;
// If all records should be shown, do so:
if ($this->genTree_includeRecords) {
foreach($GLOBALS['TCA'] as $tableName => $cfg) {
if ($tableName!='pages') {
$this->genTree_records($newID, $this->genTree_HTML ? $genHTML : '', $tableName);
}
}
}
// Add sub pages:
$this->genTree($newID, $this->genTree_HTML ? $genHTML : '');
// If versions are included in the tree, add those now:
if ($this->genTree_includeVersions) {
$this->genTree($newID, $this->genTree_HTML ? $genHTML : '', TRUE);
}
}
return $GLOBALS['TYPO3_DB']->sql_num_rows($res);
}
/**
* @param [type] $theID: ...
* @param [type] $depthData: ...
* @param [type] $table: ...
* @param [type] $versions: ...
* @return [type] ...
*/
function genTree_records($theID, $depthData, $table='', $versions=FALSE) {
global $TCA;
if ($versions) {
// Select all records from table pointing to this page:
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
t3lib_BEfunc::getCommonSelectFields($table),
$table,
'pid=-1 AND t3ver_oid='.intval($theID).
(!$this->genTree_includeDeleted?t3lib_BEfunc::deleteClause($table):'')
);
} else {
// Select all records from table pointing to this page:
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
t3lib_BEfunc::getCommonSelectFields($table),
$table,
'pid='.intval($theID).
(!$this->genTree_includeDeleted?t3lib_BEfunc::deleteClause($table):'')
);
}
// Traverse selected:
$a = 0;
$c = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
// Prepare the additional label used in the HTML output in case of versions:
if ($versions) {
$versionLabel = '[v1.'.$row['t3ver_id'].'; WS#'.$row['t3ver_wsid'].']';
} else $versionLabel='';
$a++;
$newID = $row['uid'];
// Build HTML output:
if ($this->genTree_makeHTML) {
$this->genTree_HTML.=chr(10).'<div><span class="nobr">';
$PM = 'join';
$LN = ($a==$c)?'blank':'line';
$BTM = ($a==$c)?'bottom':'';
$this->genTree_HTML.= $depthData.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.$PM.$BTM.'.gif','width="18" height="16"').' align="top" alt="" />'.
$versionLabel.
t3lib_iconWorks::getIconImage($table,$row,$this->backPath,'align="top" title="'.$table.'"').htmlspecialchars($row['uid'].': '.t3lib_BEfunc::getRecordTitle($table,$row)).'</span></div>';
}
// Register various data for this item:
$this->rec_idArray[$table][$newID]=$row;
$this->recStats['all_valid'][$table][$newID] = $newID;
# $this->recStats[$versions?'versions':'live'][$table][$newID] = $newID;
if ($row['deleted']) $this->recStats['deleted'][$table][$newID] = $newID;
if ($versions && $row['t3ver_count']>=1 && $row['t3ver_wsid']==0) {
$this->recStats['published_versions'][$table][$newID] = $newID;
}
# if ($row['deleted']) {$this->recStat['deleted']++;}
# if ($row['hidden']) {$this->recStat['hidden']++;}
// Select all versions of this record:
if ($this->genTree_includeVersions && $TCA[$table]['ctrl']['versioningWS']) {
$genHTML = $depthData.'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.$LN.'.gif','width="18" height="16"').' align="top" alt="" />';
$this->genTree_records($newID, $genHTML, $table, TRUE);
}
}
}
/**
* [Describe function...]
*
* @return [type] ...
*/
function genTreeStatus() {
$this->genTree_includeDeleted = TRUE; // if set, genTree() includes deleted pages. This is default.
$this->genTree_includeVersions = TRUE; // if set, genTree() includes verisonized pages/records. This is default.
$this->genTree_includeRecords = TRUE; // if set, genTree() includes records from pages.
$this->perms_clause = ''; // extra where-clauses for the tree-selection
$this->genTree_makeHTML = 0; // if set, genTree() generates HTML, that visualizes the tree.
$this->genTree(537,'');
return $this->recStats;
}
/**
* Fills $this->lRecords with the records from all tc-tables that are not attached to a PID in the pid-list.
*
......
......@@ -46,18 +46,18 @@
*/
class t3lib_ajax {
/**
* gets javascript code needed to handle an XMLHTTP request in the frontend.
* all JS functions have to call ajax_doRequest(url) to make a request to the server.
* USE:
* see examples of using this function in template.php -> getContextMenuCode and alt_clickmenu.php -> printContent
*
* @param string $handlerFunction JS function handling the XML data from the server. That function gets the returned XML data as parameter.
* @param string $fallback JS fallback function which is called with the URL of the request in case ajax is not available.
* @param boolean $debug If set to 1, the returned XML data is outputted as text in an alert window - useful for debugging, PHP errors are shown there, ...
* @return string JavaScript code needed to make and handle an XMLHTTP request
*/
function getJScode($handlerFunction, $fallback = '', $debug=0) {
// init xmlhttp request object
* Gets the JavaScript code needed to handle an XMLHTTP request in the frontend.
* All JS functions have to call ajax_doRequest(url) to make a request to the server.
* USE:
* See examples of using this function in template.php -> getContextMenuCode and alt_clickmenu.php -> printContent
*
* @param string JS function handling the XML data from the server. That function gets the returned XML data as parameter.
* @param string JS fallback function which is called with the URL of the request in case ajax is not available.
* @param boolean If set to 1, the returned XML data is outputted as text in an alert window - useful for debugging, PHP errors are shown there, ...
* @return string JavaScript code needed to make and handle an XMLHTTP request
*/
function getJScode($handlerFunction, $fallback='', $debug=0) {
// Init the XMLHTTP request object
$code = '
function ajax_initObject() {
var A;
......@@ -75,7 +75,7 @@ class t3lib_ajax {
}
return A;
}';
// in case ajax is not available, fallback function
// in case AJAX is not available, fallback function
if($fallback) {
$fallback .= '(url)';
} else {
......@@ -111,11 +111,11 @@ class t3lib_ajax {
/**
* Function outputting XML data for TYPO3 ajax. The function directly outputs headers and content to the browser.
*
* @param string $innerXML XML data which will be sent to the browser
* @param string $innerXML XML data which will be sent to the browser
* @return void
*/
function outputXMLreply($innerXML) {
// ajax needs xml data
// AJAX needs some XML data
header('Content-Type: text/xml');
$xml = '<?xml version="1.0"?>
<t3ajax>'.$innerXML.'</t3ajax>';
......@@ -128,4 +128,4 @@ class t3lib_ajax {
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_ajax.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_ajax.php']);
}
?>