This commit was manufactured by cvs2svn to create tag TYPO3_4-0-0beta2
authorAndreas Otto <andreas.otto@dkd.de>
Fri, 20 Jan 2006 00:49:46 +0000 (00:49 +0000)
committerAndreas Otto <andreas.otto@dkd.de>
Fri, 20 Jan 2006 00:49:46 +0000 (00:49 +0000)
'TYPO3_4-0-0beta2'.

git-svn-id: https://svn.typo3.org/TYPO3v4/Core/tags/TYPO3_4-0-0beta2@1064 709f56b5-9817-0410-a4d7-c38de5d9e867

292 files changed:
ChangeLog
LICENSE.txt
NEWS.txt
TODO.txt
t3lib/class.gzip_encode.php
t3lib/class.t3lib_befunc.php
t3lib/class.t3lib_beuserauth.php
t3lib/class.t3lib_clipboard.php
t3lib/class.t3lib_cs.php
t3lib/class.t3lib_db.php
t3lib/class.t3lib_diff.php
t3lib/class.t3lib_div.php
t3lib/class.t3lib_extfilefunc.php
t3lib/class.t3lib_fullsearch.php
t3lib/class.t3lib_iconworks.php
t3lib/class.t3lib_install.php
t3lib/class.t3lib_loadmodules.php
t3lib/class.t3lib_matchcondition.php
t3lib/class.t3lib_page.php
t3lib/class.t3lib_parsehtml.php
t3lib/class.t3lib_parsehtml_proc.php
t3lib/class.t3lib_positionmap.php
t3lib/class.t3lib_querygenerator.php
t3lib/class.t3lib_recordlist.php
t3lib/class.t3lib_refindex.php
t3lib/class.t3lib_sqlengine.php
t3lib/class.t3lib_sqlparser.php
t3lib/class.t3lib_tceforms.php
t3lib/class.t3lib_tcemain.php
t3lib/class.t3lib_tsparser.php
t3lib/class.t3lib_tsstyleconfig.php
t3lib/class.t3lib_userauthgroup.php
t3lib/compat_php5.php [new file with mode: 0644]
t3lib/config_default.php
t3lib/gfx/button_top_right.gif [new file with mode: 0755]
t3lib/gfx/markstate.gif [new file with mode: 0644]
t3lib/gfx/revert_0.gif [new file with mode: 0644]
t3lib/gfx/revert_1.gif [new file with mode: 0644]
t3lib/gfx/revert_2.gif [new file with mode: 0644]
t3lib/gfx/unmarkstate.gif [new file with mode: 0644]
t3lib/jsfunc.menu.js
t3lib/stddb/tables.sql
t3lib/thumbs.php
typo3/alt_clickmenu.php
typo3/alt_db_navframe.php
typo3/alt_doc.php
typo3/alt_file_navframe.php
typo3/alt_palette.php
typo3/alt_shortcut.php
typo3/browse_links.php
typo3/browser.php
typo3/class.alt_menu_functions.inc
typo3/class.show_rechis.inc
typo3/close.html
typo3/db_list.php
typo3/ext/README.txt [new file with mode: 0644]
typo3/file_list.php
typo3/file_newfolder.php
typo3/file_upload.php
typo3/index.php
typo3/listframe_loader.php
typo3/mod/user/ws/conf.php
typo3/mod/user/ws/index.php
typo3/mod/web/func/index.php
typo3/mod/web/info/index.php
typo3/mod/web/perm/index.php
typo3/move_el.php
typo3/show_rechis.php
typo3/stylesheet.css
typo3/sysext/belog/mod/index.php
typo3/sysext/beuser/mod/index.php
typo3/sysext/cms/ext_localconf.php
typo3/sysext/cms/ext_tables.sql
typo3/sysext/cms/ext_tables_static+adt.sql
typo3/sysext/cms/layout/class.tx_cms_layout.php
typo3/sysext/cms/layout/db_layout.php
typo3/sysext/cms/layout/db_new_content_el.php
typo3/sysext/cms/locallang_ttc.xml
typo3/sysext/cms/tbl_tt_content.php
typo3/sysext/cms/tslib/class.tslib_content.php
typo3/sysext/cms/tslib/class.tslib_fe.php
typo3/sysext/cms/tslib/class.tslib_menu.php
typo3/sysext/cms/tslib/class.tslib_pagegen.php
typo3/sysext/cms/tslib/class.tslib_pibase.php
typo3/sysext/cms/tslib/showpic.php
typo3/sysext/css_styled_content/ext_conf_template.txt
typo3/sysext/css_styled_content/ext_localconf.php
typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php
typo3/sysext/css_styled_content/static/constants.txt
typo3/sysext/css_styled_content/static/setup.txt
typo3/sysext/dbal/ChangeLog
typo3/sysext/dbal/class.ux_t3lib_db.php
typo3/sysext/dbal/doc/manual.sxw
typo3/sysext/dbal/ext_emconf.php
typo3/sysext/dbal/ext_tables.sql
typo3/sysext/dbal/mod1/index.php
typo3/sysext/extra_page_cm_options/class.tx_extrapagecmoptions.php
typo3/sysext/impexp/app/index.php
typo3/sysext/impexp/class.tx_impexp.php
typo3/sysext/impexp/ext_tables.sql
typo3/sysext/indexed_search/ChangeLog
typo3/sysext/indexed_search/class.crawler.php
typo3/sysext/indexed_search/ext_emconf.php
typo3/sysext/indexed_search/ext_tables.sql
typo3/sysext/indexed_search/mod/index.php
typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php
typo3/sysext/install/mod/class.tx_install.php
typo3/sysext/install/updates/class.tx_coreupdates_compatversion.php
typo3/sysext/install/updates/class.tx_coreupdates_notinmenu.php
typo3/sysext/lang/locallang_show_rechis.xml
typo3/sysext/lowlevel/config/index.php
typo3/sysext/lowlevel/dbint/cli/conf.php [new file with mode: 0644]
typo3/sysext/lowlevel/dbint/cli/refindex_cli.phpsh [new file with mode: 0644]
typo3/sysext/lowlevel/dbint/index.php
typo3/sysext/lowlevel/dbint/locallang.xml [new file with mode: 0644]
typo3/sysext/lowlevel/ext_emconf.php
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php
typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_loremipsum_wiz.php [deleted file]
typo3/sysext/rtehtmlarea/conf.php [deleted file]
typo3/sysext/rtehtmlarea/doc/manual.sxw
typo3/sysext/rtehtmlarea/ext_emconf.php
typo3/sysext/rtehtmlarea/ext_localconf.php
typo3/sysext/rtehtmlarea/ext_tables.php
typo3/sysext/rtehtmlarea/ext_tables.sql
typo3/sysext/rtehtmlarea/htmlarea/HTMLAREA_LICENSE.txt [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-gecko-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-gecko.js
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-ie.js
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js
typo3/sysext/rtehtmlarea/htmlarea/license.txt [deleted file]
typo3/sysext/rtehtmlarea/htmlarea/locallang_dialogs.php [deleted file]
typo3/sysext/rtehtmlarea/htmlarea/locallang_dialogs.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/locallang_msg.php [deleted file]
typo3/sysext/rtehtmlarea/htmlarea/locallang_msg.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/locallang_tooltips.php [deleted file]
typo3/sysext/rtehtmlarea/htmlarea/locallang_tooltips.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/plugins/Acronym/acronym-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/Acronym/acronym.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/Acronym/locallang.php [deleted file]
typo3/sysext/rtehtmlarea/htmlarea/plugins/Acronym/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/plugins/CharacterMap/character-map-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/CharacterMap/character-map.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/CharacterMap/locallang.php [deleted file]
typo3/sysext/rtehtmlarea/htmlarea/plugins/CharacterMap/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/plugins/CharacterMap/popups/select_character.html
typo3/sysext/rtehtmlarea/htmlarea/plugins/ContextMenu/context-menu-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/ContextMenu/context-menu.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/ContextMenu/locallang.php [deleted file]
typo3/sysext/rtehtmlarea/htmlarea/plugins/ContextMenu/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/plugins/DynamicCSS/dynamiccss-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/DynamicCSS/dynamiccss.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/DynamicCSS/locallang.php [deleted file]
typo3/sysext/rtehtmlarea/htmlarea/plugins/DynamicCSS/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/plugins/FindReplace/find-replace-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/FindReplace/find-replace.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/FindReplace/locallang.php [deleted file]
typo3/sysext/rtehtmlarea/htmlarea/plugins/FindReplace/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/plugins/FindReplace/popups/find_replace.html
typo3/sysext/rtehtmlarea/htmlarea/plugins/FullPage/lang/ro.js [deleted file]
typo3/sysext/rtehtmlarea/htmlarea/plugins/InlineCSS/inlinecss-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/InlineCSS/inlinecss.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/InlineCSS/locallang.php [deleted file]
typo3/sysext/rtehtmlarea/htmlarea/plugins/InlineCSS/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/plugins/InsertSmiley/insert-smiley-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/InsertSmiley/insert-smiley.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/InsertSmiley/locallang.php [deleted file]
typo3/sysext/rtehtmlarea/htmlarea/plugins/InsertSmiley/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/plugins/InsertSmiley/popups/insertsmiley.html
typo3/sysext/rtehtmlarea/htmlarea/plugins/QuickTag/locallang.php [deleted file]
typo3/sysext/rtehtmlarea/htmlarea/plugins/QuickTag/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/plugins/QuickTag/popups/quicktag.html
typo3/sysext/rtehtmlarea/htmlarea/plugins/QuickTag/quick-tag-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/QuickTag/quick-tag.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/RemoveFormat/locallang.php [deleted file]
typo3/sysext/rtehtmlarea/htmlarea/plugins/RemoveFormat/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/plugins/RemoveFormat/popups/removeformat.html
typo3/sysext/rtehtmlarea/htmlarea/plugins/RemoveFormat/remove-format-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/RemoveFormat/remove-format.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/SelectColor/locallang.php [deleted file]
typo3/sysext/rtehtmlarea/htmlarea/plugins/SelectColor/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/plugins/SelectColor/select-color-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/SelectColor/select-color.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/SpellChecker/locallang.php [deleted file]
typo3/sysext/rtehtmlarea/htmlarea/plugins/SpellChecker/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/plugins/SpellChecker/popups/spell-check-ui-iso-8859-1.html
typo3/sysext/rtehtmlarea/htmlarea/plugins/SpellChecker/popups/spell-check-ui.html
typo3/sysext/rtehtmlarea/htmlarea/plugins/SpellChecker/spell-check-logic.php
typo3/sysext/rtehtmlarea/htmlarea/plugins/SpellChecker/spell-check-ui.html
typo3/sysext/rtehtmlarea/htmlarea/plugins/SpellChecker/spell-check-ui.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/SpellChecker/spell-checker-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/SpellChecker/spell-checker.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.php [deleted file]
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Browsers/typo3browsers-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Browsers/typo3browsers.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3HtmlParser/locallang.php [deleted file]
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3HtmlParser/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3HtmlParser/typo3html-parser-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3HtmlParser/typo3html-parser.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TableOperations/locallang.php [deleted file]
typo3/sysext/rtehtmlarea/htmlarea/plugins/TableOperations/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/plugins/TableOperations/table-operations-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TableOperations/table-operations.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/UserElements/locallang.php [deleted file]
typo3/sysext/rtehtmlarea/htmlarea/plugins/UserElements/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/plugins/UserElements/user-elements-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/UserElements/user-elements.js
typo3/sysext/rtehtmlarea/htmlarea/popups/about.html
typo3/sysext/rtehtmlarea/htmlarea/popups/insert_image.html
typo3/sysext/rtehtmlarea/htmlarea/popups/insert_table.html
typo3/sysext/rtehtmlarea/htmlarea/popups/link.html
typo3/sysext/rtehtmlarea/htmlarea/popups/popup.js
typo3/sysext/rtehtmlarea/htmlarea/popups/select_color.html
typo3/sysext/rtehtmlarea/htmlarea/popupwin-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/popupwin.js
typo3/sysext/rtehtmlarea/htmlarea/skins/blue-look/htmlarea.css
typo3/sysext/rtehtmlarea/htmlarea/skins/default/htmlarea.css
typo3/sysext/rtehtmlarea/htmlarea/skins/xp-blue/htmlarea.css
typo3/sysext/rtehtmlarea/locallang.php [deleted file]
typo3/sysext/rtehtmlarea/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/locallang_db.php [deleted file]
typo3/sysext/rtehtmlarea/locallang_db.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/locallang_rtehtmlarea_acronym.php [deleted file]
typo3/sysext/rtehtmlarea/locallang_rtehtmlarea_browse_links.php [deleted file]
typo3/sysext/rtehtmlarea/locallang_rtehtmlarea_select_image.php [deleted file]
typo3/sysext/rtehtmlarea/locallang_rtehtmlarea_user.php [deleted file]
typo3/sysext/rtehtmlarea/mod1/conf.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod1/popup.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod2/acronym.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod2/clear.gif [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod2/conf.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod2/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod3/browse_links.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod3/clear.gif [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod3/conf.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod3/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod4/clear.gif [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod4/conf.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod4/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod4/select_image.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod5/clear.gif [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod5/conf.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod5/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod5/user.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod6/conf.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod6/parse_html.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/pageTSConfigAdvanced.txt [deleted file]
typo3/sysext/rtehtmlarea/pageTSConfigDemo.txt [deleted file]
typo3/sysext/rtehtmlarea/pageTSConfigImage.txt [deleted file]
typo3/sysext/rtehtmlarea/pageTSConfigProc.txt [deleted file]
typo3/sysext/rtehtmlarea/pageTSConfigTypical.txt [deleted file]
typo3/sysext/rtehtmlarea/pi1/locallang.php [deleted file]
typo3/sysext/rtehtmlarea/pi1/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/pi2/class.tx_rtehtmlarea_pi2.php
typo3/sysext/rtehtmlarea/pi2/locallang.php [deleted file]
typo3/sysext/rtehtmlarea/pi2/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/res/advanced/pageTSConfig.txt [new file with mode: 0644]
typo3/sysext/rtehtmlarea/res/advanced/userTSConfig.txt [new file with mode: 0644]
typo3/sysext/rtehtmlarea/res/demo/pageTSConfig.txt [new file with mode: 0644]
typo3/sysext/rtehtmlarea/res/demo/userTSConfig.txt [new file with mode: 0644]
typo3/sysext/rtehtmlarea/res/image/pageTSConfig.txt [new file with mode: 0644]
typo3/sysext/rtehtmlarea/res/proc/pageTSConfig.txt [new file with mode: 0644]
typo3/sysext/rtehtmlarea/res/typical/pageTSConfig.txt [new file with mode: 0644]
typo3/sysext/rtehtmlarea/res/typical/userTSConfig.txt [new file with mode: 0644]
typo3/sysext/rtehtmlarea/rtehtmlarea_acronym.php [deleted file]
typo3/sysext/rtehtmlarea/rtehtmlarea_browse_links.php [deleted file]
typo3/sysext/rtehtmlarea/rtehtmlarea_parse_html.php [deleted file]
typo3/sysext/rtehtmlarea/rtehtmlarea_select_image.php [deleted file]
typo3/sysext/rtehtmlarea/rtehtmlarea_user.php [deleted file]
typo3/sysext/rtehtmlarea/t3_popup.php [deleted file]
typo3/sysext/rtehtmlarea/tca.php
typo3/sysext/rtehtmlarea/userTSConfigAdvanced.txt [deleted file]
typo3/sysext/rtehtmlarea/userTSConfigDemo.txt [deleted file]
typo3/sysext/rtehtmlarea/userTSConfigTypical.txt [deleted file]
typo3/sysext/setup/mod/index.php
typo3/sysext/sys_action/ext_tables.sql
typo3/sysext/sys_note/ext_tables.sql
typo3/sysext/taskcenter/task/index.php
typo3/sysext/tsconfig_help/ext_tables.sql
typo3/sysext/tsconfig_help/ext_tables_static+adt.sql
typo3/sysext/tstemplate/ts/conf.php
typo3/sysext/tstemplate/ts/index.php
typo3/sysext/tstemplate_info/ChangeLog
typo3/sysext/tstemplate_info/class.tx_tstemplateinfo.php
typo3/sysext/version/cm1/index.php
typo3/template.php
typo3/wizard_forms.php
typo3/wizard_rte.php
typo3/wizard_table.php
typo3/wizard_tsconfig.php

index 5bcee67..14673f5 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,182 @@
+2006-01-20  Michael Stucki  <michael@typo3.org>
+
+       * New feature: Merged cron_cssstyledimgtext into CSS Styled Content. Kudos to Ernesto Baschny who did most of the work. Many thanks to Sebastian Kurfuerst for his great support. Great work boys!
+       * Added support to fetch values from objects in getText: myVar.data = TSFE:fe_user|user|username
+       * Fixed (part of) #2059: Removing "NOT NULL" when parsing SQL data
+
+2006-01-19  Sebastian Kurfuerst  <sebastian@garbage-group.de>
+
+       * New feature: Revised Undo/History feature.
+       * Fixed issue #1952: New hook in class.t3lib_userauthgroup.php
+       * Fixed issue #2243: Hook needed in class.t3lib_befunc.php, function getProcessedValue
+       * Fixed bug #2293: Javascript warnings
+       * Fixed errors in t3lib_db::fullQuoteArray and UPDATEquery (came into the core some hours before)
+
+2006-01-19  Karsten Dambekalns  <karsten@typo3.org>
+
+       * sysext/dbal: Some bugfixes to connection handling; added $no_quote_fields support for INSERT and UPDATE methods.
+       * Fixed bug #2059
+
+2006-01-19  René Fritz  <r.fritz@colorcube.de>
+
+       * Fixed bug: Fixed a problem with the RTE and inline images and base url's like http://mydomain.com/here_is_my_site/
+       * Fixed bug: The nav frame do not update properly when submodules register different nav frames with navFrameScript in MCONF. (class.alt_menu_functions.php)
+       * Fixed bug: fixed bug related to PHP5 and clone() in tslib_content
+       * Fixed issue: Added clone() compatibility function for PHP4
+       * Fixed bug: The javascript dyn tabs used for eg. TCEForms and placed in template.php were not shown when used in popup windows because of an uninitialized variable.
+       * Fixed a missing "global": added a missing global $TYPO3_CONF_VARS; to t3lib_userauthgroup::fetchGroups which would have been prevented that the hook fetchGroupQuery worked
+
+2006-01-19  Dmitry Dulepov  <typo3@accio.lv>
+
+       * Fixed bug #1430: SEO + simulateStaticDocuments
+
+2005-01-19  Peter Niederlag  <peter@niederlag.de>
+
+       * Fixed issue #2268 on cleanup of sysext:css_styled_content
+       * Fixed small issue with link in LICENSE.txt
+
+2005-01-19  Martin Kutschker  <martin.t.kutschker@blackbox.net>
+
+       * add t3lib_div::sysLog() for Core logging
+       * use t3lib_div::sysLog() in t3lib_db->sql_pconnect() and t3lib_db->sql_select_db()
+       * add no_quote parameter to t3lib_db->fullQuoteArray() and to all SQL statement generating functions of t3lib_db
+
+2006-01-19  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
+
+       * Changes to the htmlArea RTE extension (details see local ChangeLog)
+
+2006-01-18  Dmitry Dulepov  <typo3@accio.lv>
+
+       * indexed_search: Removed empty line at the end of class.tx_indexedsearch.php. This line caused undesired effects in MSIE with certain PHP versions and UTF-8 encoding in FE.
+
+2006-01-18  Sebastian Kurfuerst  <sebastian@garbage-group.de>
+
+       * Fixed bug #1869: Copy sites with flexible content elements inside crash with fatal error
+       * Fixed bug #2136: changing extended view in list mode changes focus
+       * New feature #1320: stdWrap for all ATagParams (except config.ATagParams)
+
+2006-01-18  Bernhard Kraft  <kraftb@kraftb.at>
+
+       * Fixed bugs #277, #1030 and #1472 which are all related to the same charset issue.
+
+2006-01-17  Karsten Dambekalns  <karsten@typo3.org>
+
+       * Fixed bug #432
+
+2006-01-17 Wolfgang Klinger  <wk@plan2.net>
+
+       * Update the timestamp field (TCA/ctrl/tstamp) on delete
+
+2006-01-16 Dmitry Dulepov  <typo3@accio.lv>
+
+       * Fixed bug #2160: Turn off workspaces module for certain users not possible
+
+2006-01-14 Ingmar Schlecht  <ingmar@typo3.org>
+
+       * Fixed #2248: Path disclosure in config_default.php and showpic.php
+
+2006-01-14  Michael Stucki  <michael@typo3.org>
+
+       * Fixed bug #2102: PHP-Warning in the shortcut frame
+       * Remove <label> tags around hidden fields in FORM elements
+       * Removed depencency of typo3conf/database.sql: The file contents are now calculated automatically.
+
+2006-01-13  Wolfgang Klinger  <wk@plan2.net>
+
+       * The '[Translate to:]' message is now configurable via TSconfig and will be prepended only if there's an actual value
+
+2006-01-12  Karsten Dambekalns  <karsten@typo3.org>
+
+       * Fixed unclean document.location use in JavaScript parts, replaced by [window.]location.href
+
+2006-01-12  Wolfgang Klinger  <wk@plan2.net>
+
+       * Introduced a new property 'ignore' for config.sys_language_mode
+
+2006-01-12  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
+
+       * Changes to the htmlArea RTE extension (details see local ChangeLog)
+
+2006-01-11  Dmitry Dulepov <typo3@accio.lv>
+
+       * Fixed bug #2199: Summary contains duplicate labels (indexed_search)
+
+2006-01-10  Wolfgang Klinger  <wolfgang@stufenlos.net>
+
+       * Fixed bug #1209: set 'deleteTree' to '1' if 'recursiveDelete' is set in the user preferences
+
+2006-01-08  Stanislas Rolland  <stanislas.rolland(arobas)fructifor.ca>
+
+       * rtehtmlarea: Correction to path settings affecting image drag & drop and file/image upload.
+
+2006-01-08  Sebastian Kurfuerst  <sebastian@garbage-group.de>
+
+       * Fixed bug #1938: Selection "Frontend" gets lost on login failure
+       * Fixed bug #1149: FE-Editing in new Popups => Page doesn't reload
+       * New feature #1910: Sorting in filelists by modification date
+
+2006-01-06  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
+
+       * Converted locallang files of htmlArea RTE extension to XML format.
+       * Revised all licence notices on all scripts of htmlArea RTE in order to publish under GPL.
+
+2005-01-06  Sebastian Kurfuerst  <sebastian@garbage-group.de>
+
+       * Fixed bug #1854: wrong Access check in RTE Wizard
+       * Added PHPdoc comments to the update wizard
+
+2006-01-05  Karsten Dambekalns  <karsten@typo3.org>
+
+       * Minor change to the stylesheet to enhance tabmenu display in the BE.
+
+2005-01-05  Martin Kutschker  <martin.t.kutschker@blackbox.net>
+
+       * Add escapeStrForLike() to t3lib_db and use it in tslib_cObj->searchWhere()
+       * Update for bug #1354: Use mysql_escape_string() with PHP 4.1.x
+
+2006-01-04  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
+
+       * Changes to the htmlArea RTE extension (details see local ChangeLog)
+
+2006-01-04  Karsten Dambekalns  <karsten@typo3.org>
+
+       * Changes to the DBAL extension (details see local ChangeLog)
+       * Minor fix to inline comment in class.t3lib_sqlparser.php
+
+2006-01-04  Sebastian Kurfuerst  <sebastian@garbage-group.de>
+
+       * Fixed bug #2169: Import of testsite from T3D exceeds PHP maximum_execution_time
+       * Fixed bug #2127: Fatal error in mod/user/ws/index.php
+       * Changed behavior of alertPopups - there were still some bugs inside, it is cleaned up now.
+
+2005-12-31  Martin Kutschker  <martin.t.kutschker@blackbox.net>
+
+       * Add alternative field name argument to tslib_pibase->pi_initPIflexForm()
+
+2005-12-30  Sebastian Kurfuerst  <sebastian@garbage-group.de>
+
+       * Fixed bug #2108: Error when using hide in Frontend Editing
+
+2005-12-29  Sebastian Kurfuerst  <sebastian@garbage-group.de>
+
+       * Fixed bug #2100: Warning: Call-time pass-by-reference has been deprecated
+       * Fixed bug #2126: Updating encryption key sets compat version to same value
+       * Fixed bug #2132: Error on moving lost records
+       * Fixed bug #2134: "Place as root" does not function
+       * Changed version of indexed search to 2.9.0
+       * Fixed bug #2117: Install-Tool: "Write to localconf.php" sets "sqlDebug" and "USdateFormat" automatically
+       * Fixed a bug in quote settings in CSS styled content - table. Now it is possible to copy/paste a CSV directly.
+
+2005-12-28  Michael Stucki  <michael@typo3.org>
+
+       * Release of TYPO3 4.0beta1
+       * Rised version number to 4.0beta1
+       * Fixed a bug in tstemplate (path still pointing to typo3/ext/)
+
 2005-12-28  Michael Stucki  <michael@typo3.org>
 
+       * Changed TYPO3_CONF_VARS[SYS][fileCreateMask] from 775 to 755
+       * Rised version number to 4.0-dev
        * Added "rtehtmlarea" as a system extension
                - Important notice: Because of a known bug, the buttons "blockstylelabel", "blockstyle", "textstylelabel" and "textstyle" will not work with this version.
        * Fixed bug #1155: Install tool want to recreate the tables, and drop the old ones
@@ -1242,7 +1419,7 @@ Sorry for writing these changelog entries with a delay of two days. I write them
 2004-06-11  Robert Lemke  <rl@robertlemke.de>
 
        * Created new hook in class.t3lib_tcemain.php in process_datamap. Search for $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']
-       (other hooks in that class will follow by Ren� as I know from a trusted source ... ;-)
+         (other hooks in that class will follow by René as I know from a trusted source ... ;-)
 
 2004-06-09  Robert Lemke  <rl@robertlemke.de>
 
index 3cf0dad..720908b 100755 (executable)
@@ -1,10 +1,10 @@
 ---------------------------------
  The TYPO3 licensing conditions
  2003, Kasper Skårhøj (kasper@typo3.com)
- Document version 2.00, 24-02-2003
+ Document version 2.01, 01-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
index a53805f..5802371 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -30,6 +30,7 @@ Bugfixes
 
        * config.disablePrefixComment was ignored by plugins
        * When copying a file into the same folder in the "Filelist" module, it is automatically renamed
+       * JSMENU, editPanel and feAdmin fixed when utf-8 entities or other multibyte character sets get used
 
 Usability
 =========
index ac64d77..a48481d 100755 (executable)
--- a/TODO.txt
+++ b/TODO.txt
@@ -48,7 +48,7 @@ TCEmain
                - Implement flexform "index" as well (see marks
                - In "Help > About Modules" screen we might want to look if the index is empty and if so, present a link to "Tools > DB check" tool so the index can be created initially for updated sites?
                - (Make class.t3lib_refindex available in the frontend scope for integration in plugins that manipulate the database on their own and need to update the reference index. Actually, I'm inclined to think we should rather think about how to provide t3lib_tcemain for the frontend instead...!)
-               - CLI script for updating refindex with cron-job and reporting inconsistencies by email
+               - CLI script for updating refindex with cron-job [OK] and reporting inconsistencies by email
        - Record clean-up functionality (Tools > DB check module)
                - Remove references to deleted records (also deleted-to-recycler records? Maybe "deleted-to-recycler" references are important to remove in order to make sure "recycler" records are not selected!) (refs to MM for both tables/files)
                - Remove references to lost files etc.
index cb9d9e0..e0cf44c 100755 (executable)
@@ -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]);
index c890eaa..9ef56db 100755 (executable)
@@ -909,6 +909,7 @@ class t3lib_BEfunc  {
                        // Add defaultExtras:
                $specConfParts = t3lib_div::trimExplode(':', $defaultExtras.':'.$str, 1);
 
+               $reg = array();
                if (count($specConfParts))      {
                        foreach($specConfParts as $k2 => $v2)   {
                                unset($specConfParts[$k2]);
@@ -985,7 +986,7 @@ class t3lib_BEfunc  {
                                $file = t3lib_div::getFileAbsFileName(substr($ds_array[$srcPointer],5));
                                if ($file && @is_file($file))   {
                                        $dataStructArray = t3lib_div::xml2array(t3lib_div::getUrl($file));
-                               } else $dataStructArray = 'The file "'.substr($dsSrc,5).'" in ds-array key "'.$srcPointer.'" was not found ("'.$file.'")';      // Error message.
+                               } else $dataStructArray = 'The file "'.substr($ds_array[$srcPointer],5).'" in ds-array key "'.$srcPointer.'" was not found ("'.$file.'")';      // Error message.
                        } else {
                                $dataStructArray = t3lib_div::xml2array($ds_array[$srcPointer]);
                        }
@@ -1829,12 +1830,23 @@ class t3lib_BEfunc      {
         */
        function getProcessedValue($table,$col,$value,$fixed_lgd_chars=0,$defaultPassthrough=0,$noRecordLookup=FALSE,$uid=0)    {
                global $TCA;
+               global $TYPO3_CONF_VARS;
                        // Load full TCA for $table
                t3lib_div::loadTCA($table);
                        // Check if table and field is configured:
                if (is_array($TCA[$table]) && is_array($TCA[$table]['columns'][$col]))  {
                                // Depending on the fields configuration, make a meaningful output value.
                        $theColConf = $TCA[$table]['columns'][$col]['config'];
+
+                               /*****************
+                                *HOOK: pre-processing the human readable output from a record
+                                ****************/
+                       if (is_array ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['preProcessValue'])) {
+                       foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['preProcessValue'] as $_funcRef) {
+                                       t3lib_div::callUserFunction($_funcRef,$theColConf,$this);
+                               }
+                       }
+
                        $l='';
                        switch((string)$theColConf['type'])     {
                                case 'radio':
@@ -1930,6 +1942,20 @@ class t3lib_BEfunc       {
                                        }
                                break;
                        }
+
+                               /*****************
+                                *HOOK: post-processing the human readable output from a record
+                                ****************/
+                       if (is_array ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['postProcessValue'])) {
+                       foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['postProcessValue'] as $_funcRef) {
+                                       $params = array(
+                                               'value' => $l,
+                                               'colConf' => $theColConf
+                                       );
+                                       $l = t3lib_div::callUserFunction($_funcRef,$params,$this);
+                               }
+                       }
+
                        if ($fixed_lgd_chars)   {
                                return t3lib_div::fixed_lgd_cs($l,$fixed_lgd_chars);
                        } else {
@@ -2219,7 +2245,7 @@ class t3lib_BEfunc        {
         */
        function editOnClick($params,$backPath='',$requestUri='')       {
                $retUrl = 'returnUrl='.($requestUri==-1?"'+T3_THIS_LOCATION+'":rawurlencode($requestUri?$requestUri:t3lib_div::getIndpEnv('REQUEST_URI')));
-               return "document.location='".$backPath."alt_doc.php?".$retUrl.$params."'; return false;";
+               return "window.location.href='".$backPath."alt_doc.php?".$retUrl.$params."'; return false;";
        }
 
        /**
@@ -3239,8 +3265,8 @@ class t3lib_BEfunc        {
                                                        ' AND B.pid='.intval($pageId).
                                                        ' AND A.t3ver_wsid='.intval($workspace).
                                                        ' AND A.t3ver_oid=B.uid'.       // ... and finally the join between the two tables.
-                                                       t3lib_BEfunc::deleteClause($table,'A').
-                                                       t3lib_BEfunc::deleteClause($table,'B')
+                                                       t3lib_BEfunc::deleteClause($tableName,'A').
+                                                       t3lib_BEfunc::deleteClause($tableName,'B')
                                        );
 
                                        if (!is_array($output[$tableName]) || !count($output[$tableName]))      {
index e1c6768..b6dfa44 100644 (file)
@@ -238,6 +238,7 @@ class t3lib_beUserAuth extends t3lib_userAuthGroup {
         * @internal
         */
        function backendSetUC() {
+               global $TYPO3_CONF_VARS;
 
                        // UC - user configuration is a serialized array inside the userobject
                $temp_theSavedUC=unserialize($this->user['uc']);                // if there is a saved uc we implement that instead of the default one.
index 4c1daa9..8a8d333 100755 (executable)
@@ -325,22 +325,22 @@ class t3lib_clipboard {
                $opt[]='<option value="" selected="selected">'.$this->clLabel('menu','rm').'</option>';
                                // Import / Export link:
                if ($elCount && t3lib_extMgm::isLoaded('impexp'))       {
-                       $opt[] = '<option value="'.htmlspecialchars("document.location='".$this->backPath.t3lib_extMgm::extRelPath('impexp').'app/index.php'.$this->exportClipElementParameters().'\';').'">'.$this->clLabel('export','rm').'</option>';
+                       $opt[] = '<option value="'.htmlspecialchars("window.location.href='".$this->backPath.t3lib_extMgm::extRelPath('impexp').'app/index.php'.$this->exportClipElementParameters().'\';').'">'.$this->clLabel('export','rm').'</option>';
                }
                                // Edit:
                if (!$this->fileMode && $elCount)       {
-                       $opt[]='<option value="'.htmlspecialchars("document.location='".$this->editUrl()."&returnUrl='+top.rawurlencode(document.location);").'">'.$this->clLabel('edit','rm').'</option>';
+                       $opt[]='<option value="'.htmlspecialchars("window.location.href='".$this->editUrl()."&returnUrl='+top.rawurlencode(window.location.href);").'">'.$this->clLabel('edit','rm').'</option>';
                }
                                // Delete:
                if ($elCount)   {
                        if($GLOBALS['BE_USER']->jsConfirmation(4))      {
                                $js = "
                        if(confirm(".$GLOBALS['LANG']->JScharCode(sprintf($LANG->sL('LLL:EXT:lang/locallang_core.php:mess.deleteClip'),$elCount)).")){
-                               document.location='".$this->deleteUrl(0,$this->fileMode?1:0)."&redirect='+top.rawurlencode(document.location);
+                               window.location.href='".$this->deleteUrl(0,$this->fileMode?1:0)."&redirect='+top.rawurlencode(window.location.href);
                        }
                                        ";
                        } else {
-                               $js = " document.location='".$this->deleteUrl(0,$this->fileMode?1:0)."&redirect='+top.rawurlencode(document.location); ";
+                               $js = " window.location.href='".$this->deleteUrl(0,$this->fileMode?1:0)."&redirect='+top.rawurlencode(window.location.href); ";
                        }
                        $opt[]='<option value="'.htmlspecialchars($js).'">'.$this->clLabel('delete','rm').'</option>';
                }
index a1d57ce..147260f 100755 (executable)
@@ -1518,17 +1518,17 @@ class t3lib_cs {
        function conv_case($charset,$string,$case)      {
                if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] == 'mbstring' && (float)phpversion() >= 4.3)   {
                        if ($case == 'toLower') {
-                               return mb_strtolower($string,$charset);
+                               $string = mb_strtolower($string,$charset);
                        } else {
-                               return mb_strtoupper($string,$charset);
+                               $string = mb_strtoupper($string,$charset);
                        }
                } elseif ($charset == 'utf-8')  {
-                       return $this->utf8_char_mapping($string,'case',$case);
+                       $string = $this->utf8_char_mapping($string,'case',$case);
                } elseif (isset($this->eucBasedSets[$charset])) {
-                       return $this->euc_char_mapping($string,$charset,'case',$case);
+                       $string = $this->euc_char_mapping($string,$charset,'case',$case);
                } else {
                                // treat everything else as single-byte encoding
-                       return $this->sb_char_mapping($string,$charset,'case',$case);
+                       $string = $this->sb_char_mapping($string,$charset,'case',$case);
                }
 
                return $string;
@@ -1543,12 +1543,12 @@ class t3lib_cs {
         */
        function specCharsToASCII($charset,$string)     {
                if ($charset == 'utf-8')        {
-                       return $this->utf8_char_mapping($string,'ascii');
+                       $string = $this->utf8_char_mapping($string,'ascii');
                } elseif (isset($this->eucBasedSets[$charset])) {
-                       return $this->euc_char_mapping($string,$charset,'ascii');
+                       $string = $this->euc_char_mapping($string,$charset,'ascii');
                } else {
                                // treat everything else as single-byte encoding
-                       return $this->sb_char_mapping($string,$charset,'ascii');
+                       $string = $this->sb_char_mapping($string,$charset,'ascii');
                }
 
                return $string;
@@ -1741,7 +1741,7 @@ class t3lib_cs {
                if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] == 'mbstring') {
                        return mb_strrpos($haystack,$needle,'utf-8');
                } elseif ($GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] == 'iconv')      {
-                       return iconv_strrpos($haystack,$needle,$offset,'utf-8');
+                       return iconv_strrpos($haystack,$needle,'utf-8');
                }
 
                $byte_pos = strrpos($haystack,$needle);
index 4624fd6..66774dc 100755 (executable)
@@ -139,7 +139,7 @@ class t3lib_DB {
        var $store_lastBuiltQuery = FALSE;      // Set "TRUE" if you want the last built query to be stored in $debug_lastBuiltQuery independent of $this->debugOutput
 
                // Default link identifier:
-       var $link;
+       var $link = FALSE;
 
 
 
@@ -164,10 +164,11 @@ class t3lib_DB {
         *
         * @param       string          Table name
         * @param       array           Field values as key=>value pairs. Values will be escaped internally. Typically you would fill an array like "$insertFields" with 'fieldname'=>'value' and pass it to this function as argument.
+        * @param       string/array    See fullQuoteArray()
         * @return      pointer         MySQL result pointer / DBAL object
         */
-       function exec_INSERTquery($table,$fields_values)        {
-               $res = mysql_query($this->INSERTquery($table,$fields_values), $this->link);
+       function exec_INSERTquery($table,$fields_values,$no_quote_fields='')    {
+               $res = mysql_query($this->INSERTquery($table,$fields_values,$no_quote_fields), $this->link);
                if ($this->debugOutput) $this->debug('exec_INSERTquery');
                return $res;
        }
@@ -180,10 +181,11 @@ class t3lib_DB {
         * @param       string          Database tablename
         * @param       string          WHERE clause, eg. "uid=1". NOTICE: You must escape values in this argument with $this->fullQuoteStr() yourself!
         * @param       array           Field values as key=>value pairs. Values will be escaped internally. Typically you would fill an array like "$updateFields" with 'fieldname'=>'value' and pass it to this function as argument.
+        * @param       string/array    See fullQuoteArray()
         * @return      pointer         MySQL result pointer / DBAL object
         */
-       function exec_UPDATEquery($table,$where,$fields_values) {
-               $res = mysql_query($this->UPDATEquery($table,$where,$fields_values), $this->link);
+       function exec_UPDATEquery($table,$where,$fields_values,$no_quote_fields='')     {
+               $res = mysql_query($this->UPDATEquery($table,$where,$fields_values,$no_quote_fields), $this->link);
                if ($this->debugOutput) $this->debug('exec_UPDATEquery');
                return $res;
        }
@@ -295,7 +297,6 @@ class t3lib_DB {
                $res = $this->exec_SELECTquery($select_fields,$from_table,$where_clause,$groupBy,$orderBy,$limit);
                if ($this->debugOutput) $this->debug('exec_SELECTquery');
 
-               unset($output);
                if (!$this->sql_error())        {
                        $output = array();
 
@@ -333,18 +334,17 @@ class t3lib_DB {
         *
         * @param       string          See exec_INSERTquery()
         * @param       array           See exec_INSERTquery()
+        * @param       string/array    See fullQuoteArray()
         * @return      string          Full SQL query for INSERT (unless $fields_values does not contain any elements in which case it will be false)
         * @deprecated                  use exec_INSERTquery() instead if possible!
         */
-       function INSERTquery($table,$fields_values)     {
+       function INSERTquery($table,$fields_values,$no_quote_fields='') {
 
                        // Table and fieldnames should be "SQL-injection-safe" when supplied to this function (contrary to values in the arrays which may be insecure).
                if (is_array($fields_values) && count($fields_values))  {
 
-                               // Add slashes old-school:
-                       foreach($fields_values as $k => $v)     {
-                               $fields_values[$k] = $this->fullQuoteStr($fields_values[$k], $table);
-                       }
+                               // quote and escape values
+                       $fields_values = $this->fullQuoteArray($fields_values,$table,$no_quote_fields);
 
                                // Build query:
                        $query = 'INSERT INTO '.$table.'
@@ -369,26 +369,29 @@ class t3lib_DB {
         * @param       string          See exec_UPDATEquery()
         * @param       string          See exec_UPDATEquery()
         * @param       array           See exec_UPDATEquery()
+        * @param       array           See fullQuoteArray()
         * @return      string          Full SQL query for UPDATE (unless $fields_values does not contain any elements in which case it will be false)
         * @deprecated                  use exec_UPDATEquery() instead if possible!
         */
-       function UPDATEquery($table,$where,$fields_values)      {
+       function UPDATEquery($table,$where,$fields_values,$no_quote_fields='')  {
 
                        // Table and fieldnames should be "SQL-injection-safe" when supplied to this function (contrary to values in the arrays which may be insecure).
                if (is_string($where))  {
                        if (is_array($fields_values) && count($fields_values))  {
 
-                                       // Add slashes old-school:
-                               $nArr = array();
-                               foreach($fields_values as $k => $v)     {
-                                       $nArr[] = $k.'='.$this->fullQuoteStr($v, $table);
+                                       // quote and escape values
+                               $nArr = $this->fullQuoteArray($fields_values,$table,$no_quote_fields);
+
+                               $fields = array();
+                               foreach ($nArr as $k => $v) {
+                                       $fields[] = $k.'='.$v;
                                }
 
                                        // Build query:
                                $query = 'UPDATE '.$table.'
                                        SET
                                                '.implode(',
-                                               ',$nArr).
+                                               ',$fields).
                                        (strlen($where)>0 ? '
                                        WHERE
                                                '.$where : '');
@@ -542,20 +545,33 @@ class t3lib_DB {
         * @see quoteStr()
         */
        function fullQuoteStr($str, $table)     {
-               return '\''.mysql_real_escape_string($str, $this->link).'\'';
+               if (function_exists('mysql_real_escape_string'))        {
+                       return '\''.mysql_real_escape_string($str, $this->link).'\'';
+               } else {
+                       return '\''.mysql_escape_string($str).'\'';
+               }
        }
 
        /**
-        * Will fullquote all values in the one-dimentional array so they are ready to "implode" for an sql query.
+        * Will fullquote all values in the one-dimensional array so they are ready to "implode" for an sql query.
         *
-        * @param       array           Array with values
-        * @param       string          Table name for which to quote.
-        * @return      array           The input array with all values passed through intval()
+        * @param       array           Array with values
+        * @param       string          Table name for which to quote
+        * @param       string/array    List/array of keys NOT to quote (eg. SQL functions)
+        * @return      array           The input array with the values quoted
         * @see cleanIntArray()
         */
-       function fullQuoteArray($arr, $table)   {
-               foreach($arr as $k => $v)       {
-                       $arr[$k] = $this->fullQuoteStr($arr[$k], $table);
+       function fullQuoteArray($arr, $table, $noQuote='')      {
+               if (is_string($noQuote))        {
+                       $noQuote = explode(',',$noQuote);
+               } elseif (!is_array($noQuote))  {
+                       $noQuote = array();
+               }
+
+               foreach($arr as $k => $v)       {
+                       if (!in_array($k,$noQuote))     {
+                               $arr[$k] = $this->fullQuoteStr($v, $table);
+                       }
                }
                return $arr;
        }
@@ -573,11 +589,27 @@ class t3lib_DB {
         * @see quoteStr()
         */
        function quoteStr($str, $table) {
-               return mysql_real_escape_string($str, $this->link);
+               if (function_exists('mysql_real_escape_string'))        {
+                       return mysql_real_escape_string($str, $this->link);
+               } else {
+                       return mysql_escape_string($str);
+               }
        }
 
        /**
-        * Will convert all values in the one-dimentional array to integers.
+        * Escaping values for SQL LIKE statements.
+        *
+        * @param       string          Input string
+        * @param       string          Table name for which to escape string. Just enter the table that the field-value is selected from (and any DBAL will look up which handler to use and then how to quote the string!).
+        * @return      string          Output string; % and _ will be escaped with \ (or otherwise based on DBAL handler)
+        * @see quoteStr()
+        */
+       function escapeStrForLike($str, $table) {
+               return preg_replace('/[_%]/','\\\$0',$str);
+       }
+
+       /**
+        * Will convert all values in the one-dimensional array to integers.
         * Useful when you want to make sure an array contains only integers before imploding them in a select-list.
         * Usage count/core: 7
         *
@@ -652,6 +684,7 @@ class t3lib_DB {
                );
 
                        // Find LIMIT:
+               $reg = array();
                if (preg_match('/^(.*)[[:space:]]+LIMIT[[:space:]]+([[:alnum:][:space:],._]+)$/i',$str,$reg))   {
                        $wgolParts['LIMIT'] = trim($reg[2]);
                        $str = $reg[1];
@@ -846,9 +879,17 @@ class t3lib_DB {
         */
        function sql_pconnect($TYPO3_db_host, $TYPO3_db_username, $TYPO3_db_password)   {
                if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['no_pconnect'])  {
-                       $this->link = mysql_connect($TYPO3_db_host, $TYPO3_db_username, $TYPO3_db_password);
+                       $this->link = @mysql_connect($TYPO3_db_host, $TYPO3_db_username, $TYPO3_db_password);
+               } else {
+                       $this->link = @mysql_pconnect($TYPO3_db_host, $TYPO3_db_username, $TYPO3_db_password);
+               }
+
+               if (!$this->link) {
+                       t3lib_div::sysLog('Could not connect to Mysql server '.$TYPO3_db_host.' with user '.$TYPO3_db_username.'.','Core',4);
                } else {
-                       $this->link = mysql_pconnect($TYPO3_db_host, $TYPO3_db_username, $TYPO3_db_password);
+                       foreach($GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit'] as $v) {
+                               mysql_query($v, $this->link);
+                       }
                }
                return $this->link;
        }
@@ -862,7 +903,11 @@ class t3lib_DB {
         * @return      boolean         Returns TRUE on success or FALSE on failure.
         */
        function sql_select_db($TYPO3_db)       {
-               return mysql_select_db($TYPO3_db, $this->link);
+               $ret = @mysql_select_db($TYPO3_db, $this->link);
+               if (!$ret) {
+                       t3lib_div::sysLog('Could not select Mysql database '.$TYPO3_db.': '.mysql_error(),'Core',4);
+       }
+               return $ret;
        }
 
 
index 7d6a1e8..fb0973a 100755 (executable)
@@ -169,6 +169,7 @@ class t3lib_diff {
                t3lib_div::writeFile($file2,$str2);
                        // Perform diff.
                $cmd = $GLOBALS['TYPO3_CONF_VARS']['BE']['diff_path'].' '.$this->diffOptions.' '.$file1.' '.$file2;
+               $res = array();
                exec($cmd,$res);
 
                unlink($file1);
index 882671b..a13ed67 100755 (executable)
@@ -408,7 +408,7 @@ class t3lib_div {
                        && strtolower(substr($theFile,-4,4))=='.png'
                        && @is_file($theFile))  {       // IM
                                $newFile = substr($theFile,0,-4).'.gif';
-                               $cmd = t3lib_div::imageMagickCommand('convert', '"'.$theFile.'" "'.$newFile.'"', $gfxConf['im_path_lzw']);
+                               $cmd = t3lib_div::imageMagickCommand('convert', '"'.$theFile.'" "'.$newFile.'"', $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw']);
                                exec($cmd);
                                $theFile = $newFile;
                                        // unlink old file?? May be bad idea bacause TYPO3 would then recreate the file every time as TYPO3 thinks the file is not generated because it's missing!! So do not unlink $theFile here!!
@@ -815,6 +815,7 @@ class t3lib_div {
         * @return      array           Contains keys [path], [file], [filebody], [fileext], [realFileext]
         */
        function split_fileref($fileref)        {
+               $reg = array();
                if (    ereg('(.*/)(.*)$',$fileref,$reg)        )       {
                        $info['path'] = $reg[1];
                        $info['file'] = $reg[2];
@@ -1044,6 +1045,7 @@ class t3lib_div {
                $qm='\*\/\+-^%';
                $regex = '(['.$qm.'])(['.$qm.']?[0-9\.]*)';
                        // split the expression here:
+               $reg = array();
                preg_match_all('/'.$regex.'/',$string,$reg);
 
                reset($reg[2]);
@@ -1359,11 +1361,10 @@ class t3lib_div {
         * @see implodeArrayForUrl()
         */
        function explodeUrl2Array($string,$multidim=FALSE)      {
+               $output = array();
                if ($multidim)  {
-                       parse_str($string,$tempGetVars);
-                       return $tempGetVars;
+                       parse_str($string,$output);
                } else {
-                       $output = array();
                        $p = explode('&',$string);
                        foreach($p as $v)       {
                                if (strlen($v)) {
@@ -1371,8 +1372,8 @@ class t3lib_div {
                                        $output[rawurldecode($pK)] = rawurldecode($pV);
                                }
                        }
-                       return $output;
                }
+               return $output;
        }
 
        /**
@@ -1680,6 +1681,7 @@ class t3lib_div {
                                // remove nl from the beginning
                        $string = preg_replace ('/^\n+/', '', $string);
                                // re-ident to one tab using the first line as reference
+                       $match = array();
                        if(preg_match('/^(\t+)/',$string,$match)) {
                                $string = str_replace($match[1],"\t", $string);
                        }
@@ -1918,7 +1920,7 @@ class t3lib_div {
                        // In TYPO3 we expect that the charset of XML content is NOT handled in the parser but internally in TYPO3 instead. Therefore it would be very nice if PHP5 could be configured to NOT process the charset of the files. But this is not possible for now.
                        // What we do here fixes the problem but ONLY if the charset is utf-8, iso-8859-1 or us-ascii. That should work for most TYPO3 installations, in particular if people use utf-8 which we highly recommend.
                if ((double)phpversion()>=5)    {
-                       unset($ereg_result);
+                       $ereg_result = array();
                        ereg('^[[:space:]]*<\?xml[^>]*encoding[[:space:]]*=[[:space:]]*"([^"]*)"',substr($string,0,200),$ereg_result);
                        $theCharset = $ereg_result[1] ? $ereg_result[1] : ($TYPO3_CONF_VARS['BE']['forceCharset'] ? $TYPO3_CONF_VARS['BE']['forceCharset'] : 'iso-8859-1');
                        xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, $theCharset);  // us-ascii / utf-8 / iso-8859-1
@@ -2373,6 +2375,7 @@ class t3lib_div {
        function resolveBackPath($pathStr)      {
                $parts = explode('/',$pathStr);
                $output=array();
+               $c = 0;
                foreach($parts as $pV)  {
                        if ($pV=='..')  {
                                if ($c) {
@@ -2661,12 +2664,10 @@ class t3lib_div {
         */
        function linkThisUrl($url,$getParams=array())   {
                $parts = parse_url($url);
+               $getP = array();
                if ($parts['query'])    {
                        parse_str($parts['query'],$getP);
-               } else {
-                       $getP = array();
                }
-
                $getP = t3lib_div::array_merge_recursive_overrule($getP,$getParams);
                $uP = explode('?',$url);
 
@@ -3139,6 +3140,9 @@ class t3lib_div {
         * @internal
         */
        function stdAuthCode($uid_or_record,$fields='') {
+
+// FIXME $recCopy is undefined - could never work as expected
+
                if (is_array($uid_or_record))   {
                        $recCopy_temp=array();
                        if ($fields)    {
@@ -3383,7 +3387,7 @@ class t3lib_div {
                } else {
                        $singleSheet = TRUE;
                        $dataStruct = $dataStructArray;
-                       unset($dataStruct['meta']);     // Meta data should not appear there.
+                       if (isset($dataStruct['meta'])) unset($dataStruct['meta']);     // Meta data should not appear there.
                        $sheet = 'sDEF';        // Default sheet
                }
                return array($dataStruct,$sheet,$singleSheet);
@@ -3829,6 +3833,139 @@ class t3lib_div {
        }
 
        /**
+        * Init system error log.
+        *
+        * @return      void
+        * @see sysLog()
+        */
+       function initSysLog()   {
+               global $TYPO3_CONF_VARS;
+
+                       // for CLI logging name is <fqdn-hostname>:<TYPO3-path>
+               if (defined('TYPO3_cliMode') && TYPO3_cliMode)  {
+                       $host = '';
+                       if (function_exists('posix_uname'))     {
+                               $system = posix_uname();
+                               $host = $system['nodename'];
+                       } else {
+                               $host = exec('hostname');
+                       }
+                       $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLogHost'] = $TYPO3_CONF_VARS['SYS']['systemLogHost'] = gethostbyaddr(gethostbyname($host)).':'.PATH_site;
+               }
+                       // for Web logging name is <protocol>://<request-hostame>
+               else {
+                       $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLogHost'] = t3lib_div::getIndpEnv('TYPO3_REQUEST_HOST');
+               }
+
+                       // init custom logging
+               if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLog'])) {
+                       $params = array('initLog'=>TRUE);
+                       $fakeThis = FALSE;
+                       foreach($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLog'] as $hookMethod)        {
+                               t3lib_div::callUserFunction($hookMethod,$params,$fakeThis);
+                       }
+               }
+
+                       // init TYPO3 logging
+               foreach (explode(';',$TYPO3_CONF_VARS['SYS']['systemLog'],2) as $log)   {
+                       list($type,$destination) = explode(',',$log,3);
+
+                       if ($type == 'syslog')  {
+                               define_syslog_variables();
+                               if (TYPO3_OS == 'WIN')  {
+                                       $facility = LOG_USER;
+                               } else {
+                                       $facility = constant('LOG_'.strtoupper($destination));
+                               }
+                               openlog($ident, LOG_ODELAY, $facility);
+                       }
+               }
+
+               $TYPO3_CONF_VARS['SYS']['systemLogLevel'] = t3lib_div::intInRange($TYPO3_CONF_VARS['SYS']['systemLogLevel'],0,4);
+               $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLogInit'] = TRUE;
+       }
+
+       /**
+        * System error log; This should be implemented around the source code, including the Core and both frontend and backend, logging serious errors.
+        * If you want to implement the sysLog in your applications, simply add lines like:
+        *              t3lib_div::sysLog('[write message in English here]', 'extension key');
+        *
+        * @param       string          Message (in English).
+        * @param       string          Extension key (from which extension you are calling the log) or "Core"
+        * @param       integer         Severity: 0 is info, 1 is notice, 2 is warning, 3 is error, 4 is fatal error
+        * @return      void
+        */
+       function sysLog($msg, $extKey, $severity=0) {
+               global $TYPO3_CONF_VARS;
+
+               $severity = t3lib_div::intInRange($severity,0,4);
+
+                       // is message worth logging?
+               if (intval($TYPO3_CONF_VARS['SYS']['systemLogLevel']) > $severity)      return;
+
+                       // initialize logging
+               if (!$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLogInit'])      {
+                       t3lib_div::initSysLog();
+               }
+
+                       // do custom logging
+               if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLog'])) {
+                       $params = array('msg'=>$msg, 'extKey'=>$extKey);
+                       if (function_exists('debug_backtrace')) {
+                               $params['backTrace'] = debug_backtrace();
+                       }
+                       $fakeThis = FALSE;
+                       foreach($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLog'] as $hookMethod)        {
+                               t3lib_div::callUserFunction($hookMethod,$params,$fakeThis);
+                       }
+               }
+
+                       // TYPO3 logging enabled?
+               if (!$TYPO3_CONF_VARS['SYS']['systemLog'])      return;
+
+                       // use all configured logging options
+               foreach (explode(';',$TYPO3_CONF_VARS['SYS']['systemLog'],2) as $log)   {
+                       list($type,$destination,$level) = explode(',',$log,4);
+
+                               // is message worth logging for this log type?
+                       if (intval($level) > $severity) continue;
+
+                       $msgLine = ' - '.$extKey.': '.$msg;
+
+                               // write message to a file
+                       if ($type == 'file')    {
+                               $file = fopen($destination, 'a');
+                               if ($file)     {
+                                       flock($file, LOCK_EX);  // try locking, but ignore if not available (eg. on NFS and FAT)
+                                       fwrite($file, date('d/m/Y i:H').$msgLine.char(10));
+                                       flock($fp, LOCK_UN);    // release the lock
+                                       fclose($file);
+                               }
+                       }
+                               // send message per mail
+                       elseif ($type == 'mail')        {
+                               list($to,$from) = explode('/',$destination);
+                               mail($to, 'Warning - error in TYPO3 installation',
+                                       'Host: '.$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLogHost']."\n".
+                                       'Extension: '.$extKey."\n".
+                                       'Severity: '.$severity."\n".
+                                       "\n".$msg,
+                                       ($from ? 'From: '.$from : '')
+                               );
+                       }
+                               // use the PHP error log
+                       elseif ($type == 'error_log')   {
+                               error_log($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLogHost'].$msgLine, 0);
+                       }
+                               // use the system log
+                       elseif ($type == 'syslog')      {
+                               $priority = array(LOG_INFO,LOG_NOTICE,LOG_WARNING,LOG_ERR,LOG_CRIT);
+                               syslog($priority[(int)$severity], $msgLine);
+                       }
+               }
+       }
+
+       /**
         * Developer log; This should be implemented around the source code, both frontend and backend, logging everything from the flow through an application, messages, results from comparisons to fatal errors.
         * The result is meant to make sense to developers during development or debugging of a site.
         * The idea is that this function is only a wrapper for external extensions which can set a hook which will be allowed to handle the logging of the information to any format they might wish and with any kind of filter they would like.
@@ -3897,7 +4034,7 @@ class t3lib_div {
 
                if($command==='combine')        {       // This is only used internally, has no effect outside
                        $command = 'composite';
-}
+               }
 
                        // Compile the path & command
                if($im_version==='gm')  {
@@ -3957,6 +4094,24 @@ class t3lib_div {
                }
                return $paramsArr;
        }
+
+
+       /**
+        * Quotes a string for usage as JS parameter. Depends wheter the value is used in script tags (it doesn't need/must not get htmlspecialchared in this case)
+        *
+        * @param       string          The string to encode.
+        * @param       boolean         If the values get's used in <script> tags.
+        * @return      string  The encoded value already quoted
+        */
+       function quoteJSvalue($value, $inScriptTags = false)    {
+               $value = addcslashes($value, '\''.chr(10).chr(13));
+               if (!$inScriptTags)     {
+                       $value = htmlspecialchars($value);
+               }
+               return '\''.$value.'\'';
+       }
+
+
 }
 
 ?>
\ No newline at end of file
index 80fe65f..f2040f6 100755 (executable)
@@ -302,7 +302,7 @@ class t3lib_extFileFunctions extends t3lib_basicFileFunctions       {
                        $lines[] = '
                                        <tr>
                                                <td colspan="2" align="center"><br />'.
-                                               '<form action=""><input type="submit" value="Continue" onclick="'.htmlspecialchars('document.location=\''.$redirect.'\';return false;').'" /></form>'.
+                                               '<form action=""><input type="submit" value="Continue" onclick="'.htmlspecialchars('window.location.href=\''.$redirect.'\';return false;').'" /></form>'.
                                                '</td>
                                        </tr>';
 
@@ -605,6 +605,8 @@ class t3lib_extFileFunctions extends t3lib_basicFileFunctions       {
                                                                                rename($theFile, $theDestFile);
                                                                        } else {
                                                                                $cmd = 'mv "'.$theFile.'" "'.$theDestFile.'"';
+                                                                               $errArr = array();
+                                                                               $retVar = 0;
                                                                                exec($cmd,$errArr,$retVar);
                                                                        }
                                                                        clearstatcache();
index 0a08aea..6e2484a 100755 (executable)
@@ -435,7 +435,7 @@ class t3lib_fullsearch {
                                if (count($rowArr))     {
                                        $out.='<textarea name="whatever" rows="20" wrap="off"'.$GLOBALS['SOBE']->doc->formWidthText($this->formW,'','off').' class="fixed-font">'.t3lib_div::formatForTextarea(implode(chr(10),$rowArr)).'</textarea>';
                                        if (!$this->noDownloadB)        {
-                                               $out.='<BR><input type="submit" name="download_file" value="Click to download file" onClick="document.location=\''.$this->downloadScript.'\';">';               // document.forms[0].target=\'_blank\';
+                                               $out.='<BR><input type="submit" name="download_file" value="Click to download file" onClick="window.location.href=\''.$this->downloadScript.'\';">';            // document.forms[0].target=\'_blank\';
                                        }
                                                // Downloads file:
                                        if (t3lib_div::_GP('download_file'))    {
@@ -470,7 +470,7 @@ class t3lib_fullsearch {
                                        $xmlData=$xmlObj->getResult();
                                        $out.='<textarea name="whatever" rows="20" wrap="off"'.$GLOBALS['SOBE']->doc->formWidthText($this->formW,'','off').' class="fixed-font">'.t3lib_div::formatForTextarea($xmlData).'</textarea>';
                                        if (!$this->noDownloadB)        {
-                                               $out.='<BR><input type="submit" name="download_file" value="Click to download file" onClick="document.location=\''.$this->downloadScript.'\';">';               // document.forms[0].target=\'_blank\';
+                                               $out.='<BR><input type="submit" name="download_file" value="Click to download file" onClick="window.location.href=\''.$this->downloadScript.'\';">';            // document.forms[0].target=\'_blank\';
                                        }
                                                // Downloads file:
                                        if (t3lib_div::_GP('download_file'))    {
index 8c3f50f..f5f7015 100755 (executable)
@@ -292,17 +292,19 @@ class t3lib_iconWorks     {
 #              if (ereg('^width="([0-9]+)" height="([0-9]+)"$',$wHattribs,$reg))       $wHattribs='width="'.($reg[1]*2).'" height="'.($reg[2]*2).'"';
 
                        // Return icon source/wHattributes:
+               $output = '';
                switch($outputMode)     {
                        case 0:
-                               return ' src="'.$backPath.$src.'" '.$wHattribs;
+                               $output = ' src="'.$backPath.$src.'" '.$wHattribs;
                        break;
                        case 1:
-                               return $backPath.$src;
+                               $output = $backPath.$src;
                        break;
                        case 2:
-                               return $wHattribs;
+                               $output = $wHattribs;
                        break;
                }
+               return $output;
        }
 
 
index b2344b0..6057c70 100755 (executable)
@@ -286,11 +286,13 @@ class t3lib_install {
                                        }
                                } else {
                                        if (substr($value,0,1)==')' && substr($value,-1)==';')  {
+                                               $ttype = array();
                                                preg_match('/(ENGINE|TYPE)=([a-zA-Z]*)/',$value,$ttype);
                                                $total[$isTable]['extra']['ttype'] = $ttype[2];
                                                $isTable = '';
                                        } else {
-                                               $lineV = ereg_replace(',$','',$value);
+                                               $lineV = preg_replace('/,$/','',$value);
+                                               $lineV = str_replace('UNIQUE KEY', 'UNIQUE', $lineV);
                                                $parts = explode(' ',$lineV,2);
 
                                                        // Make sure there is no default value when auto_increment is set
@@ -301,8 +303,10 @@ class t3lib_install {
                                                if(strstr($parts[1], ' DEFAULT '))      {
                                                        $parts[1] = str_replace(' DEFAULT ', ' default ', $parts[1]);
                                                }
+                                                       // Remove NOT NULL statements (they are not needed)
+                                               $parts[1] = str_replace(' NOT NULL', '', $parts[1]);
+
                                                        // Change order of "default" and "null" statements
-                                               $parts[1] = preg_replace('/(.*) (default .*) (NOT NULL)/', '$1 $3 $2', $parts[1]);
                                                $parts[1] = preg_replace('/(.*) (default .*) (NULL)/', '$1 $3 $2', $parts[1]);
 
                                                        // Remove double blanks
@@ -566,7 +570,7 @@ class t3lib_install {
         */
        function assembleFieldDefinition($row)  {
                $field[] = $row['Type'];
-               if (!$row['Null'])      { $field[] = 'NOT NULL'; }
+               // if (!$row['Null'])   { $field[] = 'NOT NULL'; }
                if (!strstr($row['Type'],'blob') && !strstr($row['Type'],'text'))       {
                                // Add a default value if the field is not auto-incremented (these fields never have a default definition).
                        if (!stristr($row['Extra'],'auto_increment'))   {
@@ -626,7 +630,9 @@ class t3lib_install {
         */
        function getCreateTables($statements, $insertCountFlag=0)       {
                $crTables = array();
+               $insertCount = array();
                foreach($statements as $line => $linecontent)   {
+                       $reg = array();
                        if (eregi('^create[[:space:]]*table[[:space:]]*[`]?([[:alnum:]_]*)[`]?',substr($linecontent,0,100),$reg))       {
                                $table = trim($reg[1]);
                                if ($table)     {
@@ -659,6 +665,7 @@ class t3lib_install {
        function getTableInsertStatements($statements, $table)  {
                $outStatements=array();
                foreach($statements as $line => $linecontent)   {
+                       $reg = array();
                        if (eregi('^insert[[:space:]]*into[[:space:]]*[`]?([[:alnum:]_]*)[`]?',substr($linecontent,0,100),$reg))        {
                                $nTable = trim($reg[1]);
                                if ($nTable && !strcmp($table,$nTable)) {
index 9cf2bf5..d9f761b 100644 (file)
@@ -387,6 +387,8 @@ class t3lib_loadModules {
                $modconf=Array();
                $path = ereg_replace ('/[^/.]+/\.\./', '/', $fullpath); // because 'path/../path' does not work
                if (@is_dir($path) && @file_exists($path.'/conf.php'))  {
+                       $MCONF = array();
+                       $MLANG = array();
                        include($path.'/conf.php');     // The conf-file is included. This must be valid PHP.
                        if (!$MCONF['shy'] && $this->checkModAccess($name,$MCONF) && $this->checkModWorkspace($name,$MCONF))    {
                                $modconf['name']=$name;
@@ -541,7 +543,7 @@ class t3lib_loadModules {
         * @return      string
         */
        function cleanName ($str)       {
-               return ereg_replace('[^A-Za-z0-9]*','',$str);
+               return preg_replace('/[^a-z0-9]/i','',$str);
        }
 
        /**
index 942c966..67fa165 100644 (file)
@@ -526,20 +526,21 @@ class t3lib_matchCondition {
 
        /**
         * Return global variable where the input string $var defines array keys separated by "|"
+        * Example: $var = "HTTP_SERVER_VARS | something" will return the value $GLOBALS['HTTP_SERVER_VARS']['something'] value
         *
-        * @param       string          Global var key, eg. "HTTP_GET_VAR" or "HTTP_GET_VARS|id" to get the id GET parameter back.
+        * @param       string          Global var key, eg. "HTTP_GET_VAR" or "HTTP_GET_VARS|id" to get the GET parameter "id" back.
         * @param       array           Alternative array than $GLOBAL to get variables from.
         * @return      mixed           Whatever value. If none, then blank string.
         * @access private
         */
-       function getGlobal($var,$inArr='') {
+       function getGlobal($var, $source=NULL)  {
                $vars = explode('|',$var);
                $c = count($vars);
                $k = trim($vars[0]);
-               $theVar = is_array($inArr) ? $inArr[$k] : $GLOBALS[$k];
+               $theVar = isset($source) ? $source[$k] : $GLOBALS[$k];
 
-               for ($a=1;$a<$c;$a++) {
-                       if (!isset($theVar))    {break;}
+               for ($a=1;$a<$c;$a++)   {
+                       if (!isset($theVar))    { break; }
 
                        $key = trim($vars[$a]);
                        if (is_object($theVar)) {
index b620c3e..205bd5f 100755 (executable)
@@ -251,7 +251,7 @@ class t3lib_pageSelect {
 
                        // Initialize:
                if ($lUid<0)    $lUid = $this->sys_language_uid;
-               unset($row);
+               $row = NULL;
 
                        // If language UID is different from zero, do overlay:
                if ($lUid)      {
@@ -932,6 +932,8 @@ class t3lib_pageSelect {
         * @see tslib_cObj::enableFields(), deleteClause()
         */
        function enableFields($table,$show_hidden=-1,$ignore_array=array(),$noVersionPreview=FALSE)     {
+               global $TYPO3_CONF_VARS;
+
                if ($show_hidden==-1 && is_object($GLOBALS['TSFE']))    {       // If show_hidden was not set from outside and if TSFE is an object, set it based on showHiddenPage and showHiddenRecords from TSFE
                        $show_hidden = $table=='pages' ? $GLOBALS['TSFE']->showHiddenPage : $GLOBALS['TSFE']->showHiddenRecords;
                }
index 34e9a08..73b929d 100644 (file)
@@ -128,6 +128,7 @@ class t3lib_parsehtml       {
                        // Q: What shall get returned if no stop marker is given /*everything till the end*/ or nothing
                if ($stop===false)      { return /*substr($content, $start)*/ ''; }
                $content = substr($content, $start, $stop-$start);
+               $matches = array();
                if (preg_match('/^([^\<]*\-\-\>)(.*)(\<\!\-\-[^\>]*)$/s', $content, $matches)===1)      {
                        return $matches[2];
                }
@@ -166,6 +167,7 @@ class t3lib_parsehtml       {
                }
 
                if ($keepMarker)        {
+                       $matches = array();
                        if (preg_match('/^([^\<]*\-\-\>)(.*)(\<\!\-\-[^\>]*)$/s', $between, $matches)===1)      {
                                $before .= $marker.$matches[1];
                                $between = $matches[2];
@@ -183,6 +185,7 @@ class t3lib_parsehtml       {
                                $after = $marker.$after;
                        }
                } else  {
+                       $matches = array();
                        if (preg_match('/^(.*)\<\!\-\-[^\>]*$/s', $before, $matches)===1)       {
                                $before = $matches[1];
                        }
@@ -417,6 +420,7 @@ class t3lib_parsehtml       {
         * @see getFirstTag()
         */
        function getFirstTagName($str,$preserveCase=FALSE)      {
+               $matches = array();
                if (preg_match('/^\s*\<([^\s\>]+)(\s|\>)/', $str, $matches)===1)        {
                        if (!$preserveCase)     {
                                return strtoupper($matches[1]);
@@ -476,6 +480,7 @@ class t3lib_parsehtml       {
         * @see t3lib_div::split_tag_attributes()
         */
        function split_tag_attributes($tag)     {
+               $matches = array();
                if (preg_match('/(\<[^\s]+\s+)?(.*?)\s*(\>)?$/s', $tag, $matches)!==1)  {
                        return array(array(), array());
                }
@@ -957,7 +962,7 @@ class t3lib_parsehtml       {
        function mapTags($value,$tags=array(),$ltChar='<',$ltChar2='<') {
 
                foreach($tags as $from => $to)  {
-                       $value = preg_replace('/'.$preg_quote($ltChar).'(\/)?'.$from.'\s([^\>])*(\/)?\>/', $ltChar2.'$1'.$to.' $2$3>', $value);
+                       $value = preg_replace('/'.preg_quote($ltChar).'(\/)?'.$from.'\s([^\>])*(\/)?\>/', $ltChar2.'$1'.$to.' $2$3>', $value);
                }
                return $value;
        }
index 0658e1e..d2a622c 100755 (executable)
@@ -404,8 +404,18 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
                                        // Init
                                $attribArray = $this->get_tag_attributes_classic($v,1);
                                $siteUrl = $this->siteUrl();
+                               $sitePath = str_replace (t3lib_div::getIndpEnv('TYPO3_REQUEST_HOST'), '', $siteUrl);
+
                                $absRef = trim($attribArray['src']);            // It's always a absolute URL coming from the RTE into the Database.
 
+                                       // make path absolute if it is relative and we have a site path wich is not '/'
+                               $pI=pathinfo($absRef);
+                               if($sitePath AND !$pI['scheme'] && t3lib_div::isFirstPartOfStr($absRef,$sitePath)) {
+                                               // if site is in a subpath (eg. /~user_jim/) this path needs to be removed because it will be added with $siteUrl
+                                       $absRef = substr($absRef,strlen($sitePath));
+                                       $absRef = $siteUrl.$absRef;
+                               }
+
                                        // External image from another URL? In that case, fetch image (unless disabled feature).
                                if (!t3lib_div::isFirstPartOfStr($absRef,$siteUrl) && !$this->procOptions['dontFetchExtPictures'])      {
                                        $externalFile = $this->getUrl($absRef); // Get it
@@ -429,6 +439,7 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
                                                }
                                        }
                                }
+
                                        // Check image as local file (siteURL equals the one of the image)
                                if (t3lib_div::isFirstPartOfStr($absRef,$siteUrl))      {
                                        $path = rawurldecode(substr($absRef,strlen($siteUrl))); // Rel-path, rawurldecoded for special characters.
@@ -537,6 +548,9 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
         */
        function TS_images_rte($value)  {
 
+               $siteUrl = $this->siteUrl();
+               $sitePath = str_replace (t3lib_div::getIndpEnv('TYPO3_REQUEST_HOST'), '', $siteUrl);
+
                        // Split content by <img> tags and traverse the resulting array for processing:
                $imgSplit = $this->splitTags('img',$value);
                foreach($imgSplit as $k => $v)  {
@@ -544,12 +558,14 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
 
                                        // Init
                                $attribArray=$this->get_tag_attributes_classic($v,1);
-                               $siteUrl = $this->siteUrl();
                                $absRef = trim($attribArray['src']);
 
                                        // Unless the src attribute is already pointing to an external URL:
                                if (strtolower(substr($absRef,0,4))!='http')    {
-                                       $attribArray['src'] = $siteUrl.substr($attribArray['src'],strlen($this->relBackPath));
+                                       $attribArray['src'] = substr($attribArray['src'],strlen($this->relBackPath));
+                                               // if site is in a subpath (eg. /~user_jim/) this path needs to be removed because it will be added with $siteUrl
+                                       $attribArray['src'] = preg_replace('#^'.preg_quote($sitePath,'#').'#','',$attribArray['src']);
+                                       $attribArray['src'] = $siteUrl.$attribArray['src'];
                                        if (!isset($attribArray['alt']))        $attribArray['alt']='';
                                        $params = t3lib_div::implodeAttributes($attribArray);
                                        $imgSplit[$k]='<img '.$params.' />';
@@ -1440,6 +1456,7 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
                if ($style)     {
                        $regex='[[:space:]]*:[[:space:]]*([0-9]*)[[:space:]]*px';
                                // Width
+                       $reg = array();
                        eregi('width'.$regex,$style,$reg);
                        $w = intval($reg[1]);
                                // Height
index 53ac51c..d37358c 100755 (executable)
@@ -295,7 +295,7 @@ class t3lib_positionMap {
 
                if ($TSconfigProp['overrideWithExtension'])     {
                        if (t3lib_extMgm::isLoaded($TSconfigProp['overrideWithExtension']))     {
-                               $onclick = "document.location='".t3lib_extMgm::extRelPath($TSconfigProp['overrideWithExtension']).'mod1/index.php?cmd=crPage&positionPid='.$pid."';";
+                               $onclick = "window.location.href='".t3lib_extMgm::extRelPath($TSconfigProp['overrideWithExtension']).'mod1/index.php?cmd=crPage&positionPid='.$pid."';";
                                return $onclick;
                        }
                }
@@ -518,7 +518,7 @@ class t3lib_positionMap {
 //             $location.='&redirect='.rawurlencode($this->R_URI);             // returns to prev. page
                $location.='&uPT=1&redirect='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'));               // This redraws screen
 
-               return 'document.location=\''.$location.'\';return false;';
+               return 'window.location.href=\''.$location.'\';return false;';
        }
 
        /**
index 6e40eb5..d8c7dd1 100755 (executable)
@@ -672,7 +672,7 @@ class t3lib_queryGenerator  {
                reset($this->fields);
                while(list($key,)=each($this->fields)) {
                        if ($GLOBALS['BE_USER']->check('non_exclude_fields',$this->table.':'.$key))     {
-                               $out.='<option value="'.$prepend.$key.'"'.($key==$fieldName ? ' selected':'').'>'.$this->fields[$key]['label'].'</option>';
+                               $out.='<option value="'.$key.'"'.($key==$fieldName ? ' selected':'').'>'.$this->fields[$key]['label'].'</option>';
                        }
                }
                $out.='</select>';
index 586e5e4..6176dcf 100755 (executable)
@@ -256,21 +256,23 @@ class t3lib_recordList {
         * @access private
         */
        function fwd_rwd_HTML($type,$pointer,$table='') {
+               $content = '';
                $tParam = $table ? '&table='.rawurlencode($table) : '';
                switch($type)   {
                        case 'fwd':
                                $href = $this->listURL().'&pointer='.($pointer-$this->iLimit).$tParam;
-                               return '<a href="'.htmlspecialchars($href).'">'.
+                               $content = '<a href="'.htmlspecialchars($href).'">'.
                                                '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/pilup.gif','width="14" height="14"').' alt="" />'.
                                                '</a> <i>[1 - '.$pointer.']</i>';
                        break;
                        case 'rwd':
                                $href = $this->listURL().'&pointer='.$pointer.$tParam;
-                               return '<a href="'.htmlspecialchars($href).'">'.
+                               $content = '<a href="'.htmlspecialchars($href).'">'.
                                                '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/pildown.gif','width="14" height="14"').' alt="" />'.
                                                '</a> <i>['.($pointer+1).' - '.$this->totalItems.']</i>';
                        break;
                }
+               return $content;
        }
 
        /**
index d5991ed..a133fd9 100755 (executable)
@@ -610,6 +610,76 @@ class t3lib_refindex {
        function error($msg)    {
                $this->errorLog[]=$msg;
        }
+       
+       
+       
+       
+       
+       
+       function updateIndex($testOnly,$cli_echo=FALSE) {
+               global $TCA, $TYPO3_DB;
+               
+               $errors = array();
+               $tableNames = array();
+               $recCount=0;
+               $tableCount=0;
+
+               $headerContent = $testOnly ? 'Reference Index TESTED (nothing written)' : 'Reference Index Updated';
+               if ($cli_echo) echo 
+                                               '*******************************************'.chr(10).
+                                               $headerContent.chr(10).
+                                               '*******************************************'.chr(10); 
+               
+                       // Traverse all tables:
+               foreach($TCA as $tableName => $cfg)     {
+                       $tableNames[] = $tableName;
+                       $tableCount++;
+
+                               // Traverse all non-deleted records in tables:
+                       $allRecs = $TYPO3_DB->exec_SELECTgetRows('uid',$tableName,'1'.t3lib_BEfunc::deleteClause($tableName));
+                       $uidList = array(0);
+                       foreach($allRecs as $recdat)    {
+                               $refIndexObj = t3lib_div::makeInstance('t3lib_refindex');
+                               $result = $refIndexObj->updateRefIndexTable($tableName,$recdat['uid'],$testOnly);
+                               $uidList[]= $recdat['uid'];
+                               $recCount++;
+
+                               if ($result['addedNodes'] || $result['deletedNodes'])   {
+                                       $Err = 'Record '.$tableName.':'.$recdat['uid'].' had '.$result['addedNodes'].' added indexes and '.$result['deletedNodes'].' deleted indexes';
+                                       $errors[]= $Err; 
+                                       if ($cli_echo) echo $Err.chr(10);
+                                       #$errors[] = t3lib_div::view_array($result);
+                               }
+                       }
+
+                               // Searching lost indexes for this table:
+                       $where = 'tablename='.$TYPO3_DB->fullQuoteStr($tableName,'sys_refindex').' AND recuid NOT IN ('.implode(',',$uidList).')';
+                       $lostIndexes = $TYPO3_DB->exec_SELECTgetRows('hash','sys_refindex',$where);
+                       if (count($lostIndexes))        {
+                               $Err = 'Table '.$tableName.' has '.count($lostIndexes).' lost indexes which are now deleted';
+                               $errors[]= $Err;
+                               if ($cli_echo) echo $Err.chr(10);
+                               if (!$testOnly) $TYPO3_DB->exec_DELETEquery('sys_refindex',$where);
+                       }
+               }
+
+                       // Searching lost indexes for non-existing tables:
+               $where = 'tablename NOT IN ('.implode(',',$TYPO3_DB->fullQuoteArray($tableNames,'sys_refindex')).')';
+               $lostTables = $TYPO3_DB->exec_SELECTgetRows('hash','sys_refindex',$where);
+               if (count($lostTables)) {
+                       $Err = 'Index table hosted '.count($lostTables).' indexes for non-existing tables, now removed';
+                       $errors[]= $Err;
+                       if ($cli_echo) echo $Err.chr(10);
+                       if (!$testOnly) $TYPO3_DB->exec_DELETEquery('sys_refindex',$where);
+               }
+
+               $testedHowMuch = $recCount.' records from '.$tableCount.' tables were checked/updated.'.chr(10);
+               
+               $bodyContent = $testedHowMuch.(count($errors)?implode(chr(10),$errors):'Index Integrity was perfect!');
+               if ($cli_echo) echo $testedHowMuch.(count($errors)?'Updates: '.count($errors):'Index Integrity was perfect!').chr(10);
+                               
+               return array($headerContent,$bodyContent);
+       }
 }
 
 
index 4368424..c2f746f 100755 (executable)
@@ -223,7 +223,8 @@ class t3lib_sqlengine extends t3lib_sqlparser {
                                $fN = $fInfo['Field'];
 
                                        // Set value:
-                               $saveArray[$fN] = isset($fields_values[$fN]) ? $fields_values[$fN] : $options['Default'];       // $options not defined, kasper!
+// FIXME $options not defined
+                               $saveArray[$fN] = isset($fields_values[$fN]) ? $fields_values[$fN] : $options['Default'];
 
                                        // Process value:
                                $this->processAccordingToConfig($saveArray[$fN], $fInfo);
index f1959c7..8e690be 100755 (executable)
@@ -175,7 +175,7 @@ class t3lib_sqlparser {
                                $result = $this->parseCREATEDATABASE($parseString);
                        break;
                        default:
-                               return $this->parseError('"'.$keyword.'" is not a keyword',$parseString);
+                               $result = $this->parseError('"'.$keyword.'" is not a keyword',$parseString);
                        break;
                }
 
@@ -945,7 +945,7 @@ class t3lib_sqlparser {
                                        }
                                }
 
-                                       // Detecting the operator for the next level; support for AND, OR and &&):
+                                       // Detecting the operator for the next level:
                                $op = $this->nextPart($parseString,'^(AND[[:space:]]+NOT|OR[[:space:]]+NOT|AND|OR)(\(|[[:space:]]+)');
                                if ($op)        {
                                        $stack[$level][$pnt[$level]]['operator'] = $op;
@@ -1044,6 +1044,7 @@ class t3lib_sqlparser {
         * @return      string          The value of the first parenthesis level of the REGEX.
         */
        function nextPart(&$parseString,$regex,$trimAll=FALSE)  {
+               $reg = array();
                if (preg_match('/'.$regex.'/i',$parseString.' ', $reg)) {       // Adding space char because [[:space:]]+ is often a requirement in regex's
                        $parseString = ltrim(substr($parseString,strlen($reg[$trimAll?0:1])));
                        return $reg[1];
@@ -1055,9 +1056,11 @@ class t3lib_sqlparser {
         *
         * @param       string          The parseString, eg. "(0,1,2,3) ..." or "('asdf','qwer') ..." or "1234 ..." or "'My string value here' ..."
         * @param       string          The comparator used before. If "NOT IN" or "IN" then the value is expected to be a list of values. Otherwise just an integer (un-quoted) or string (quoted)
-        * @return      string          The value (string/integer). Otherwise an array with error message in first key (0)
+        * @return      mixed           The value (string/integer). Otherwise an array with error message in first key (0)
         */
        function getValue(&$parseString,$comparator='') {
+               $value = '';
+
                if (t3lib_div::inList('NOTIN,IN,_LIST',strtoupper(str_replace(array(' ',"\n","\r","\t"),'',$comparator))))      {       // List of values:
                        if ($this->nextPart($parseString,'^([(])'))     {
                                $listValues = array();
@@ -1089,19 +1092,21 @@ class t3lib_sqlparser {
 
                        switch($firstChar)      {
                                case '"':
-                                       return array($this->getValueInQuotes($parseString,'"'),'"');
+                                       $value = array($this->getValueInQuotes($parseString,'"'),'"');
                                break;
                                case "'":
-                                       return array($this->getValueInQuotes($parseString,"'"),"'");
+                                       $value = array($this->getValueInQuotes($parseString,"'"),"'");
                                break;
                                default:
+                                       $reg = array();
                                        if (preg_match('/^([[:alnum:]._-]+)/i',$parseString, $reg))     {
                                                $parseString = ltrim(substr($parseString,strlen($reg[0])));
-                                               return array($reg[1]);
+                                               $value = array($reg[1]);
                                        }
                                break;
                        }
                }
+               return $value;
        }
 
        /**
@@ -1119,10 +1124,10 @@ class t3lib_sqlparser {
                foreach($parts as $k => $v)     {
                        $buffer.=$v;
 
-                       unset($reg);
+                       $reg = array();
                        //preg_match('/[\]*$/',$v,$reg); // does not work. what is the *exact* meaning of the next line?
                        ereg('[\]*$',$v,$reg);
-                       if (strlen($reg[0])%2)  {
+                       if ($reg AND strlen($reg[0])%2) {
                                $buffer.=$quote;
                        } else {
                                $parseString = ltrim(substr($parseString,strlen($buffer)+2));
@@ -1638,17 +1643,20 @@ return $str;
         * @return      mixed           Returns array with string 1 and 2 if error, otherwise false
         */
        function debug_parseSQLpart($part,$str) {
+               $retVal = false;
+
                switch($part)   {
                        case 'SELECT':
-                               return $this->debug_parseSQLpartCompare($str,$this->compileFieldList($this->parseFieldList($str)));
+                               $retVal = $this->debug_parseSQLpartCompare($str,$this->compileFieldList($this->parseFieldList($str)));
                        break;
                        case 'FROM':
-                               return $this->debug_parseSQLpartCompare($str,$this->compileFromTables($this->parseFromTables($str)));
+                               $retVal = $this->debug_parseSQLpartCompare($str,$this->compileFromTables($this->parseFromTables($str)));
                        break;
                        case 'WHERE':
-                               return $this->debug_parseSQLpartCompare($str,$this->compileWhereClause($this->parseWhereClause($str)));
+                               $retVal = $this->debug_parseSQLpartCompare($str,$this->compileWhereClause($this->parseWhereClause($str)));
                        break;
                }
+               return $retVal;
        }
 
        /**
index 39e8eb2..65beb35 100755 (executable)
@@ -488,8 +488,8 @@ class t3lib_TCEforms        {
                                                                if ($sField)    $sField.=$sFieldPal;
 
                                                                $out_array[$out_sheet][$out_pointer].= $sField;
-                                                       } elseif($theField=='--div--')  {
-                                                               if ($cc>0) {
+                                                       } elseif ($theField=='--div--') {
+                                                               if ($cc>0)      {
                                                                        $out_array[$out_sheet][$out_pointer].=$this->getDivider();
 
                                                                        if ($this->enableTabMenu && $TCA[$table]['ctrl']['dividers2tabs'])      {
@@ -734,10 +734,13 @@ class t3lib_TCEforms      {
 
                                        // Create a JavaScript code line which will ask the user to save/update the form due to changing the element. This is used for eg. "type" fields and others configured with "requestUpdate"
                                if (
-                                               (($TCA[$table]['ctrl']['type'] && !strcmp($field,$TCA[$table]['ctrl']['type'])) ||
-                                               ($TCA[$table]['ctrl']['requestUpdate'] && t3lib_div::inList($TCA[$table]['ctrl']['requestUpdate'],$field)))
-                                               && $GLOBALS['BE_USER']->jsConfirmation(1))      {
-                                       $alertMsgOnChange = 'if (confirm('.$GLOBALS['LANG']->JScharCode($this->getLL('m_onChangeAlert')).') && TBE_EDITOR_checkSubmit(-1)){ TBE_EDITOR_submitForm() };';
+                                       ($TCA[$table]['ctrl']['type'] && !strcmp($field,$TCA[$table]['ctrl']['type'])) ||
+                                       ($TCA[$table]['ctrl']['requestUpdate'] && t3lib_div::inList($TCA[$table]['ctrl']['requestUpdate'],$field))) {
+                                       if($GLOBALS['BE_USER']->jsConfirmation(1))      {
+                                               $alertMsgOnChange = 'if (confirm('.$GLOBALS['LANG']->JScharCode($this->getLL('m_onChangeAlert')).') && TBE_EDITOR_checkSubmit(-1)){ TBE_EDITOR_submitForm() };';
+                                       } else {
+                                               $alertMsgOnChange = 'if (TBE_EDITOR_checkSubmit(-1)){ TBE_EDITOR_submitForm() };';
+                                       }
                                } else {
                                        $alertMsgOnChange = '';
                                }
@@ -2194,12 +2197,15 @@ class t3lib_TCEforms    {
                                                                }
 
                                                                if (
-                                                                       (($GLOBALS['TCA'][$table]['ctrl']['type'] && !strcmp($key,$GLOBALS['TCA'][$table]['ctrl']['type'])) ||
-                                                                       ($GLOBALS['TCA'][$table]['ctrl']['requestUpdate'] && t3lib_div::inList($GLOBALS['TCA'][$table]['ctrl']['requestUpdate'],$key)))
-                                                                       && $GLOBALS['BE_USER']->jsConfirmation(1))      {
-                                                                       $alertMsgOnChange = 'if (confirm('.$GLOBALS['LANG']->JScharCode($this->getLL('m_onChangeAlert')).') && TBE_EDITOR_checkSubmit(-1)){ TBE_EDITOR_submitForm() };';
+                                                                       ($GLOBALS['TCA'][$table]['ctrl']['type'] && !strcmp($key,$GLOBALS['TCA'][$table]['ctrl']['type'])) ||
+                                                                       ($GLOBALS['TCA'][$table]['ctrl']['requestUpdate'] && t3lib_div::inList($GLOBALS['TCA'][$table]['ctrl']['requestUpdate'],$key))) {
+                                                                       if ($GLOBALS['BE_USER']->jsConfirmation(1))     {
+                                                                               $alertMsgOnChange = 'if (confirm('.$GLOBALS['LANG']->JScharCode($this->getLL('m_onChangeAlert')).') && TBE_EDITOR_checkSubmit(-1)){ TBE_EDITOR_submitForm() };';
+                                                                       } else {
+                                                                               $alertMsgOnChange = 'if(TBE_EDITOR_checkSubmit(-1)){ TBE_EDITOR_submitForm();}';
+                                                                       }
                                                                } else {
-                                                                       $alertMsgOnChange = 'if(TBE_EDITOR_checkSubmit(-1)){ TBE_EDITOR_submitForm();}';
+                                                                       $alertMsgOnChange = '';
                                                                }
 
                                                                $fakePA['fieldChangeFunc']=$PA['fieldChangeFunc'];
@@ -3608,10 +3614,8 @@ class t3lib_TCEforms     {
                                break;
                                case 'modListGroup':
                                case 'modListUser':
-                                       if (!is_object($loadModules))   {
-                                               $loadModules = t3lib_div::makeInstance('t3lib_loadModules');
-                                               $loadModules->load($GLOBALS['TBE_MODULES']);
-                                       }
+                                       $loadModules = t3lib_div::makeInstance('t3lib_loadModules');
+                                       $loadModules->load($GLOBALS['TBE_MODULES']);
 
                                        $modList = $fieldValue['config']['special']=='modListUser' ? $loadModules->modListUser : $loadModules->modListGroup;
                                        if (is_array($modList)) {
@@ -4433,7 +4437,7 @@ class t3lib_TCEforms      {
                                                if (document.'.$formname.'[theField])           url+="&rec["+field+"]="+TBE_EDITOR_rawurlencode(document.'.$formname.'[theField].value);
                                        }
                                        if (top.topmenuFrame)   {
-                                               top.topmenuFrame.document.location = url+"&backRef="+(top.content.list_frame ? (top.content.list_frame.view_frame ? "top.content.list_frame.view_frame" : "top.content.list_frame") : "top.content");
+                                               top.topmenuFrame.location.href = url+"&backRef="+(top.content.list_frame ? (top.content.list_frame.view_frame ? "top.content.list_frame.view_frame" : "top.content.list_frame") : "top.content");
                                        } else if (!isOnFocus) {
                                                var vHWin=window.open(url,"palette","height=300,width=200,status=0,menubar=0,scrollbars=1");
                                                vHWin.focus();
@@ -4857,14 +4861,17 @@ class t3lib_TCEforms    {
         * @return      string          The value of the label, fetched for the current backend language.
         */
        function getLL($str)    {
+               $content = '';
+
                switch(substr($str,0,2))        {
                        case 'l_':
-                               return $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.'.substr($str,2));
+                               $content = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.'.substr($str,2));
                        break;
                        case 'm_':
-                               return $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:mess.'.substr($str,2));
+                               $content = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:mess.'.substr($str,2));
                        break;
                }
+               return $content;
        }
 
        /**
index a5f1c43..dac398e 100755 (executable)
@@ -351,6 +351,10 @@ class t3lib_TCEmain        {
                $this->username = $this->BE_USER->user['username'];
                $this->admin = $this->BE_USER->user['admin'];
 
+               if ($GLOBALS['BE_USER']->uc['recursiveDelete'])    {
+                       $this->deleteTree = 1;
+               }
+
                        // Initializing default permissions for pages
                $defaultPermissions = $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPermissions'];
                if (isset($defaultPermissions['user']))         {$this->defaultPermissions['user'] = $defaultPermissions['user'];}
@@ -539,6 +543,7 @@ class t3lib_TCEmain {
                                */
                        $modifyAccessList = $this->checkModifyAccessList($table);
                        if (!$modifyAccessList) {
+                               $id = 0;
                                $this->log($table,$id,2,0,1,"Attempt to modify table '%s' without permission",1,array($table));
                        }
                        if (isset($TCA[$table]) && !$this->tableReadOnly($table) && is_array($this->datamap[$table]) && $modifyAccessList)      {
@@ -1015,7 +1020,7 @@ class t3lib_TCEmain       {
                                                );
                                        }
                                } elseif ($eFile && is_string($eFile))  {
-                                       $this->log($insertTable,$id,2,0,1,"Write-file error: '%s'",13,array($eFile),$realPid);
+                                       $this->log($table,$id,2,0,1,"Write-file error: '%s'",13,array($eFile),$realPid);
                                }
                        }
                }
@@ -1255,7 +1260,7 @@ class t3lib_TCEmain       {
                        $value = implode(',',$value);
                }
 
-                       // This converts all occurencies of '&#123;' to the byte 123 in the string - this is needed in very rare cases where filenames with special characters (like æøå, umlaud etc) gets sent to the server as HTML entities instead of bytes. The error is done only by MSIE, not Mozilla and Opera.
+                       // This converts all occurencies of '&#123;' to the byte 123 in the string - this is needed in very rare cases where filenames with special characters (like ���, umlaud etc) gets sent to the server as HTML entities instead of bytes. The error is done only by MSIE, not Mozilla and Opera.
                        // Anyways, this should NOT disturb anything else:
                $value = $this->convNumEntityToByteValue($value);
 
@@ -2065,8 +2070,9 @@ class t3lib_TCEmain       {
                                // Check if the table may be modified!
                        $modifyAccessList = $this->checkModifyAccessList($table);
                        if (!$modifyAccessList) {
+                               $id = 0;
                                $this->log($table,$id,2,0,1,"Attempt to modify table '%s' without permission",1,array($table));
-                       }
+                       }       // FIXME: $id not set here (Comment added by Sebastian Kurfuerst)
 
                                // Check basic permissions and circumstances:
                        if (isset($TCA[$table]) && !$this->tableReadOnly($table) && is_array($this->cmdmap[$table]) && $modifyAccessList)       {
@@ -2131,6 +2137,9 @@ class t3lib_TCEmain       {
                                                        case 'delete':
                                                                $this->deleteAction($table, $id);
                                                        break;
+                                                       case 'undelete':
+                                                               $this->undeleteRecord($table, $id);
+                                                       break;
                                                }
 
                                                foreach($hookObjectsArr as $hookObj) {
@@ -2893,8 +2902,18 @@ class t3lib_TCEmain      {
                                                                                        // Set exclude Fields:
                                                                                foreach($TCA[$table]['columns'] as $fN => $fCfg)        {
                                                                                        if ($fCfg['l10n_mode']=='prefixLangTitle')      {       // Check if we are just prefixing:
-                                                                                               if ($fCfg['config']['type']=='text' || $fCfg['config']['type']=='input')        {
-                                                                                                       $overrideValues[$fN] = '[Translate to '.$langRec['title'].':] '.$row[$fN];
+                                                                                               if (($fCfg['config']['type']=='text' || $fCfg['config']['type']=='input') && strlen($row[$fN])) {
+                                                                                                       list($tscPID) = t3lib_BEfunc::getTSCpid($table,$uid,'');
+                                                                                                       $TSConfig = $this->getTCEMAIN_TSconfig($tscPID);
+
+                                                                                                       if (isset($TSConfig['translateToMessage']) && strlen($TSConfig['translateToMessage']))  {
+                                                                                                               $translateToMsg = @sprintf($TSConfig['translateToMessage'], $langRec['title']);
+                                                                                                       }
+                                                                                                       if (!strlen($translateToMsg))   {
+                                                                                                               $translateToMsg = 'Translate to '.$langRec['title'].':';
+                                                                                                       }
+
+                                                                                                       $overrideValues[$fN] = '['.$translateToMsg.'] '.$row[$fN];
                                                                                                }
                                                                                        } elseif (t3lib_div::inList('exclude,noCopy,mergeIfNotBlank',$fCfg['l10n_mode']) && $fN!=$TCA[$table]['ctrl']['languageField'] && $fN!=$TCA[$table]['ctrl']['transOrigPointerField']) {  // Otherwise, do not copy field (unless it is the language field or pointer to the original language)
                                                                                                $excludeFields[] = $fN;
@@ -2994,7 +3013,18 @@ class t3lib_TCEmain      {
        }
 
        /**
-        * Deleting a record
+        * Undelete a record
+        *
+        * @param       string          Table name
+        * @param       integer         Record UID
+        * @return      void
+        */
+       function undeleteRecord($table,$uid)    {
+               $this->deleteRecord($table,$uid,TRUE,FALSE,TRUE);
+       }
+
+       /**
+        * Deleting/Undeleting a record
         * This function may not be used to delete pages-records unless the underlying records are already deleted
         * Deletes a record regardless of versioning state (live of offline, doesn't matter, the uid decides)
         * If both $noRecordCheck and $forceHardDelete are set it could even delete a "deleted"-flagged record!
@@ -3003,9 +3033,10 @@ class t3lib_TCEmain      {
         * @param       integer         Record UID
         * @param       boolean         Flag: If $noRecordCheck is set, then the function does not check permission to delete record
         * @param       boolean         If TRUE, the "deleted" flag is ignored if applicable for record and the record is deleted COMPLETELY!
+        * @param       boolean         If TRUE, the "deleted" flag is set to 0 again and thus, the item is undeleted.
         * @return      void
         */
-       function deleteRecord($table,$uid, $noRecordCheck=FALSE, $forceHardDelete=FALSE)        {
+       function deleteRecord($table,$uid, $noRecordCheck=FALSE, $forceHardDelete=FALSE,$undeleteRecord=FALSE)  {
                global $TCA;
 
                $uid = intval($uid);
@@ -3015,12 +3046,17 @@ class t3lib_TCEmain     {
 
                                $deleteRow = $TCA[$table]['ctrl']['delete'];
                                if ($deleteRow && !$forceHardDelete)    {
+                                       $value = $undeleteRecord ? 0 : 1;
                                        $updateFields = array(
-                                               $deleteRow => 1
+                                               $deleteRow => $value
                                        );
 
+                                       if ($TCA[$table]['ctrl']['tstamp']) {
+                                               $updateFields[$TCA[$table]['ctrl']['tstamp']] = time();
+                                       }
+
                                                // If the table is sorted, then the sorting number is set very high
-                                       if ($TCA[$table]['ctrl']['sortby'])     {
+                                       if ($TCA[$table]['ctrl']['sortby'] && !$undeleteRecord) {
                                                $updateFields[$TCA[$table]['ctrl']['sortby']] = 1000000000;
                                        }
 
@@ -3044,10 +3080,11 @@ class t3lib_TCEmain     {
                                        $GLOBALS['TYPO3_DB']->exec_DELETEquery($table, 'uid='.intval($uid));
                                }
 
+                               $state = $undeleteRecord ? 1 : 3;       // 1 means insert, 3 means delete
                                if (!$GLOBALS['TYPO3_DB']->sql_error()) {
-                                       $this->log($table,$uid,3,0,0,'');
+                                       $this->log($table,$uid,$state,0,0,'');
                                } else {
-                                       $this->log($table,$uid,3,0,100,$GLOBALS['TYPO3_DB']->sql_error());
+                                       $this->log($table,$uid,$state,0,100,$GLOBALS['TYPO3_DB']->sql_error());
                                }
 
                                        // Update reference index:
@@ -3688,6 +3725,7 @@ $this->log($table,$id,6,0,0,'Stage raised...',30,array('comment'=>$comment,'stag
                        // If a change has been done, set the new value(s)
                if ($set)       {
                        if ($conf['MM'])        {
+// FIXME $theUidToUpdate is undefined
                                $dbAnalysis->writeMM($conf['MM'], $theUidToUpdate, $prependName);
                        } else {
                                $vArray = $dbAnalysis->getValueArray($prependName);
@@ -4380,14 +4418,12 @@ $this->log($table,$id,6,0,0,'Stage raised...',30,array('comment'=>$comment,'stag
                        $TSConfig = $this->getTCEMAIN_TSconfig($tscPID);
 
                        $tE = $this->getTableEntries($table,$TSConfig);
-                       $keepEntries = strcmp($tE['history.']['keepEntries'],'') ? t3lib_div::intInRange($tE['history.']['keepEntries'],0,200) : 10;
-                       $maxAgeSeconds = 60*60*24*(strcmp($tE['history.']['maxAgeDays'],'') ? t3lib_div::intInRange($tE['history.']['maxAgeDays'],0,200) : 7);  // one week
+                       $maxAgeSeconds = 60*60*24*(strcmp($tE['history.']['maxAgeDays'],'') ? t3lib_div::intInRange($tE['history.']['maxAgeDays'],0,365) : 30); // one month
 
                                // Garbage collect old entries:
-                       $this->clearHistory($table,$id,t3lib_div::intInRange($keepEntries-1,0),$maxAgeSeconds);
+                       $this->clearHistory($maxAgeSeconds, $table);
 
                                // Set history data:
-                       if ($keepEntries)       {
                                $fields_values = array();
                                $fields_values['history_data'] = serialize($this->historyRecords[$table.':'.$id]);
                                $fields_values['fieldlist'] = implode(',',array_keys($this->historyRecords[$table.':'.$id]['newRecord']));
@@ -4399,37 +4435,19 @@ $this->log($table,$id,6,0,0,'Stage raised...',30,array('comment'=>$comment,'stag
                                $GLOBALS['TYPO3_DB']->exec_INSERTquery('sys_history', $fields_values);
                        }
                }
-       }
 
        /**
         * Clearing sys_history table from older entries that are expired.
-        * All snapshots are excluded of course.
         *
-        * @param       string          Table name
-        * @param       integer         Record UID
-        * @param       integer         $keepEntries (int+) defines the number of current entries from sys_history table to keep in addition to the new one which is put in.
         * @param       integer         $maxAgeSeconds (int+) however will set a max age in seconds so that any entry older than current time minus the age removed no matter what. If zero, this is not effective.
+        * @param       string          table where the history should be cleared
         * @return      void
         */
-       function clearHistory($table,$id,$keepEntries=10,$maxAgeSeconds=604800)         {
+       function clearHistory($maxAgeSeconds=604800,$table)     {
                $tstampLimit = $maxAgeSeconds ? time()-$maxAgeSeconds : 0;
 
-               $where = '
-                       tablename='.$GLOBALS['TYPO3_DB']->fullQuoteStr($table, 'sys_history').'
-                       AND recuid='.intval($id).'
-                       AND snapshot=0';
-
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,tstamp', 'sys_history', $where, '', 'uid DESC', intval($keepEntries).',1');
-               $resRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
-               if ($tstampLimit && intval($resRow['tstamp'])<$tstampLimit)     {
-                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,tstamp', 'sys_history', $where.' AND tstamp<'.intval($tstampLimit), '', 'uid DESC', '1');
-                       $resRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
-
-                       $GLOBALS['TYPO3_DB']->exec_DELETEquery('sys_history', $where.' AND uid<='.intval($resRow['uid']));
-               } elseif (is_array($resRow)) {
-                       $GLOBALS['TYPO3_DB']->exec_DELETEquery('sys_history', $where.' AND uid<='.intval($resRow['uid']));
+               $GLOBALS['TYPO3_DB']->exec_DELETEquery('sys_history', 'tstamp<'.intval($tstampLimit).' AND tablename="'.$table.'"');
                }
-       }
 
        /**
         * Update Reference Index (sys_refindex) for a record
@@ -5392,6 +5410,7 @@ State was change by %s (username: %s)
                                // Call post processing function for clear-cache:
                        global $TYPO3_CONF_VARS;
                        if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc']))    {
+// FIXME $uid_page is undefined
                                $_params = array('table' => $table,'uid' => $uid,'uid_page' => $uid_page,'TSConfig' => $TSConfig);
                                foreach($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'] as $_funcRef)     {
                                        t3lib_div::callUserFunction($_funcRef,$_params,$this);
@@ -5580,7 +5599,7 @@ State was change by %s (username: %s)
                        $lines[] = '
                                        <tr>
                                                <td colspan="2" align="center"><br />'.
-                                               '<form action=""><input type="submit" value="Continue" onclick="'.htmlspecialchars('document.location=\''.$redirect.'\';return false;').'"></form>'.
+                                               '<form action=""><input type="submit" value="Continue" onclick="'.htmlspecialchars('window.location.href=\''.$redirect.'\';return false;').'"></form>'.
                                                '</td>
                                        </tr>';
 
index 3f4d80e..fe07a33 100755 (executable)
@@ -234,6 +234,7 @@ class t3lib_TSparser {
                                                $objStrName=trim(substr($line,0,$varL));
                                                if ($this->syntaxHighLight)     $this->regHighLight("objstr",$lineP,strlen(substr($line,$varL)));
                                                if ($objStrName)        {
+                                                       $r = array();
                                                        if ($this->strict && eregi('[^[:alnum:]_\.-]',$objStrName,$r))  {
                                                                $this->error('Line '.($this->lineNumberOffset+$this->rawP-1).': Object Name String, "'.htmlspecialchars($objStrName).'" contains invalid character "'.$r[0].'". Must be alphanumeric or one of: "_-."');
                                                        } else {
index 09c1221..d05164f 100755 (executable)
@@ -244,6 +244,7 @@ class t3lib_tsStyleConfig extends t3lib_tsparser_ext        {
        function ext_fNandV($params)    {
                $fN='data['.$params["name"].']';
                $fV=$params["value"]=isset($this->ext_realValues[$params["name"]]) ? $this->ext_realValues[$params["name"]] : $params["default_value"];
+               $reg = array();
                if (ereg("^{[\$][a-zA-Z0-9\.]*}$",trim($fV),$reg))      {               // Values entered from the constantsedit cannot be constants!   230502; removed \{ and set {
                        $fV="";
                }
index 955af33..ed6075b 100755 (executable)
@@ -973,12 +973,11 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
         **/
         function jsConfirmation($bitmask)      {
                 $alertPopup = $GLOBALS['BE_USER']->getTSConfig('options.alertPopups');
-                $alertPopup = (int)$alertPopup['value'];
-
-                if(!$alertPopup)       {
+                if (empty($alertPopup['value']))       {
                         $alertPopup = 255;     // default: show all warnings
+                } else {
+                        $alertPopup = (int)$alertPopup['value'];
                 }
-
                 if(($alertPopup&$bitmask) == $bitmask) { // show confirmation
                         return 1;
                 } else { // don't show confirmation
@@ -1144,6 +1143,7 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
         * @access private
         */
        function fetchGroups($grList,$idList='')        {
+               global $TYPO3_CONF_VARS;
 
                        // Fetching records of the groups in $grList (which are not blocked by lockedToDomain either):
                $lockToDomain_SQL = ' AND (lockToDomain=\'\' OR lockToDomain=\''.t3lib_div::getIndpEnv('HTTP_HOST').'\')';
@@ -1220,6 +1220,16 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
                                }
                        }
                }
+
+               // ****************
+               // HOOK: fetchGroups_postProcessing
+               // ****************
+               if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['fetchGroups_postProcessing'])) {
+                       foreach($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['fetchGroups_postProcessing'] as $_funcRef) {
+                               $_params = array();
+                               t3lib_div::callUserFunction($_funcRef, $_params, $this);
+                       }
+               }
        }
 
        /**
diff --git a/t3lib/compat_php5.php b/t3lib/compat_php5.php
new file mode 100644 (file)
index 0000000..963a006
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+/**
+ * TYPO3 compatibility layer PHP4 <> PHP5
+ * These functions provide PHP5 functionality when not available (in PHP4).
+ *
+ * @author     René Fritz <r.fritz@colorcube.de>
+ */
+
+
+/**
+ * borrowed from PEAR
+ * @author Aidan Lister <aidan@php.net>
+ */
+
+eval('
+    function clone($object)
+    {
+        // Sanity check
+        if (!is_object($object)) {
+            user_error(\'clone() __clone method called on non-object\', E_USER_WARNING);
+            return;
+        }
+
+        // Use serialize/unserialize trick to deep copy the object
+        $object = unserialize(serialize($object));
+
+        // If there is a __clone method call it on the "new" class
+        if (method_exists($object, \'__clone\')) {
+            $object->__clone();
+        }
+
+        return $object;
+    }
+');
+
+
+?>
\ No newline at end of file
index c333f82..1196adf 100755 (executable)
@@ -56,11 +56,11 @@ $TYPO3_CONF_VARS = Array(
                'doNotCheckReferer' => 0,                               // Boolean. If set, it's NOT checked numerous places that the refering host is the same as the current. This is an option you should set if you have problems with proxies not passing the HTTP_REFERER variable.
                'recursiveDomainSearch' => 0,                   // Boolean. If set, the search for domain records will be done recursively by stripping parts of the host name off until a matching domain record is found.
                'devIPmask' => '192.168.*,127.0.0.1',   // Defines a list of IP addresses which will allow development-output to display. The debug() function will use this as a filter. See the function t3lib_div::cmpIP() for details on syntax. Setting this to blank value will deny all. Setting to '*' will allow all.
-               'sqlDebug' => FALSE,                                    // Boolean. If set, then database queries that fails are outputted in browser. For development.
+               'sqlDebug' => 0,                                        // Boolean. If set, then database queries that fails are outputted in browser. For development.
                'enable_DLOG' => FALSE,                                 // Whether the developer log is enabled. See constant "TYPO3_DLOG"
                'ddmmyy' => 'd-m-y',                                    // Format of Date-Month-Year - see PHP-function date()
                'hhmm' => 'H:i',                                                // Format of Hours-minutes - see PHP-function date()
-               'USdateFormat' => FALSE,                                // Boolean. If true, dates entered in the TCEforms of the backend will be formatted mm-dd-yyyy
+               'USdateFormat' => 0,                            // Boolean. If true, dates entered in the TCEforms of the backend will be formatted mm-dd-yyyy
                'loginCopyrightWarrantyProvider' => '',         // String: If you provide warranty for TYPO3 to your customers insert you (company) name here. It will appear in the login-dialog as the warranty provider. (You must also set URL below).
                'loginCopyrightWarrantyURL' => '',              // String: Add the URL where you explain the extend of the warranty you provide. This URL is displayed in the login dialog as the place where people can learn more about the conditions of your warranty. Must be set (more than 10 chars) in addition with the 'loginCopyrightWarrantyProvider' message.
                'loginCopyrightShowVersion' => 0,               // Boolean: If set, the current TYPO3 version is shown.
@@ -77,6 +77,7 @@ $TYPO3_CONF_VARS = Array(
                't3lib_cs_utils' => '',                                 // String (values: "iconv" - PHP 5.0 only!, "mbstring", default is homemade PHP-code). Defines which of these PHP-features to use for various Charset processing functions in t3lib_cs. Will speed up charset functions radically.
                'no_pconnect' => 0,                                             // Boolean: If true, "connect" is used instead of "pconnect" when connecting to the database!
                'multiplyDBfieldSize' => 1,                             // Double: 1-5: Amount used to multiply the DB field size when the install tool is evaluating the database size (eg. "2.5"). This is useful if you want to expand the size of fields for utf-8 etc. For western european sites using utf-8 the need should not be for more than twice the normal single-byte size (2) and for chinese / asian languages 3 should suffice.
+               'setDBinit' => array(),                                 // Array, commands to send to database right after connecting. Ignored by the DBAL extension!
                'setMemoryLimit' => 0,                                  // Integer, memory_limit in MB: If more than 16, TYPO3 will try to use ini_set() to set the memory limit of PHP to the value. This works only if the function ini_set() is not disabled by your sysadmin.
                'forceReturnPath' => 0,                                 // Boolean: Force return path to be applied in mail() calls. If this is set, all calls to mail() done by t3lib_htmlmail will be called with '-f<return_path> as the 5th parameter. This will make the return path correct on almost all Unix systems. There is a known problem with Postfix below version 2: Mails are not sent if this option is set and Postfix is used. On Windows platforms, the return path is set via a call to ini_set. This has no effect if safe_mode in PHP is on.
                'displayErrors' => -1,                                  // Integer, -1,0,1,2. 0=Do not display any PHP error messages. 1=Display error messages. 2=Display only if client matches TYPO3_CONF_VARS[SYS][devIPmask]. -1=Default setting. With this option, you can override the PHP setting "display_errors". It is suggested that you set this to "0" and enable the "error_log" option in php.ini instead.
@@ -110,8 +111,8 @@ $TYPO3_CONF_VARS = Array(
                'userHomePath' => '',                                   // Path to the directory where TYPO3 backend-users have their home-dirs.  Eg. '/home/typo3/users/'. A home for backend user 2 would be: '/home/typo3/users/2/'. Ending slash required!
                'groupHomePath' => '',                                  // Path to the directory where TYPO3 backend-groups have their home-dirs. Remember that the first part of this path must be 'lockRootPath'. Eg. '/home/typo3/groups/'. A home for backend group 1 would be: '/home/typo3/groups/1/'. Ending slash required!
                'userUploadDir' => '',                                  // Suffix to the user home dir which is what gets mounted in TYPO3. Eg. if the user dir is "../123_user/" and this value is "/upload" then "../123_user/upload" gets mounted.
-               'fileCreateMask' => '0775',                             // File mode mask for Unix file systems (when files are uploaded/created). Execute bit is set since some files installed in extensions might need that.
-               'folderCreateMask' => '0775',                   // As above, but for folders.
+               'fileCreateMask' => '0755',                             // File mode mask for Unix file systems (when files are uploaded/created). Execute bit is set since some files installed in extensions might need that.
+               'folderCreateMask' => '0755',                   // As above, but for folders.
                'createGroup' => '',                                    // Group for newly created files and folders (Unix only). Group ownership can be changed on Unix file systems (see above). Set this if you want to change the group ownership of created files/folders to a specific group. This makes sense in all cases where the webserver is running with a different user/group as you do. Create a new group on your system and add you and the webserver user to the group. Now you can safely set the last bit in fileCreateMask/folderCreateMask to 0 (e.g. 770). Important: The user who is running your webserver needs to be a member of the group you specify here! Otherwise you might get some error messages.
                'warning_email_addr' => '',                             // Email-address that will receive a warning if there has been failed logins 4 times within an hour (all users).
                'warning_mode' => '',                                   // Bit 1: If set, warning_email_addr gets a mail everytime a user logs in. Bit 2: If set, a mail is sent if an ADMIN user logs in! Other bits reserved for future options.
@@ -239,9 +240,9 @@ $TYPO3_CONF_VARS = Array(
 $T3_VAR = array();     // Initialize.
 
        // TYPO3 version
-$TYPO_VERSION = '3.9-dev';
+$TYPO_VERSION = '4.0beta1';
 define('TYPO3_version', $TYPO_VERSION);
-define('TYPO3_branch', '3.9');
+define('TYPO3_branch', '4.0');
 
 // Database-variables are cleared!
 $typo_db = '';                                 // The database name
@@ -252,7 +253,7 @@ $typo_db_tables_script = '';        // The filename of the tables.php script in typo3co
 $typo_db_extTableDef_script = '';      // The filename of an additional script in typo3conf/-folder which is included after tables.php. Code in this script should modify the tables.php-configuration only, and this provides a good way to extend the standard-distributed tables.php file.
 
        // Include localconf.php. Use this file to configure TYPO3 for your needs and database
-if (!@is_file(PATH_typo3conf.'localconf.php')) die(PATH_typo3conf.'localconf.php is not found!');
+if (!@is_file(PATH_typo3conf.'localconf.php')) die('localconf.php is not found!');
 require(PATH_typo3conf.'localconf.php');
 
        // Defining the database setup as constants
@@ -335,6 +336,10 @@ function debugEnd() {
 }
 
 
+       // include compatibility functions <PHP5
+if (version_compare(phpversion(), '5.0') < 0) {
+       include_once('compat_php5.php');
+}
 
        // Init services array:
 $T3_SERVICES = array();
diff --git a/t3lib/gfx/button_top_right.gif b/t3lib/gfx/button_top_right.gif
new file mode 100755 (executable)
index 0000000..4a32b80
Binary files /dev/null and b/t3lib/gfx/button_top_right.gif differ
diff --git a/t3lib/gfx/markstate.gif b/t3lib/gfx/markstate.gif
new file mode 100644 (file)
index 0000000..bbd4e91
Binary files /dev/null and b/t3lib/gfx/markstate.gif differ
diff --git a/t3lib/gfx/revert_0.gif b/t3lib/gfx/revert_0.gif
new file mode 100644 (file)
index 0000000..20273d1
Binary files /dev/null and b/t3lib/gfx/revert_0.gif differ
diff --git a/t3lib/gfx/revert_1.gif b/t3lib/gfx/revert_1.gif
new file mode 100644 (file)
index 0000000..24afa93
Binary files /dev/null and b/t3lib/gfx/revert_1.gif differ
diff --git a/t3lib/gfx/revert_2.gif b/t3lib/gfx/revert_2.gif
new file mode 100644 (file)
index 0000000..93ec834
Binary files /dev/null and b/t3lib/gfx/revert_2.gif differ
diff --git a/t3lib/gfx/unmarkstate.gif b/t3lib/gfx/unmarkstate.gif
new file mode 100644 (file)
index 0000000..1a725be
Binary files /dev/null and b/t3lib/gfx/unmarkstate.gif differ
index 9ea70fe..8092f0b 100755 (executable)
@@ -52,7 +52,7 @@ function JSmenu (levels,formname) {
 function JSmenuAddItem (parent,prevItem,openID,title,url,target) {
        this.count++;
        var entryID = this.count;
-       this.entry[entryID] = new JSmenuItem (this, entryID, 0, parent, openID, unescape(title), unescape(url), target);
+       this.entry[entryID] = new JSmenuItem (this, entryID, 0, parent, openID, title, url, target);
        if (prevItem) {
                this.entry[prevItem].nextItem = entryID;
        } else if(parent) {
@@ -114,16 +114,16 @@ function JSactivate(level) {
                                }
                        }
                        if (!this.entry[entryID].target || this.entry[entryID].target=="_self") {
-                               document.location = this.entry[entryID].url;
+                               window.location.href = this.entry[entryID].url;
                        } else if (this.entry[entryID].target=="_top") {
-                               top.document.location = this.entry[entryID].url;
+                               top.location.href = this.entry[entryID].url;
                        } else {
                                var test = eval ("parent."+this.entry[entryID].target);
                                if (!test) {
                                        test = eval ("top."+this.entry[entryID].target);
                                }
                                if (test && test.document) {
-                                       test.document.location = this.entry[entryID].url;
+                                       test.location.href = this.entry[entryID].url;
                                } else {
                                        window.open(this.entry[entryID].url,this.entry[entryID].target,"status=yes,menubar=yes,resizable=yes,location=yes,directories=yes,scrollbars=yes,toolbar=yes");
                                }
index cc62458..6417557 100755 (executable)
@@ -10,7 +10,7 @@
 # Table structure for table 'be_groups'
 #
 CREATE TABLE be_groups (
-  uid int(11) unsigned DEFAULT '0' NOT NULL auto_increment,
+  uid int(11) unsigned NOT NULL auto_increment,
   pid int(11) unsigned DEFAULT '0' NOT NULL,
   tstamp int(11) unsigned DEFAULT '0' NOT NULL,
   title varchar(20) DEFAULT '' NOT NULL,
@@ -58,7 +58,7 @@ CREATE TABLE be_sessions (
 # Table structure for table 'be_users'
 #
 CREATE TABLE be_users (
-  uid int(11) unsigned DEFAULT '0' NOT NULL auto_increment,
+  uid int(11) unsigned NOT NULL auto_increment,
   pid int(11) unsigned DEFAULT '0' NOT NULL,
   tstamp int(11) unsigned DEFAULT '0' NOT NULL,
   username varchar(20) DEFAULT '' NOT NULL,
@@ -123,7 +123,7 @@ CREATE TABLE cache_imagesizes (
 # Table structure for table 'pages'
 #
 CREATE TABLE pages (
-  uid int(11) DEFAULT '0' NOT NULL auto_increment,
+  uid int(11) NOT NULL auto_increment,
   pid int(11) DEFAULT '0' NOT NULL,
   t3ver_oid int(11) DEFAULT '0' NOT NULL,
   t3ver_id int(11) DEFAULT '0' NOT NULL,
@@ -162,7 +162,7 @@ CREATE TABLE pages (
 # Table structure for table 'sys_be_shortcuts'
 #
 CREATE TABLE sys_be_shortcuts (
-  uid int(11) unsigned DEFAULT '0' NOT NULL auto_increment,
+  uid int(11) unsigned NOT NULL auto_increment,
   userid int(11) unsigned DEFAULT '0' NOT NULL,
   module_name tinytext NOT NULL,
   url text NOT NULL,
@@ -177,7 +177,7 @@ CREATE TABLE sys_be_shortcuts (
 # Table structure for table 'sys_filemounts'
 #
 CREATE TABLE sys_filemounts (
-  uid int(11) unsigned DEFAULT '0' NOT NULL auto_increment,
+  uid int(11) unsigned NOT NULL auto_increment,
   pid int(11) unsigned DEFAULT '0' NOT NULL,
   tstamp int(11) unsigned DEFAULT '0' NOT NULL,
   title varchar(30) DEFAULT '' NOT NULL,
@@ -222,7 +222,7 @@ CREATE TABLE sys_workspace (
 # Table structure for table 'sys_history'
 #
 CREATE TABLE sys_history (
-  uid int(11) unsigned DEFAULT '0' NOT NULL auto_increment,
+  uid int(11) unsigned NOT NULL auto_increment,
   sys_log_uid int(11) DEFAULT '0' NOT NULL,
   history_data mediumblob NOT NULL,
   fieldlist blob NOT NULL,
@@ -240,7 +240,7 @@ CREATE TABLE sys_history (
 # Table structure for table 'sys_lockedrecords'
 #
 CREATE TABLE sys_lockedrecords (
-  uid int(11) unsigned DEFAULT '0' NOT NULL auto_increment,
+  uid int(11) unsigned NOT NULL auto_increment,
   userid int(11) unsigned DEFAULT '0' NOT NULL,
   tstamp int(11) unsigned DEFAULT '0' NOT NULL,
   record_table varchar(40) DEFAULT '' NOT NULL,
@@ -277,7 +277,7 @@ CREATE TABLE sys_refindex (
 # Table structure for table 'sys_log'
 #
 CREATE TABLE sys_log (
-  uid int(11) unsigned DEFAULT '0' NOT NULL auto_increment,
+  uid int(11) unsigned NOT NULL auto_increment,
   userid int(11) unsigned DEFAULT '0' NOT NULL,
   action tinyint(4) unsigned DEFAULT '0' NOT NULL,
   recuid int(11) unsigned DEFAULT '0' NOT NULL,
@@ -301,7 +301,7 @@ CREATE TABLE sys_log (
 # Table structure for table 'sys_language'
 #
 CREATE TABLE sys_language (
-  uid int(11) unsigned DEFAULT '0' NOT NULL auto_increment,
+  uid int(11) unsigned NOT NULL auto_increment,
   pid int(11) unsigned DEFAULT '0' NOT NULL,
   tstamp int(11) unsigned DEFAULT '0' NOT NULL,
   hidden tinyint(4) unsigned DEFAULT '0' NOT NULL,
index 187d3c4..a470c3b 100755 (executable)
@@ -169,6 +169,7 @@ class SC_t3lib_thumbs {
                if ($this->input && @file_exists($this->input)) {
 
                                // Check file extension:
+                       $reg = array();
                        if (ereg('(.*)\.([^\.]*$)',$this->input,$reg))  {
                                $ext=strtolower($reg[2]);
                                $ext=($ext=='jpeg')?'jpg':$ext;
index 11b7d42..d9f2d90 100755 (executable)
@@ -303,6 +303,10 @@ class clickMenu {
                                $menuItems['spacer2']='spacer';
                                $menuItems['delete']=$this->DB_delete($table,$uid,$elInfo);
                        }
+
+                       if(!in_array('history',$this->disabledItems))   {
+                               $menuItems['history']=$this->DB_history($table,$uid,$elInfo);
+                       }
                }
 
                        // Adding external elements to the menuItems array
@@ -396,7 +400,7 @@ class clickMenu {
         */
        function urlRefForCM($url,$retUrl='',$hideCM=1) {
                $loc='top.content'.($this->listFrame && !$this->alwaysContentFrame ?'.list_frame':'');
-               $editOnClick='var docRef=(top.content.list_frame)?top.content.list_frame:'.$loc.'; docRef.document.location=top.TS.PATH_typo3+\''.$url.'\''.
+               $editOnClick='var docRef=(top.content.list_frame)?top.content.list_frame:'.$loc.'; docRef.location.href=top.TS.PATH_typo3+\''.$url.'\''.
                        ($retUrl?"+'&".$retUrl."='+top.rawurlencode(".$this->frameLocation('docRef.document').')':'').';'.
                        ($hideCM?'return hideCM();':'');
                return $editOnClick;
@@ -448,7 +452,7 @@ class clickMenu {
                } else {
                        $conf = $loc;
                }
-               $editOnClick = 'if('.$conf.'){'.$loc.'.document.location=top.TS.PATH_typo3+\''.$this->clipObj->pasteUrl($table,$uid,0).'&redirect=\'+top.rawurlencode('.$this->frameLocation($loc.'.document').'); hideCM();}';
+               $editOnClick = 'if('.$conf.'){'.$loc.'.location.href=top.TS.PATH_typo3+\''.$this->clipObj->pasteUrl($table,$uid,0).'&redirect=\'+top.rawurlencode('.$this->frameLocation($loc.'.document').'); hideCM();}';
 
                return $this->linkItem(
                        $this->label('paste'.$type),
@@ -654,7 +658,7 @@ class clickMenu {
                        }
                }
                if (!$editOnClick)      {
-                       $editOnClick='if('.$loc.'){'.$loc.".document.location=top.TS.PATH_typo3+'alt_doc.php?returnUrl='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'&edit[".$table."][".$uid."]=edit".$addParam."';}";
+                       $editOnClick='if('.$loc.'){'.$loc.".location.href=top.TS.PATH_typo3+'alt_doc.php?returnUrl='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'&edit[".$table."][".$uid."]=edit".$addParam."';}";
                }
 
                return $this->linkItem(
@@ -675,7 +679,7 @@ class clickMenu {
        function DB_new($table,$uid)    {
                $editOnClick='';
                $loc='top.content'.(!$this->alwaysContentFrame?'.list_frame':'');
-               $editOnClick='if('.$loc.'){'.$loc.".document.location=top.TS.PATH_typo3+'".
+               $editOnClick='if('.$loc.'){'.$loc.".location.href=top.TS.PATH_typo3+'".
                        ($this->listFrame?
                                "alt_doc.php?returnUrl='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'&edit[".$table."][-".$uid."]=new'":
                                'db_new.php?id='.intval($uid)."'").
@@ -705,7 +709,7 @@ class clickMenu {
                } else {
                        $conf = '1==1';
                }
-               $editOnClick='if('.$loc." && ".$conf." ){".$loc.".document.location=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'".
+               $editOnClick='if('.$loc." && ".$conf." ){".$loc.".location.href=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'".
                        "&cmd[".$table.']['.$uid.'][delete]=1&prErr=1&vC='.$GLOBALS['BE_USER']->veriCode()."';hideCM();}";
 
                return $this->linkItem(
@@ -742,8 +746,7 @@ class clickMenu {
                return $this->linkItem(
                        $this->label('tempMountPoint'),
                        $this->excludeIcon('<img'.t3lib_iconWorks::skinImg($this->PH_backPath,'gfx/placeasroot.gif','width="14" height="12"').' alt="" />'),
-                       '',
-                       "if (top.content.nav_frame) { top.content.nav_frame.document.location = 'alt_db_navframe.php?setTempDBmount=".intval($page_id)."'; } return hideCM();"
+                       "if (top.content.nav_frame) { top.content.nav_frame.location.href = 'alt_db_navframe.php?setTempDBmount=".intval($page_id)."'; } return hideCM();"
                );
        }
 
@@ -775,7 +778,7 @@ class clickMenu {
            $uid = $rec['_ORIG_uid'] ? $rec['_ORIG_uid'] : $rec['uid'];
            $editOnClick='';
            $loc='top.content'.($this->listFrame && !$this->alwaysContentFrame ?'.list_frame':'');
-           $editOnClick='if('.$loc.'){'.$loc.".document.location=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'".
+           $editOnClick='if('.$loc.'){'.$loc.".location.href=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'".
                "&data[".$table.']['.$uid.']['.$flagField.']='.($rec[$flagField]?0:1).'&prErr=1&vC='.$GLOBALS['BE_USER']->veriCode()."';hideCM();}";
 
            return $this->linkItem(
@@ -886,7 +889,7 @@ class clickMenu {
        function FILE_launch($path,$script,$type,$image)        {
                $loc='top.content'.(!$this->alwaysContentFrame?'.list_frame':'');
 
-               $editOnClick='if('.$loc.'){'.$loc.".document.location=top.TS.PATH_typo3+'".$script.'?target='.rawurlencode($path)."&returnUrl='+top.rawurlencode(".$this->frameLocation($loc.'.document').");}";
+               $editOnClick='if('.$loc.'){'.$loc.".location.href=top.TS.PATH_typo3+'".$script.'?target='.rawurlencode($path)."&returnUrl='+top.rawurlencode(".$this->frameLocation($loc.'.document').");}";
 
                return $this->linkItem(
                        $this->label($type),
@@ -937,7 +940,7 @@ class clickMenu {
                } else {
                        $conf = '1==1';
                }
-               $editOnClick='if('.$loc." && ".$conf." ){".$loc.".document.location=top.TS.PATH_typo3+'tce_file.php?redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'".
+               $editOnClick='if('.$loc." && ".$conf." ){".$loc.".location.href=top.TS.PATH_typo3+'tce_file.php?redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'".
                        "&file[delete][0][data]=".rawurlencode($path).'&vC='.$GLOBALS['BE_USER']->veriCode()."';hideCM();}";
 
                return $this->linkItem(
@@ -965,7 +968,7 @@ class clickMenu {
                        $conf=$loc;
                }
 
-               $editOnClick='if('.$conf.'){'.$loc.".document.location=top.TS.PATH_typo3+'".$this->clipObj->pasteUrl('_FILE',$path,0).
+               $editOnClick='if('.$conf.'){'.$loc.".location.href=top.TS.PATH_typo3+'".$this->clipObj->pasteUrl('_FILE',$path,0).
                        "&redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').'); hideCM();}';
 
                return $this->linkItem(
@@ -1513,7 +1516,7 @@ class SC_alt_clickmenu {
                }
        }
        function hideCM()       {       //
-               document.location="alt_topmenu_dummy.php";
+               window.location.href="alt_topmenu_dummy.php";
                return false;
        }
 
@@ -1522,7 +1525,7 @@ class SC_alt_clickmenu {
 
        '.($this->reloadListFrame ? '
                // Reload list frame:
-       if('.$listFrameDoc.'){'.$listFrameDoc.'.document.location='.$listFrameDoc.'.document.location;}' :
+       if('.$listFrameDoc.'){'.$listFrameDoc.'.location.href='.$listFrameDoc.'.location.href;}' :
        '').'
                ');
        }
index c09ea32..1a81853 100755 (executable)
@@ -241,9 +241,9 @@ class SC_alt_db_navframe {
                top.fsMod.currentBank = bank;
 
                if (top.condensedMode)  {
-                       top.content.document.location=theUrl;
+                       top.content.location.href=theUrl;
                } else {
-                       parent.list_frame.document.location=theUrl;
+                       parent.list_frame.location.href=theUrl;
                }
 
                '.($this->doHighlight?'hilight_row("web",highLightID+"_"+bank);':'').'
@@ -258,7 +258,7 @@ class SC_alt_db_navframe {
                window.setTimeout("_refresh_nav();",0);
        }
        function _refresh_nav() {       //
-               document.location="'.$this->pagetree->thisScript.'?unique='.time().'";
+               window.location.href="'.$this->pagetree->thisScript.'?unique='.time().'";
        }
 
                // Highlighting rows in the page tree:
index bffb5d6..08dce6a 100755 (executable)
@@ -411,7 +411,7 @@ class SC_alt_doc {
                $this->doc->JScode = $this->doc->wrapScriptTags('
                        function jumpToUrl(URL,formEl)  {       //
                                if (!TBE_EDITOR_isFormChanged())        {
-                                       document.location = URL;
+                                       window.location.href = URL;
                                } else if (formEl && formEl.type=="checkbox") {
                                        formEl.checked = formEl.checked ? 0 : 1;
                                }
@@ -436,7 +436,7 @@ class SC_alt_doc {
                                if (
                                        '.($GLOBALS['BE_USER']->jsConfirmation(4)?'confirm('.$LANG->JScharCode($LANG->getLL('deleteWarning')).')':'1==1').'
                                )       {
-                                       document.location = "tce_db.php?cmd["+table+"]["+id+"][delete]=1&redirect="+escape(url)+"&vC='.$BE_USER->veriCode().'&prErr=1&uPT=1";
+                                       window.location.href = "tce_db.php?cmd["+table+"]["+id+"][delete]=1&redirect="+escape(url)+"&vC='.$BE_USER->veriCode().'&prErr=1&uPT=1";
                                }
                                return false;
                        }
@@ -798,13 +798,13 @@ class SC_alt_doc {
                                        $undoButton = 1;
                                }
                                if ($undoButton) {
-                                       $aOnClick = 'document.location=\'show_rechis.php?element='.rawurlencode($this->firstEl['table'].':'.$this->firstEl['uid']).'&revert=ALL_FIELDS&sumUp=-1&returnUrl='.rawurlencode($this->R_URI).'\'; return false;';
+                                       $aOnClick = 'window.location.href=\'show_rechis.php?element='.rawurlencode($this->firstEl['table'].':'.$this->firstEl['uid']).'&revert=ALL_FIELDS&sumUp=-1&returnUrl='.rawurlencode($this->R_URI).'\'; return false;';
                                        $panel.= '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.
                                                        '<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/undo.gif','width="21" height="16"').' class="c-inputButton" title="'.htmlspecialchars(sprintf($LANG->getLL('undoLastChange'),t3lib_BEfunc::calcAge(time()-$undoButtonR['tstamp'],$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')))).'" alt="" />'.
                                                        '</a>';
                                }
                                if ($this->getNewIconMode($this->firstEl['table'],'showHistory'))       {
-                                       $aOnClick = 'document.location=\'show_rechis.php?element='.rawurlencode($this->firstEl['table'].':'.$this->firstEl['uid']).'&returnUrl='.rawurlencode($this->R_URI).'\'; return false;';
+                                       $aOnClick = 'window.location.href=\'show_rechis.php?element='.rawurlencode($this->firstEl['table'].':'.$this->firstEl['uid']).'&returnUrl='.rawurlencode($this->R_URI).'\'; return false;';
                                        $panel.= '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.
                                                        '<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/history2.gif','width="13" height="12"').' class="c-inputButton" alt="" />'.
                                                        '</a>';
@@ -852,7 +852,7 @@ class SC_alt_doc {
                                }
 
                                        // Compile the selector box finally:
-                               $onChange = 'if(this.options[this.selectedIndex].value && !TBE_EDITOR_isFormChanged()){document.location=(this.options[this.selectedIndex].value);}';
+                               $onChange = 'if(this.options[this.selectedIndex].value && !TBE_EDITOR_isFormChanged()){window.location.href=(this.options[this.selectedIndex].value);}';
                                $docSel='<select name="_docSelector" onchange="'.htmlspecialchars($onChange).'">'.implode('',$opt).'</select>';
 
                                        // Add CSH:
index 17ad86b..619f938 100755 (executable)
@@ -114,9 +114,9 @@ class SC_alt_file_navframe {
                top.fsMod.currentBank = bank;
 
                if (top.condensedMode)  {
-                       top.content.document.location=theUrl;
+                       top.content.location.href=theUrl;
                } else {
-                       parent.list_frame.document.location=theUrl;
+                       parent.list_frame.location.href=theUrl;
                }
 
         '.($this->doHighlight?'hilight_row("file",highLightID+"_"+bank);':'').'
@@ -131,7 +131,7 @@ class SC_alt_file_navframe {
                window.setTimeout("_refresh_nav();",0);
        }
        function _refresh_nav() {       //
-               document.location="'.$this->pagetree->thisScript.'?unique='.time().'";
+               window.location.href="'.$this->pagetree->thisScript.'?unique='.time().'";
        }
 
                // Highlighting rows in the folder tree:
index 8161679..006e0e8 100755 (executable)
@@ -286,7 +286,7 @@ class SC_alt_palette {
                                } else closePal();
                        }
                        function closePal()     {       //
-                               '.($this->GPbackref?'document.location="alt_topmenu_dummy.php";':'close();').'
+                               '.($this->GPbackref?'window.location.href="alt_topmenu_dummy.php";':'close();').'
                        }
                        timeout_func();
                        onBlur="alert();";
index 47d5565..011d3e9 100755 (executable)
@@ -247,16 +247,16 @@ class SC_alt_shortcut {
                                top.goToModule(modName);
                        }
                        function editSh(uid)    {       //
-                               document.location="alt_shortcut.php?editShortcut="+uid;
+                               window.location.href="alt_shortcut.php?editShortcut="+uid;
                        }
                        function submitEditPage(id)     {       //
-                               document.location="alt_shortcut.php?editPage="+top.rawurlencode(id);
+                               window.location.href="alt_shortcut.php?editPage="+top.rawurlencode(id);
                        }
                        function changeWorkspace(workspaceId)   {       //
-                               document.location="alt_shortcut.php?changeWorkspace="+top.rawurlencode(workspaceId);
+                               window.location.href="alt_shortcut.php?changeWorkspace="+top.rawurlencode(workspaceId);
                        }
                        function changeWorkspacePreview(newstate)       {       //
-                               document.location="alt_shortcut.php?changeWorkspacePreview="+newstate;
+                               window.location.href="alt_shortcut.php?changeWorkspacePreview="+newstate;
                        }
 
                        ');
@@ -348,7 +348,7 @@ class SC_alt_shortcut {
                                        }
 
                                        if ($sc_group>=0)       {
-                                               $onC = 'if (confirm('.$GLOBALS['LANG']->JScharCode($LANG->getLL('shortcut_delAllInCat')).')){document.location=\'alt_shortcut.php?deleteCategory='.$sc_group.'\';}return false;';
+                                               $onC = 'if (confirm('.$GLOBALS['LANG']->JScharCode($LANG->getLL('shortcut_delAllInCat')).')){window.location.href=\'alt_shortcut.php?deleteCategory='.$sc_group.'\';}return false;';
                                                $this->linesPre[]='<td>&nbsp;</td><td class="bgColor5"><a href="#" onclick="'.htmlspecialchars($onC).'" title="'.$LANG->getLL('shortcut_delAllInCat',1).'">'.$label.'</a></td>';
                                        } else {
                                                $label = $LANG->getLL('shortcut_global',1).': '.($label ? $label : abs($sc_group));     // Fallback label
@@ -609,7 +609,7 @@ class SC_alt_shortcut {
                        // Changing workspace and if so, reloading entire backend:
                if (strlen($this->changeWorkspace))     {
                        $BE_USER->setWorkspace($this->changeWorkspace);
-                       return $this->doc->wrapScriptTags('top.document.location="alt_main.php";');
+                       return $this->doc->wrapScriptTags('top.location.href="alt_main.php";');
                }
                        // Changing workspace and if so, reloading entire backend:
                if (strlen($this->changeWorkspacePreview))      {
@@ -627,9 +627,11 @@ class SC_alt_shortcut {
 
                        // Add custom workspaces (selecting all, filtering by BE_USER check):
                $workspaces = $TYPO3_DB->exec_SELECTgetRows('uid,title,adminusers,members,reviewers','sys_workspace','pid=0'.t3lib_BEfunc::deleteClause('sys_workspace'),'','title');
-               foreach($workspaces as $rec)    {
-                       if ($BE_USER->checkWorkspace($rec))     {
-                               $options[$rec['uid']] = $rec['uid'].': '.$rec['title'];
+               if (count($workspaces)) {
+                       foreach ($workspaces as $rec)   {
+                               if ($BE_USER->checkWorkspace($rec))     {
+                                       $options[$rec['uid']] = $rec['uid'].': '.$rec['title'];
+                               }
                        }
                }
 
index 6501fb6..57a43f8 100755 (executable)
@@ -214,8 +214,8 @@ class TBE_browser_recordList extends localRecordList {
                $title = $row[$titleCol];
 
                $ficon = t3lib_iconWorks::getIcon($table,$row);
-               $aOnClick = "return insertElement('".$table."', '".$row['uid']."', 'db', unescape('".rawurlencode($title)."'), '', '', '".$ficon."');";
-               $ATag = '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">';
+               $aOnClick = "return insertElement('".$table."', '".$row['uid']."', 'db', ".t3lib_div::quoteJSvalue($title).", '', '', '".$ficon."');";
+               $ATag = '<a href="#" onclick="'.$aOnClick.'">';
                $ATag_alt = substr($ATag,0,-4).',\'\',1);">';
                $ATag_e = '</a>';
 
@@ -428,11 +428,11 @@ class TBE_PageTree extends localPageTree {
        function wrapTitle($title,$v,$ext_pArrPages)    {
                if ($ext_pArrPages)     {
                        $ficon=t3lib_iconWorks::getIcon('pages',$v);
-                       $onClick = "return insertElement('pages', '".$v['uid']."', 'db', unescape('".rawurlencode($v['title'])."'), '', '', '".$ficon."','',1);";
+                       $onClick = "return insertElement('pages', '".$v['uid']."', 'db', ".t3lib_div::quoteJSvalue($v['title']).", '', '', '".$ficon."','',1);";
                } else {
                        $onClick = 'return jumpToUrl(\'browse_links.php?act='.$GLOBALS['SOBE']->act.'&mode='.$GLOBALS['SOBE']->mode.'&expandPage='.$v['uid'].'\');';
                }
-               return '<a href="#" onclick="'.htmlspecialchars($onClick).'">'.$title.'</a>';
+               return '<a href="#" onclick="'.$onClick.'">'.$title.'</a>';
        }
 }
 
@@ -904,7 +904,7 @@ class SC_browse_links {
                                var add_act = URL.indexOf("act=")==-1 ? "&act='.$this->act.'" : "";
                                var add_mode = URL.indexOf("mode=")==-1 ? "&mode='.$this->mode.'" : "";
                                var theLocation = URL+add_act+add_mode+add_href+add_target+add_title+add_params'.($addPassOnParams?'+"'.$addPassOnParams.'"':'').'+(anchor?anchor:"");
-                               document.location = theLocation;
+                               window.location.href = theLocation;
                                return false;
                        }
                ';
@@ -1622,8 +1622,8 @@ class SC_browse_links {
                        $ATag2='';
                        if (in_array('pages',$tablesArr))       {
                                $ficon=t3lib_iconWorks::getIcon('pages',$mainPageRec);
-                               $ATag="<a href=\"#\" onclick=\"return insertElement('pages', '".$mainPageRec['uid']."', 'db', unescape('".rawurlencode($mainPageRec['title'])."'), '', '', '".$ficon."','',1);\">";
-                               $ATag2="<a href=\"#\" onclick=\"return insertElement('pages', '".$mainPageRec['uid']."', 'db', unescape('".rawurlencode($mainPageRec['title'])."'), '', '', '".$ficon."','',0);\">";
+                               $ATag="<a href=\"#\" onclick=\"return insertElement('pages', '".$mainPageRec['uid']."', 'db', ".t3lib_div::quoteJSvalue($mainPageRec['title']).", '', '', '".$ficon."','',1);\">";
+                               $ATag2="<a href=\"#\" onclick=\"return insertElement('pages', '".$mainPageRec['uid']."', 'db', ".t3lib_div::quoteJSvalue($mainPageRec['title']).", '', '', '".$ficon."','',0);\">";
                                $ATag_alt=substr($ATag,0,-4).",'',1);\">";
                                $ATag_e='</a>';
                        }
index 42a8e4c..0291a20 100644 (file)
@@ -88,7 +88,7 @@ class SC_browser {
                                        close();
                                }
                                function setParams(mode,params) {       //
-                                       parent.content.document.location = "browse_links.php?mode="+mode+"&bparams="+params;
+                                       parent.content.location.href = "browse_links.php?mode="+mode+"&bparams="+params;
                                }
                                if (!window.opener)     {
                                        alert("ERROR: Sorry, no link to main window... Closing");
index 5b96d68..6179b90 100755 (executable)
@@ -198,7 +198,7 @@ class alt_menu_functions {
                                $mIcons[] = '<a href="#" onclick="top.goToModule(\''.$moduleName.'\');'.$onBlur.'return false;" class="c-mainitem" id="'.$moduleCSSId.'">'.$descr3_imageCode.'</a>';
 
                                $JScmd = '
-                                               top.content.location=top.getModuleUrl(top.TS.PATH_typo3+\''.$this->wrapLinkWithAB($link).'\'+additionalGetVariables);
+                                               top.content.location=top.getModuleUrl(top.TS.PATH_typo3+"'.$this->wrapLinkWithAB($link).'"+additionalGetVariables);
                                                top.highlightModuleMenuItem("'.$moduleCSSId.'",1);';
                                $mJScmds[] = "case '".$moduleName."': \n ".$JScmd." \n break;";
                        }
@@ -285,11 +285,16 @@ class alt_menu_functions {
                                                if ($addJS && $BE_USER->uc['condensedMode'])    {$addJS.=  "+(cMR?'&cMR=1':'')";}
 
                                                        // Command for the selector box:
-                                               $JScmd = "
-                                                               top.content.location=top.getModuleUrl(top.TS.PATH_typo3+'".$this->wrapLinkWithAB($link)."'".$addJS.'+additionalGetVariables);
+                                               $JScmd = '
+                                                               top.content.location=top.getModuleUrl(top.TS.PATH_typo3+"'.$this->wrapLinkWithAB($link).'"'.$addJS.'+additionalGetVariables);
                                                                top.fsMod.currentMainLoaded="'.$moduleName.'";
                                                                ';
 
+                                               if ($subInfo['navFrameScript']) {
+                                                       $JScmd.='
+                                                               top.currentSubScript="'.$origLink.'";';
+                                               }
+
                                                        // If there is a frameset script in place:
                                                if (!$BE_USER->uc['condensedMode'] && $moduleInfo['navFrameScript'])    {
 
@@ -430,7 +435,7 @@ class alt_menu_functions {
                                if (count($functionArray))      {
                                        $selectItems[] = '<option value=""></option>';
                                        foreach($functionArray as $fAoptions)   {
-                                               $selectItems[] = '<option value="'.htmlspecialchars("document.location='".$fAoptions['href']."';").'">[ '.htmlspecialchars($fAoptions['title']).' ]</option>';
+                                               $selectItems[] = '<option value="'.htmlspecialchars("window.location.href='".$fAoptions['href']."';").'">[ '.htmlspecialchars($fAoptions['title']).' ]</option>';
                                        }
                                }
                        }
@@ -469,9 +474,10 @@ class alt_menu_functions {
                global $BE_USER;
 
                $prefix = '';
-               $navFrameScriptParam = $subModuleInfo['navFrameScriptParam'] ? $subModuleInfo['navFrameScriptParam'] : $moduleInfo['navFrameScriptParam'];
-               if ($moduleInfo['navFrameScript'])      {
-                       $navFrameScript = t3lib_div::resolveBackPath($moduleInfo['navFrameScript']);
+               $navFrameScript = $subModuleInfo['navFrameScript'] ? $subModuleInfo['navFrameScript'] : $moduleInfo['navFrameScript'];
+               $navFrameScriptParam = isset($subModuleInfo['navFrameScriptParam']) ? $subModuleInfo['navFrameScriptParam'] : $moduleInfo['navFrameScriptParam'];
+               if ($navFrameScript)    {
+                       $navFrameScript = t3lib_div::resolveBackPath($navFrameScript);
                        $navFrameScript = $this->wrapLinkWithAB($navFrameScript);
 
                        if ($BE_USER->uc['condensedMode'])      {
index 2f41e7e..bc52a19 100755 (executable)
@@ -3,6 +3,7 @@
 *  Copyright notice
 *
 *  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 2006 Sebastian Kurfuerst (sebastian@garbage-group.de)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
  * Class for the record history display script (show_rechis.php)
  *
  * $Id$
- * Revised for TYPO3 3.6 November/2003 by Kasper Skaarhoj
  * XHTML Compliant
  *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
+ * @author     Sebastian Kurfuerst <sebastian@garbage-group.de>
  */
-/**
- * [CLASS/FUNCTION INDEX of SCRIPT]
- *
- *
- *
- *   83: class recordHistory
- *  106:     function recordHistory()
- *  124:     function main()
- *  155:     function displaySysHistoryEntry($sh_uid)
- *  219:     function revertToPreviousValues($element,$field)
- *  285:     function saveState($element,$sumUp)
- *  339:     function displayHistory($element)
- *
- *              SECTION: Various helper functions
- *  540:     function nextHisUid($element,$hisUid)
- *  586:     function compareChangesWithCurrent($element,$changeRec)
- *  631:     function readFieldTypes($table,$id)
- *  662:     function cmp($changeStatus,$oldRecord)
- *  685:     function removeFilefields($table,$dataArray)
- *  708:     function renderEntry($entry,$table)
- *  769:     function listHeader()
- *  813:     function linkPage($str,$inparams=array(),$anchor='')
- *  841:     function getChangesSinceRecord($element,$hisUid=0,$hisUid_Stop=0)
- *
- * TOTAL FUNCTIONS: 15
- * (This index is automatically created/updated by the extension "extdeveval")
- *
- */
-
-
-
-
-
-
-
-
-
-
 
 
 /**
  * Class for the record history display script (show_rechis.php)
  *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
+ * @author     Sebastian Kurfuerst <sebastian@garbage-group.de>
  * @package TYPO3
  * @subpackage core
  */
-class recordHistory {
 
+class recordHistory {
                // External, static:
        var $maxSteps=20;               // Maximum number of sys_history steps to show.
+       var $showDiff=1;                // display diff or not (0-no diff, 1-inline)
+       var $showSubElements=1;         // on a pages table - show sub elements as well.
+       var $showInsertDelete=1;                // show inserts and deletes as well
 
-               // Internal, dynamic:
-       var $listType = 0;              // This value determines the kind of list build. The variable is used as a parameter from some functions.
-
-               // Internal, static. GPvars:
-       var $sh_uid;                    // sh_uid is the id-number of the sys_history log item to SHOW
+               // Internal, GPvars
        var $element;                   // Element reference, syntax [tablename]:[uid]
-       var $saveState;                 // Saving states: Points to a sys_history UID which should be saved.
-       var $returnUrl;                 // Return URL - kept in links, used to link back to calling module.
-       var $revert;                    // String identifying mode of reverting: Either all fields or only a single field to revert. See function revertToPreviousValues()
-       var $sumUp;                     // Generally used as a pointer to a sys_history uid as a state.
-       var $doReturn;                  // If set, function revertToPreviousValues() will perform a redirect to returnUrl
-
+       var $lastSyslogId;              // syslog ID which is not shown anymore
+       var $returnUrl;
 
+               // Internal
+       var $changeLog;
+       var $showMarked=FALSE;
        /**
         * Constructor for the class
         *
         * @return      void
         */
        function recordHistory()        {
-
                        // GPvars:
-               $this->sh_uid = t3lib_div::_GP('sh_uid');
                $this->element = t3lib_div::_GP('element');
-               $this->saveState = t3lib_div::_GP('saveState');
                $this->returnUrl = t3lib_div::_GP('returnUrl');
-               $this->revert = t3lib_div::_GP('revert');
-               $this->sumUp = t3lib_div::_GP('sumUp');
-               $this->doReturn = t3lib_div::_GP('doReturn');
+               $this->lastSyslogId = t3lib_div::_GP('diff');
+               $this->rollbackFields = t3lib_div::_GP('rollbackFields');
+                       // resolve sh_uid if set
+               $this->resolveShUid();
        }
 
        /**
         * Main function for the listing of history.
         * It detects incoming variables like element reference, history element uid etc. and renders the correct screen.
         *
-        * @return      void
+        * @return      HTML content for the module
         */
        function main() {
+               $content = '';
 
-               $content='';
-
-                       // If link from sys log:
-                       // sh_uid is the id-number of the sys_history log item
-               if ($this->sh_uid)      {
-                       $content.=$this->displaySysHistoryEntry($this->sh_uid);
+                       // save snapshot
+               if (t3lib_div::_GP('highlight') && !t3lib_div::_GP('settings')) {
+                       $this->toggleHighlight(t3lib_div::_GP('highlight'));
                }
 
-                       // If link to element:
-               if ($this->element)     {
-                       $this->resolveElement();
-                       if ($this->revert && $this->sumUp)      {
-                               $content.=$this->revertToPreviousValues($this->element,$this->revert);
+               $content .= $this->displaySettings();
+               if ($this->createChangeLog())   {
+                       if ($this->rollbackFields)      {
+                               $completeDiff = $this->createMultipleDiff();
+                               $content .= $this->performRollback($completeDiff);
+
+                       }
+                       if ($this->lastSyslogId)        {
+                               $completeDiff = $this->createMultipleDiff();
+                               $content .= $this->displayMultipleDiff($completeDiff);
                        }
-                       if ($this->saveState)   {
-                               $content.=$this->saveState($this->element,$this->saveState);
+                       if ($this->element)     {
+                               $content .= $this->displayHistory();
                        }
-                       $content.=$this->displayHistory($this->element);
                }
-
-                       // Return content variable:
                return $content;
        }
 
+       /*******************************
+        *
+        * database actions
+        *
+        *******************************/
+
        /**
-        * Displays a specific entry from the sys_history table
+        * toggles highlight state of record
         *
-        * @param       integer         UID of sys_history table entry
-        * @return      string          HTML content
+        * @param       integer         uid of sys_history entry
         */
-       function displaySysHistoryEntry($sh_uid)        {
-               global $SOBE, $LANG, $TCA;
-
-                       // Select the entry from the table:
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_history', 'uid='.intval($sh_uid));
-               $newRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
-
-                       // If an entry was found:
-               if (is_array($newRow))  {
-
-                               // Init:
-                       $this->listType=0;
-                       $lines=array();
-
-                               // Create header:
-                       $recIdentString = $LANG->sL($TCA[$newRow['tablename']]['ctrl']['title']).'/'.$newRow['recuid'];
-                       $recIdentString = $this->linkPage(htmlspecialchars($recIdentString),array('sh_uid'=>'','element'=>$newRow['tablename'].':'.$newRow['recuid']),'uid_'.$sh_uid);
-                       $theTime = t3lib_BEfunc::datetime($newRow['tstamp']).', '.t3lib_BEfunc::calcAge(time()-$newRow['tstamp'],$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears'));
-                       $lines[]='
-                               <tr class="bgColor5">
-                                       <td colspan="4">
-                                               <strong>'.$LANG->getLL('tableUid',1).':</strong> '.$recIdentString.'<br />
-                                               <strong>'.$LANG->getLL('time',1).':</strong> '.htmlspecialchars($theTime).'<br />
-                                       </td>
-                               </tr>';
-
-                               // Add header to accumulation:
-                       $lines[]=$this->listHeader();
-
-                               // Get the entry data and add it:
-                       $historyData = unserialize($newRow['history_data']);
-                       $lines = array_merge($lines,$this->renderEntry($historyData,$newRow['tablename']));
-
-                               // Combine all content into a table for layout:
-                       $theCode='
-
-                               <!--
-                                       History for item:
-                               -->
-                               <table border="0" cellpadding="2" cellspacing="2" id="typo3-history-item">
-                                       '.implode('',$lines).'
-                               </table>';
-
-                       $theCode.='
-                               <br /><img'.t3lib_iconWorks::skinImg('','gfx/icon_note.gif','width="18" height="16"').' align="top" alt="" />'.$LANG->getLL('differenceMsg').'<br /><br />';
-
-                               // Add CSH:
-                       $theCode.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'history_entry', $GLOBALS['BACK_PATH'],'');
-
-                               // Create the module section:
-                       $content.=$SOBE->doc->section($LANG->getLL('changes'),$theCode,0,1);
+       function toggleHighlight($uid)  {
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('snapshot','sys_history','uid='.intval($uid));
+               $tmp = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
+               if ($tmp['snapshot'])   {
+                       $tmp = 0;
+               } else {
+                       $tmp = 1;
                }
-
-                       // Return content:
-               return $content;
+               $updateFields = array('snapshot' => $tmp);
+               $GLOBALS['TYPO3_DB']->exec_UPDATEquery('sys_history','uid='.intval($uid),$updateFields);
        }
 
        /**
-        * Return to previous values for element
+        * perform rollback
         *
-        * @param       string          Element reference, syntax "[table]:[uid]"
-        * @param       string          Tells which field to restore. A single field (eg named "myField") is defined as "field:myField" while ALL fields is indicated by the string "ALL_FIELDS"
-        * @return      void            The function writes through tceMain and ends with a header-location, if instructed to.
+        * @param       array           diff array to rollback
+        * @return      void
+        * @access      private
         */
-       function revertToPreviousValues($element,$field)        {
-               $sumUp = $this->sumUp;  // sys_history uid from which to get previous values
+       function performRollback($diff) {
+               if (!$this->rollbackFields)     {
+                       return 0;
+               }
 
-               $elParts = explode(':',$element);
-               $redirect = intval($this->doReturn);
-               if ($sumUp==-1) {       // Undo/Redo
-                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                                               'uid',
-                                               'sys_history',
-                                               'sys_history.tablename='.$GLOBALS['TYPO3_DB']->fullQuoteStr($elParts[0], 'sys_history').'
-                                                       AND sys_history.recuid='.intval($elParts[1]),
-                                               '',
-                                               'uid DESC',
-                                               '1'
-                                       );
-                       if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                               $sumUp=$row['uid'];
+               $reloadPageFrame=0;
+
+                       // PROCESS INSERTS AND DELETES
+                       // rewrite inserts and deletes
+               $cmdmapArray = array();
+               if ($diff['insertsDeletes'])    {
+                       foreach ($diff['insertsDeletes'] as $key => $action)    {
+                               $elParts = explode(':',$key);
+                               if ($action == 1)       {       // inserted records should be deleted
+                                       $cmdmapArray[$elParts[0]][$elParts[1]]['delete'] = 1;
+                                               // when the record is deleted, the contents of the record do not need to be updated
+                                       unset($diff['oldData'][$key]);
+                                       unset($diff['newData'][$key]);
+                               } else {        // deleted records should be inserted again
+                                       $cmdmapArray[$elParts[0]][$elParts[1]]['undelete'] = 1;
+                               }
+                       }
+               }
+                       // Writes the data:
+               if ($cmdmapArray)       {
+                       $tce = t3lib_div::makeInstance('t3lib_TCEmain');
+                       $tce->stripslashes_values=0;
+                       $tce->debug=0;
+                       $tce->dontProcessTransformations=1;
+                       $tce->start(array(),$cmdmapArray);
+                       $tce->process_cmdmap();
+                       unset($tce);
+                       if (isset($cmdmapArray['pages']))       {
+                               $reloadPageFrame=1;
                        }
-                       $redirect = 1;
                }
-               if ($sumUp!=-1) {
-                       $changeRec=$this->compareChangesWithCurrent($element,$this->getChangesSinceRecord($element,$sumUp));
 
-                       $data =array();
-                       if (t3lib_BEfunc::getRecord($elParts[0],$elParts[1]))   {
+                       // PROCESS CHANGES
+                       // create an array for process_datamap
+               $diff_modified = array();
+               foreach ($diff['oldData'] as $key => $value)    {
+                       $splitKey = explode(':',$key);
+                       $diff_modified[$splitKey[0]][$splitKey[1]] = $value;
+               }
 
-                                       // Fields field(s) to restore:
-                               if ($field=='ALL_FIELDS')       {
-                                       $data=$changeRec['oldRecord'];
-                               } elseif(substr($field,0,6)=='field:') {
-                                       $data[substr($field,6)]=$changeRec['oldRecord'][substr($field,6)];
-                               }
-                                       // Removing fields:
-                               $data = $this->removeFilefields($elParts[0],$data);
-
-                                       // If there are fields to write:
-                               if (count($data))       {
-
-                                               // Setting data right:
-                                       $inData=array();
-                                       $inData[$elParts[0]][$elParts[1]]=$data;
-
-                                               // Writes the data:
-                                       $tce = t3lib_div::makeInstance('t3lib_TCEmain');
-                                       $tce->stripslashes_values=0;
-                                       $tce->debug=0;
-                                       $tce->dontProcessTransformations=1;
-                                       $tce->start($inData,array());
-                                       $tce->process_datamap();
-                               }
-                       }
+               $rollbackData = explode(':',$this->rollbackFields);
+
+               switch (count($rollbackData))   {
+                       case 1: // all tables
+                               $data = $diff_modified;
+                               break;
+                       case 2: // one record
+                               $data[$rollbackData[0]][$rollbackData[1]] = $diff_modified[$rollbackData[0]][$rollbackData[1]];
+                               break;
+                       case 3: // one field in one record
+                               $data[$rollbackData[0]][$rollbackData[1]][$rollbackData[2]] = $diff_modified[$rollbackData[0]][$rollbackData[1]][$rollbackData[2]];
+                               break;
+               }
+                       // Removing fields:
+               $data = $this->removeFilefields($rollbackData[0],$data);
+
+                       // Writes the data:
+               $tce = t3lib_div::makeInstance('t3lib_TCEmain');
+               $tce->stripslashes_values=0;
+               $tce->debug=0;
+               $tce->dontProcessTransformations=1;
+               $tce->start($data,array());
+               $tce->process_datamap();
+               unset($tce);
+               if (isset($data['pages']))      {
+                       $reloadPageFrame=1;
                }
 
-               if ($redirect)  {
-                       Header ('Location: '.t3lib_div::locationHeaderUrl($this->returnUrl));
-                       exit;
+                       // return to normal operation
+               $this->lastSyslogId = FALSE;
+               $this->rollbackFields = FALSE;
+               $this->createChangeLog();
+
+                       // reload page frame if necessary
+               if ($reloadPageFrame)   {
+                       return '<script type="text/javascript">
+                       /*<![CDATA[*/
+                       if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav)  {
+                               top.content.nav_frame.refresh_nav();
+                       }
+                       /*]]>*/
+                       </script>';
                }
        }
 
+       /*******************************
+        *
+        * Display functions
+        *
+        *******************************/
+
        /**
-        * Will save state uid $sumUp of element
+        * Displays settings
         *
-        * @param       string          Element reference, syntax "[table]:[uid]"
-        * @param       integer         sys_history uid from which to get previous values
-        * @return      void
+        * @return      string          HTML code to modify settings
         */
-       function saveState($element,$sumUp)     {
-               $elParts = explode(':',$element);
-
-                       // Find the changes since $sumUp sys_history uid
-               $changeRec = $this->getChangesSinceRecord($element,$sumUp);
-
-                       // Select most recent sys_history record for the element:
-               $lastestData = array();
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                                       'history_data',
-                                       'sys_history',
-                                       'sys_history.tablename='.$GLOBALS['TYPO3_DB']->fullQuoteStr($elParts[0], 'sys_history').'
-                                               AND sys_history.recuid='.intval($elParts[1]),
-                                       '',
-                                       'uid DESC',
-                                       '1'
-                               );
-               if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                       $lastestData = unserialize($row['history_data']);
+       function displaySettings()      {
+               global $BE_USER, $LANG, $SOBE;
+                       // get current selection from UC, merge data, write it back to UC
+               $currentSelection = is_array($BE_USER->uc['moduleData']['history']) ? $BE_USER->uc['moduleData']['history'] : array('maxSteps' => '', 'showDiff' => 1, 'showSubElements' => 1, 'showInsertDelete' => 1);
+
+               $currentSelectionOverride = t3lib_div::_GP('settings');
+               if ($currentSelectionOverride)  {
+                       $currentSelection = array_merge($currentSelection,$currentSelectionOverride);
+                       $BE_USER->uc['moduleData']['history'] = $currentSelection;
+                       $BE_USER->writeUC($BE_USER->uc);
                }
 
-                       // Create forged history data from the most recent state and the previous state to save:
-               $historyRecords=array();
-               $historyRecords['oldRecord'] = $changeRec['changes'];
-               $historyRecords['newRecord'] = array();
-
-               reset($historyRecords['oldRecord']);
-               while(list($kk)=each($historyRecords['oldRecord']))     {
-                       $historyRecords['newRecord'][$kk]=$lastestData['newRecord'][$kk];
+                       // display selector for number of history entries
+               $selector['maxSteps'] = array(
+                       10 => 10,
+                       20 => 20,
+                       50 => 50,
+                       100 => 100,
+                       '' => 'maxSteps_all',
+                       'marked' => 'maxSteps_marked'
+               );
+               $selector['showDiff'] = array(
+                       0 => 'showDiff_no',
+                       1 => 'showDiff_inline'
+               );
+               $selector['showSubElements'] = array(
+                       0 => 'no',
+                       1 => 'yes',
+               );
+               $selector['showInsertDelete'] = array(
+                       0 => 'no',
+                       1 => 'yes',
+               );
+                       // render selectors
+               $displayCode = '';
+               foreach ($selector as $key => $values)  {
+                       $displayCode .= '<tr><td>'.$LANG->getLL($key,1).'</td><td><select name="settings['.$key.']" onChange="document.settings.submit()" style="width:100px">';
+                       foreach ($values as $singleKey => $singleVal) {
+                               $caption = $LANG->getLL($singleVal,1)?$LANG->getLL($singleVal,1):$singleVal;
+                               $displayCode .= '<option value="'.$singleKey.'" '.(($singleKey ==  $currentSelection[$key])?'selected':'').'> '.$caption.'</option>';
+                       }
+                       $displayCode .= '</select></td></tr>';
                }
+                       // set values correctly
+               if ($currentSelection['maxSteps'] != 'marked')  {
+                       $this->maxSteps = $currentSelection['maxSteps']?intval($currentSelection['maxSteps']):'';
+               } else {
+                       $this->showMarked = TRUE;
+                       $this->maxSteps = FALSE;
+               }
+               $this->showDiff = intval($currentSelection['showDiff']);
+               $this->showSubElements = intval($currentSelection['showSubElements']);
+               $this->showInsertDelete = intval($currentSelection['showInsertDelete']);
+
+               $content = '';
+                       // get link to page history if the element history is shown
+               $elParts = explode(':',$this->element);
+               if ($elParts[0] != 'pages')     {
+                       $content .= '<b>'.$LANG->getLL('elementHistory',1).'</b><br />';
+                       $pid = t3lib_BEfunc::getRecordRaw($elParts[0],'uid='.intval($elParts[1]));
+                       $content .= $this->linkPage($LANG->getLL('elementHistory_link',1),array('element' => 'pages:'.$pid['pid']));
+               }
+               $content .= '<form name="settings" action="'.t3lib_div::getIndpEnv('TYPO3_REQUEST_URL').'" method="post"><table>'.$displayCode.'</table></form>';
+               return $SOBE->doc->section($LANG->getLL('settings',1),$content,0,1,0,0);
 
-                       // Update log:
-               $updateID = $GLOBALS['BE_USER']->writelog(3,0,0,0,'Saved state in sys_history','');
-
-                       // Create query for inserting into sys_history table:
-               $fields_values = array(
-                       'history_data' => serialize($historyRecords),
-                       'fieldlist' => implode(',',array_keys($historyRecords['oldRecord'])),
-                       'tstamp' => time(),
-                       'tablename' => $elParts[0],
-                       'recuid' => $elParts[1],
-                       'sys_log_uid' => $updateID,
-                       'snapshot' => 1
-               );
-                       // Save state by executing this query:
-               $GLOBALS['TYPO3_DB']->exec_INSERTquery('sys_history', $fields_values);
        }
 
        /**
-        * Displays the history states of an element
+        * Shows the full change log
         *
-        * @param       string          Element reference, syntax "[table]:[uid]"
         * @return      string          HTML for list, wrapped in a table.
         */
-       function displayHistory($element)       {
-               global $SOBE, $LANG, $TCA;
-
-                       // Initialize:
-               $elParts = explode(':',$element);
-               $table = $elParts[0];
-
-                       // If table is found in $TCA:
-               if ($TCA[$table])       {
+       function displayHistory()       {
+               global $LANG;
+               global $SOBE;
+               global $TCA;
 
-                               // Counting number of states:
-                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                                               'COUNT(*)',
-                                               'sys_history,sys_log',
-                                               'sys_history.sys_log_uid=sys_log.uid
-                                                       AND sys_history.tablename='.$GLOBALS['TYPO3_DB']->fullQuoteStr($table, 'sys_history').'
-                                                       AND sys_history.recuid='.intval($elParts[1])
-                                       );
-                       list($Rcount) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
+               $lines=array();
 
-                               // Selecting the $this->maxSteps most recent states:
-                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                                               'sys_history.*,sys_log.userid',
-                                               'sys_history,sys_log',
-                                               'sys_history.sys_log_uid=sys_log.uid
-                                                       AND sys_history.tablename='.$GLOBALS['TYPO3_DB']->fullQuoteStr($table, 'sys_history').'
-                                                       AND sys_history.recuid='.intval($elParts[1]),
-                                               '',
-                                               'sys_log.uid',
-                                               t3lib_div::intInRange($Rcount-$this->maxSteps,0).','.$this->maxSteps
-                                       );
+                       // Initialize:
+               $lines[] = '<tr class="bgColor5 c-head">
+                               <td> </td>
+                               <td>'.$LANG->getLL('time',1).'</td>
+                               <td>'.$LANG->getLL('age',1).'</td>
+                               <td>'.$LANG->getLL('user',1).'</td>
+                               <td>'.$LANG->getLL('tableUid',1).'</td>
+                               <td>'.$LANG->getLL('differences',1).'</td>
+                               <td>&nbsp;</td>
+                       </tr>';
+
+                       // get default page TSconfig expiration time
+               $elParts = explode(':',$this->element);
+               if ($elParts[0] != 'pages')     {
+                       $tmp = t3lib_BEfunc::getRecordRaw($elParts[0],'uid='.intval($elParts[1]));
+                       $pid = $tmp['pid'];
+               } else {
+                       $pid = $elParts[1];
+               }
+               $tmpTsConfig = $GLOBALS['BE_USER']->getTSConfig('TCEMAIN',t3lib_BEfunc::getPagesTSconfig($pid));
+               $expirationTime = isset($tmpTsConfig['properties']['default.']['history.']['maxAgeDays']) ? $tmpTsConfig['properties']['default.']['history.']['maxAgeDays'] : 30;
 
-                               // Traversing the result, building up changesArray / changeLog:
-                       $changesArray=array();
-                       $changeLog=array();
-                       while ($newRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))   {
-                               $hisDat = unserialize($newRow['history_data']);
-                               if (is_array($hisDat['newRecord']) && is_array($hisDat['oldRecord']))   {
-                                               // If intermedia changes:
-                                       $intermediaChanges = $this->cmp($changesArray,$hisDat['oldRecord']);
-                                       if (count($intermediaChanges) && !$newRow['snapshot'])  {
-                                               $changeLog[]=$intermediaChanges;
-                                       }
+               $expirationTimestamp = $expirationTime ? (time() - 60*60*24*$expirationTime) : 0;
+               $expirationWarning = 0;
 
-                                               // Add hisDat to the changeLog
-                                       $hisDat['uid']=$newRow['uid'];
-                                       $hisDat['tstamp']=$newRow['tstamp'];
-                                       $hisDat['user']=$newRow['userid'];
-                                       $hisDat['snapshot']=$newRow['snapshot'];
-                                       $changeLog[]=$hisDat;
+               $be_user_array = t3lib_BEfunc::getUserNames();
 
-                                               // Update change array
-                                               // This is used to detect if any intermedia changes has been made.
-                                       $changesArray = array_merge($changesArray,$hisDat['newRecord']);
-                               } else {
-                                       debug('ERROR: [displayHistory]');
-                               }
+                       // Traverse changelog array:
+               if (!$this->changeLog)  {
+                       return 0;
+               }
+               $i = 0;
+               foreach ($this->changeLog as $sysLogUid => $entry)      {
+                               // stop after maxSteps
+                       if ($i > $this->maxSteps && $this->maxSteps)    {
+                               break;
                        }
 
+                               // display inconsistency warning
+                       if ($entry['tstamp'] < $expirationTimestamp && !$expirationWarning)     {
+                               $expirationWarning = 1;
 
-                       $lines=array();
-                       $darkerBgColor_interM = '#cccccc';
-                       if ($this->sumUp)       {       // Show details for a single point in the list:
-
-                                       // Initialize:
-                               $changeLog=array();             // array is reset here because we want to show only one item (and therefore we will build it all over again...)
-                               $changeLog[]=$this->compareChangesWithCurrent($element,$this->getChangesSinceRecord($element,$this->sumUp));
-                               $this->listType=2;
-                               $lines[]=$this->listHeader();
-                               $be_users = t3lib_BEfunc::getUserNames();
-
-                                       // Get the previous/next uids:
-                               list($prevHisUid,$nextHisUid) = $this->nextHisUid($element,$this->sumUp);
+                               $lines[] = '
+                               <tr class="bgColor4-20">
+                                       <td colspan="7"><b>'.$LANG->getLL('consistenceWarning',1).'</b></td>
+                               </tr>';
+                       }
 
-                                       // Create the set of navigation links:
-                               $linkPack =
-                                       ($prevHisUid ? $this->linkPage('<img'.t3lib_iconWorks::skinImg('','gfx/pilup.gif','width="14" height="14"').' title="'.$LANG->getLL('prev',1).'" alt="" />', array('sumUp'=>$prevHisUid)) : '').        // previous
-                                       ($nextHisUid ? $this->linkPage('<img'.t3lib_iconWorks::skinImg('','gfx/pildown.gif','width="14" height="14"').' title="'.$LANG->getLL('next',1).'" alt="" />', array('sumUp'=>$nextHisUid)) : '').      // next
-                                       '<br />'.$this->linkPage('<img'.t3lib_iconWorks::skinImg('','gfx/history2.gif','width="13" height="12"').' title="'.$LANG->getLL('historyList',1).'" alt="" />', array('sumUp'=>''), 'uid_'.$this->sumUp).      // back to list
-                                       $this->linkPage('<img'.t3lib_iconWorks::skinImg('','gfx/savesnapshot.gif','width="17" height="12"').' title="'.$LANG->getLL('saveState',1).'" alt="" />', array('saveState'=>$this->sumUp,'sumUp'=>''), 'latest');      // save state
+                               // show only marked states
+                       if (!$entry['snapshot'] && $this->showMarked)   {
+                               continue;
+                       }
+                       $i++;
+                               // get user names
+                       $userName = ($entry['user']?$be_user_array[$entry['user']]['username']:$LANG->getLL('externalChange',1));
 
-                                       // Traverse changelog array:
-                               foreach($changeLog as $entry)   {
+                               // build up single line
+                       $singleLine = array();
 
-                                               // Set user-names:
-                                       if (!is_array($entry['userList']))      $entry['userList']=array();
-                                       foreach($entry['userList'] as $uLk => $uV)      {
-                                               $entry['userList'][$uLk]=$be_users[$uV]['username'];
-                                       }
+                               // diff link
+                       $image = '<img'.t3lib_iconWorks::skinImg('','gfx/button_top_right.gif').' align="top" alt="'.$LANG->getLL('sumUpChanges',1).'" title="'.$LANG->getLL('sumUpChanges',1).'" />';
+                       $singleLine[] = '<span>'.$this->linkPage($image,array('diff' => $sysLogUid)).'</span>'; // remove first link
 
-                                               // Add the header:
-                                       $theTime = t3lib_BEfunc::datetime($entry['tstamp']).', '.t3lib_BEfunc::calcAge(time()-$entry['tstamp'],$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears'));
-                                       $lines[]='
-                                               <tr class="bgColor4-20">
-                                                       <td valign="top">'.$linkPack.'</td>
-                                                       <td colspan="4"><b>'.$LANG->getLL('time',1).':</b> '.htmlspecialchars($theTime).' &nbsp; - &nbsp; <b>'.$LANG->getLL('changeCount',1).':</b> '.$entry['counter'].'<br />
-                                                               <b>'.$LANG->getLL('users',1).':</b> '.implode(', ',$entry['userList']).'
-                                                       </td>
-                                               </tr>';
+                       $singleLine[] = htmlspecialchars(t3lib_BEfunc::datetime($entry['tstamp']));     // add time
+                       $singleLine[] = htmlspecialchars(t3lib_BEfunc::calcAge(time()-$entry['tstamp'],$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')));  // add age
+                       $singleLine[] = htmlspecialchars($userName);    // add user name
+                       $singleLine[] = $this->linkPage($this->generateTitle($entry['tablename'],$entry['recuid']),array('element' => $entry['tablename'].':'.$entry['recuid']),'',$LANG->getLL('linkRecordHistory',1));        // add record UID
 
-                                               // Add content:
-                                       if (isset($entry['oldRecord']) && isset($entry['newRecord']))   {       // If there ARE differences to show, then add lines for each changed field:
-                                               $lines = array_merge($lines,$this->renderEntry($entry,$table));
-                                       } else {        // Otherwise, if no changes - show a message about that!
-                                               $lines[]='
-                                                       <tr class="bgColor4">
-                                                               <td colspan="5" align="center"><br /><b>'.$LANG->getLL('similar',1).'</b><br /><br /></td>
-                                                       </tr>';
-                                       }
+                               // show insert/delete/diff/changed field names
+                       if ($entry['action'])   {       // insert or delete of element
+                               $singleLine[] = '<strong>'.htmlspecialchars($LANG->getLL($entry['action'],1)).'</strong>';
+                       } else {
+                               if (!$this->showDiff)   {       // display field names instead of full diff
+                                       // re-write field names with labels
+                               $tmpFieldList = explode(',',$entry['fieldlist']);
+                               foreach ($tmpFieldList as $key => $value)       {
+                                       $tmp = str_replace(':','',$LANG->sl(t3lib_BEfunc::getItemLabel($entry['tablename'],$value),1));
+                                       if($tmp)        $tmpFieldList[$key] = $tmp;
+                                       else    unset($tmpFieldList[$key]);     // remove fields if no label available
                                }
-                       } else {        // Show the full change Log:
-
-                                       // Initialize:
-                               $this->listType=1;
-                               $be_users = t3lib_BEfunc::getUserNames();
-                               $lines[]=$this->listHeader();
-
-                                       // Traverse changelog array:
-                               foreach($changeLog as $c => $entry)     {
-
-                                               // Add spacer line:
-                                       $lines[]='
-                                               <tr>
-                                                       <td colspan="3">&nbsp;</td>
-                                               </tr>';
-
-                                               // Anchor to latest entry:
-                                       $lastAnchor = ($c+1==count($changeLog)?'<a name="latest"></a>':'');
-
-                                               // Render state header:
-                                       if ($entry['uid'])      {       // This state was made by the backend:
-                                               $theTime = $this->linkPage(t3lib_BEfunc::datetime($entry['tstamp']),array('sh_uid'=>$entry['uid'],'element'=>''));
-                                               $theAge = ', '.t3lib_BEfunc::calcAge(time()-$entry['tstamp'],$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears'));
-                                               $bgColorClass = $entry['snapshot'] ? 'bgColor2' : 'bgColor4-20';
-                                               $lines[]='
-                                                       <tr class="'.$bgColorClass.'">
-                                                               <td colspan="2">'.
-                                                                       $lastAnchor.
-                                                                       '<a name="uid_'.$entry['uid'].'"></a>'.
-                                                                       ($entry['snapshot'] ? '<img'.t3lib_iconWorks::skinImg('','gfx/snapshot.gif','width="12" height="12"').' alt="" />':'').
-                                                                       '<b>'.$LANG->getLL('time',1).':</b> '.$theTime.htmlspecialchars($theAge).' &nbsp; - &nbsp; <b>'.$LANG->getLL('user',1).':</b> '.$be_users[$entry['user']]['username'].
-                                                               '</td>
-                                                               <td>'.
-                                                                       $this->linkPage('<img'.t3lib_iconWorks::skinImg('','gfx/history.gif','width="13" height="12"').' title="'.$LANG->getLL('revertAllFields',1).'" alt="" />', array('revert'=>'ALL_FIELDS','sumUp'=>$entry['uid'],'doReturn'=>1)).
-                                                                       $this->linkPage('<img'.t3lib_iconWorks::skinImg('','gfx/history_details.gif','width="12" height="12"').' title="'.$LANG->getLL('sumUpChanges',1).'" alt="" />', array('sumUp'=>$entry['uid'])).
-                                                               '</td>
-                                                       </tr>';
-                                       } else {        // This state must have been some external change:
-                                               $lines[]='
-                                                       <tr bgcolor="'.$darkerBgColor_interM.'">
-                                                               <td colspan="3"><strong>'.$LANG->getLL('externalChange',1).'</strong></td>
-                                                       </tr>';
-                                       }
-                                               // Merge state header with all entries in the state:
-                                       $lines = array_merge($lines,$this->renderEntry($entry,$table));
+                               $singleLine[] = htmlspecialchars(implode(',',$tmpFieldList));
+                               } else {        // display diff
+                                       $diff = $this->renderDiff($entry,$entry['tablename']);
+                                       $singleLine[] = $diff;
                                }
                        }
+                               // show link to mark/unmark state
+                       if (!$entry['action'])  {
+                               if ($entry['snapshot']) {
+                                       $image = '<img'.t3lib_iconWorks::skinImg('','gfx/unmarkstate.gif').' align="top" alt="'.$LANG->getLL('unmarkState',1).'" title="'.$LANG->getLL('unmarkState',1).'" />';
+                               } else {
+                                       $image = '<img'.t3lib_iconWorks::skinImg('','gfx/markstate.gif').' align="top" alt="'.$LANG->getLL('markState',1).'" title="'.$LANG->getLL('markState',1).'" />';
+                               }
+                               $singleLine[] = $this->linkPage($image,array('highlight' => $entry['uid']));
+                       } else {
+                               $singleLine[] = '';
+                       }
 
-                               // Finally, put it all together:
-                       $theCode='
-
-                               <!--
-                                       Item history (either list or single):
-                               -->
-                               <table border="0" cellpadding="2" cellspacing="2" id="typo3-history">
-                                       '.implode('',$lines).'
-                               </table>';
-
-                               // Add message about the difference view.
-                       $theCode.= '<br /><img'.t3lib_iconWorks::skinImg('','gfx/icon_note.gif','width="18" height="16"').' align="top" alt="" />'.$LANG->getLL('differenceMsg').'<br /><br />';
-
-                               // Add CSH:
-                       $theCode.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'history_'.($this->sumUp ? 'sum' : 'log'), $GLOBALS['BACK_PATH'],'');
-
-                               // Add the whole content as a module section:
-                       return $SOBE->doc->section($LANG->getLL('changes'),$theCode,0,1);
+                       $bgColorClass = $entry['snapshot'] ? 'bgColor2' : 'bgColor4-20';
+                               // put line together
+                       $lines[] = '
+                               <tr class="'.$bgColorClass.'">
+                                       <td>'.implode('</td><td>',$singleLine).'</td>
+                               </tr>';
                }
-       }
-
-
-
-
-
-
 
+                       // Finally, put it all together:
+               $theCode = '
+                       <!--
+                               History (list):
+                       -->
+                       <table border="0" cellpadding="2" cellspacing="2" id="typo3-history">
+                               '.implode('',$lines).'
+                       </table>';
+
+               if ($this->lastSyslogId)        {
+                       $theCode .= '<br />' .  $this->linkPage('<img'.t3lib_iconWorks::skinImg('','gfx/group_tobottom.gif').' alt="'.$LANG->getLL('fullView',1).'" title="'.$LANG->getLL('fullView',1).'" />',array('diff' => ''));
+               }
+                       // Add message about the difference view.
+               $theCode .= '<br /><img'.t3lib_iconWorks::skinImg('','gfx/icon_note.gif','width="18" height="16"').' align="top" alt="" />'.$LANG->getLL('differenceMsg').'<br /><br />';
 
+                       // Add CSH:
+               $theCode .= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'history_'.($this->sumUp ? 'sum' : 'log'), $GLOBALS['BACK_PATH'],'');
 
-       /*******************************
-        *
-        * Various helper functions
-        *
-        *******************************/
+                       // Add the whole content as a module section:
+               return $SOBE->doc->section($LANG->getLL('changes'),$theCode,0,1);
+       }
 
        /**
-        * Based on the uid of a sys_history record (a state) this method will find the uids of the previous and next state (if any)
+        * Displays a diff over multiple fields including rollback links
         *
-        * @param       string          Element reference, syntax "[table]:[uid]"
-        * @param       integer         Current state uid
-        * @return      array           Array with previous and next uid as key 0 / 1
-        * @access private
+        * @param       array           difference array
+        * @return      string          HTML output
         */
-       function nextHisUid($element,$hisUid)   {
-               $elParts = explode(':',$element);
-
-                       // Prev:
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                                       'uid',
-                                       'sys_history',
-                                       'tablename='.$GLOBALS['TYPO3_DB']->fullQuoteStr($elParts[0], 'sys_history').'
-                                               AND recuid='.intval($elParts[1]).'
-                                               AND uid<'.intval($hisUid),
-                                       '',
-                                       'uid DESC',
-                                       '1'
-                               );
-               if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                       $prevUid = $row['uid'];
-               }
+       function displayMultipleDiff($diff)     {
+               global $SOBE, $LANG;
+               $content = '';
+
+                       // get all array keys needed
+               $arrayKeys = array_merge(array_keys($diff['newData']),array_keys($diff['insertsDeletes']),array_keys($diff['oldData']));
+               $arrayKeys = array_unique($arrayKeys);
+
+               foreach ($arrayKeys as $key)    {
+                       $record = '';
+                       $elParts = explode(':',$key);
+                               // turn around diff because it should be a "rollback preview"
+                       if ($diff['insertsDeletes'][$key] == 1) {       // insert
+                               $record .= '<b>'.$LANG->getLL('delete',1).'</b>';
+                               $record .= '<br />';
+                       } elseif ($diff['insertsDeletes'][$key] == -1)  {
+                               $record .= '<b>'.$LANG->getLL('insert',1).'</b>';
+                               $record .= '<br />';
+                       }
+                               // build up temporary diff array
+                               // turn around diff because it should be a "rollback preview"
+                       if ($diff['newData'][$key])     {
+                               $tmpArr['newRecord'] = $diff['oldData'][$key];
+                               $tmpArr['oldRecord'] = $diff['newData'][$key];
+                               $record .= $this->renderDiff($tmpArr, $elParts[0],$elParts[1]);
+                       }
+
+                       $elParts = explode(':',$key);
+                       $titleLine = $this->createRollbackLink($key, $LANG->getLL('revertRecord',1),1) . $this->generateTitle($elParts[0],$elParts[1]);
+                       $record = '<div style="margin-left:10px;padding-left:5px;border-left:1px solid black;border-bottom:1px dotted black;padding-bottom:2px;">'.$record.'</div>';
 
-                       // Next:
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                                       'uid',
-                                       'sys_history',
-                                       'tablename='.$GLOBALS['TYPO3_DB']->fullQuoteStr($elParts[0], 'sys_history').'
-                                               AND recuid='.intval($elParts[1]).'
-                                               AND uid>'.intval($hisUid),
-                                       '',
-                                       'uid',
-                                       '1'
-                               );
-               if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                       $nextUid = $row['uid'];
+                       $content .= $SOBE->doc->section($titleLine,$record,0,0,0,1);
                }
+               $content = $this->createRollbackLink('ALL', $LANG->getLL('revertAll',1),0)  . '<div style="margin-left:10px;padding-left:5px;border-left:1px solid black;border-bottom:1px dotted black;padding-bottom:2px;">'.$content.'</div>';
 
-                       // Return next and previous ids:
-               return array($prevUid,$nextUid);
+               return $SOBE->doc->section($LANG->getLL('mergedDifferences',1),$content,0,1,0,1);
        }
 
        /**
-        * This compares a certain sys_history state (given by the $changeRec array) with the current values of the element refered to by $element.
+        * Renders HTML table-rows with the comparison information of an sys_history entry record
         *
-        * @param       string          Element reference, syntax "[table]:[uid]"
-        * @param       array           Array with the state information from a certain state. This kind of array is produced by getChangesSinceRecord()
-        * @return      array           Array with the changes registered in.
+        * @param       array           sys_history entry record.
+        * @param       string          The table name
+        * @param       integer         If set to UID of record, display rollback links
+        * @return      string          HTML table
         * @access private
-        * @see getChangesSinceRecord()
         */
-       function compareChangesWithCurrent($element,$changeRec) {
-               global $TCA;
-
-                       // Initialize:
-               $sumChangesArray=array();
-               $elParts = explode(':',$element);
-               $newChangeRec=array();
-
-                       // If tablename is found in $TCA:
-               if ($TCA[$elParts[0]])  {
+       function renderDiff($entry,$table,$rollbackUid=0)       {
+               global $SOBE, $LANG, $TCA;
+               $lines=array();
+               if (is_array($entry['newRecord']))      {
 
-                               // Select current record content of element:
-                       $currentRecord = t3lib_BEfunc::getRecord($elParts[0],$elParts[1]);
+                       $t3lib_diff_Obj = t3lib_div::makeInstance('t3lib_diff');
 
-                               // If that is found and the "changes" entry of the $changeRec is an array, then proceed:
-                       if (is_array($currentRecord) && is_array($changeRec['changes']))        {
+                       $fieldsToDisplay = array_keys($entry['newRecord']);
+                       foreach($fieldsToDisplay as $fN)        {
+                               t3lib_div::loadTCA($table);
+                               if (is_array($TCA[$table]['columns'][$fN]) && $TCA[$table]['columns'][$fN]['config']['type']!='passthrough')    {
 
-                                       // For each entry in "changes" we compare the field content with the current and if there is a difference, it is tracked in the array $newChangeRec
-                               foreach($changeRec['changes'] as $fN => $fV)    {
-                                       if (strcmp($fV,$currentRecord[$fN]))    {
-                                               $newChangeRec['oldRecord'][$fN]=$fV;
-                                               $newChangeRec['newRecord'][$fN]=$currentRecord[$fN];
-                                       }
+                                               // Create diff-result:
+                                       $diffres = $t3lib_diff_Obj->makeDiffDisplay(
+                                               t3lib_BEfunc::getProcessedValue($table,$fN,$entry['oldRecord'][$fN],0,1),
+                                               t3lib_BEfunc::getProcessedValue($table,$fN,$entry['newRecord'][$fN],0,1)
+                                       );
+                                       $lines[]='
+                                               <tr class="bgColor4">
+                                               '.($rollbackUid?'<td style="width:33px">'.$this->createRollbackLink($table.':'.$rollbackUid.':'.$fN, $LANG->getLL('revertField',1),2).'</td>':'').'
+                                                       <td style="width:90px"><em>'.$LANG->sl(t3lib_BEfunc::getItemLabel($table,$fN),1).'</em></td>
+                                                       <td style="width:300px">'.nl2br($diffres).'</td>
+                                               </tr>';
                                }
-                                       // Finally, setting some general information fields:
-                               $newChangeRec['tstamp']=min($changeRec['tstamp']);
-                               $newChangeRec['counter']=$changeRec['counter'];
-                               $newChangeRec['userList']=array_unique($changeRec['userList']);
-                       } else {
-                               return false;   // No arrays, possibly no record
                        }
                }
-
-                       // Returns the array of changes detected:
-               return $newChangeRec;
+               if ($lines)     {
+                       $content = '<table border="0" cellpadding="2" cellspacing="2" id="typo3-history-item">
+                                       '.implode('',$lines).'
+                               </table>';
+                       return $content;
+               }
+               return NULL;    // error fallback
        }
 
-       /**
-        * Returns the record of $table/$id along with the sql field types for each field
+       /*******************************
         *
-        * @param       string          The table name
-        * @param       integer         The uid of the record
-        * @return      array           An array with two num keys; in 0 is the current record, in 1 is the field types for each field.
-        * @access private
-        */
-       function readFieldTypes($table,$id)     {
-
-                       // Select record:
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $table, 'uid='.intval($id));
-
-                       // Fetch the types of the fields.
-               if ($GLOBALS['TYPO3_DB']->sql_num_rows($res))   {
-                       $currentRecord = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
-                       $c=0;
-                       $cRecTypes=array();
-                       foreach($currentRecord as $col => $val) {
-                               //$cRecTypes[$col] = $GLOBALS['TYPO3_DB']->sql_field_type($table,$col);
-// DBAL
-                               $cRecTypes[$col] = $GLOBALS['TYPO3_DB']->sql_field_type($res,$c);
-                               $c++;
-                       }
-               }
-
-               $GLOBALS['TYPO3_DB']->sql_free_result($res);
-
-               return array($currentRecord,$cRecTypes);
-       }
+        * build up history
+        *
+        *******************************/
 
        /**
-        * Compares the old record with the changed fields.
+        * Creates a diff between the current version of the records and the selected version
         *
-        * @param       array           Record with field/value pairs (what has changed)
-        * @param       array           Record with field/value pairs
-        * @return      array           Comparison result.
-        * @access private
+        * @return      array           diff for many elements
         */
-       function cmp($changeStatus,$oldRecord)  {
+       function createMultipleDiff()   {
+               $insertsDeletes = array();
+               $newArr = array();
+               $differences = array();
+               if (!$this->changeLog)  {
+                       return 0;
+               }
 
-                       // Initialize:
-               $changes=array();
+                       // traverse changelog array
+               foreach ($this->changeLog as $key => $value)    {
+                       $field = $value['tablename'].':'.$value['recuid'];
+                               // inserts / deletes
+                       if ($value['action'])   {
+                               if (!$insertsDeletes[$field])   {
+                                       $insertsDeletes[$field] = 0;
+                               }
+                               if ($value['action'] == 'insert')       {
+                                       $insertsDeletes[$field]++;
+                               } else {
+                                       $insertsDeletes[$field]--;
+                               }
+                                       // unset not needed fields
+                               if ($insertsDeletes[$field] == 0)       {
+                                       unset($insertsDeletes[$field]);
+                               }
+                       } else {
+                                       // update fields
+                               if (!isset($newArr[$field]))    {       // first row of field
+                                       $newArr[$field] = $value['newRecord'];
+                                       $differences[$field] = $value['oldRecord'];
+                               } else { // standard
+                                       $differences[$field] = array_merge($differences[$field],$value['oldRecord']);
+                               }
+                       }
+               }
 
-                       // Traverse $oldRecord
-               foreach($oldRecord as $fN => $fV)       {
-                       if (isset($changeStatus[$fN]) && strcmp($fV,$changeStatus[$fN]))        {
-                               $changes['oldRecord'][$fN]=$changeStatus[$fN];
-                               $changes['newRecord'][$fN]=$fV;
+                       // remove entries where there were no changes effectively
+               foreach ($newArr as $record => $value)  {
+                       foreach ($value as $key => $innerVal)   {
+                               if ($newArr[$record][$key] == $differences[$record][$key])      {
+                                       unset($newArr[$record][$key]);
+                                       unset($differences[$record][$key]);
+                               }
                        }
+
                }
-               return $changes;
+               return array(
+                       'newData' => $newArr,
+                       'oldData' => $differences,
+                       'insertsDeletes' => $insertsDeletes
+               );
        }
 
        /**
-        * Will traverse the field names in $dataArray and look in $TCA if the fields are of types which cannot be handled by the sys_history (that is currently group types with internal_type set to "file")
+        * Creates change log including sub-elements, filling $this->changeLog
         *
-        * @param       string          Table name
-        * @param       array           The data array
-        * @return      array           The modified data array
-        * @access private
         */
-       function removeFilefields($table,$dataArray)    {
-               global $TCA;
+       function createChangeLog()      {
 
-               if ($TCA[$table])       {
-                       t3lib_div::loadTCA($table);
-
-                       foreach($TCA[$table]['columns'] as $field => $config)   {
-                               if ($config['config']['type']=='group' && $config['config']['internal_type']=='file')   {
-                                       unset($dataArray[$field]);
+               global $TCA;
+               $elParts = explode(':',$this->element);
+               $changeLog = $this->getHistoryData($elParts[0],$elParts[1]);
+
+                       // get history of tables of this page and merge it into changelog
+               if ($elParts[0] == 'pages' && $this->showSubElements)   {
+                       foreach ($TCA as $tablename => $value)  {
+                               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid',$tablename,'pid='.intval($elParts[1]));     // check if there are records on the page
+                               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))      {
+                                       if ($newChangeLog = $this->getHistoryData($tablename, $row['uid']))     {       // if there is history data available, merge it into changelog
+                                               foreach ($newChangeLog as $key => $value)       {
+                                                       $changeLog[$key] = $value;
+                                               }
+                                       }
                                }
                        }
                }
-               return $dataArray;
+               if(!$changeLog) {
+                       return 0;
+               }
+
+               krsort($changeLog);
+               $this->changeLog = $changeLog;
+
+               return 1;
        }
 
        /**
-        * Renders HTML table-rows with the comparison information of an sys_history entry record
+        * Gets history and delete/insert data from sys_log and sys_history
         *
-        * @param       array           sys_history entry record.
-        * @param       string          The table name
-        * @return      array           HTML table rows in an array
-        * @access private
+        * @param       string          DB table name
+        * @param       integer         UID of record
+        * @return      array           history data of the record
         */
-       function renderEntry($entry,$table)     {
-               global $SOBE, $LANG, $TCA;
+       function getHistoryData($table,$uid)    {
+               global $TCA;
+               $uid = $this->resolveElement($table,$uid);
+                       // If table is found in $TCA:
+               if ($TCA[$table])       {
+                               // Selecting the $this->maxSteps most recent states:
+                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                                               'sys_history.*,sys_log.userid',
+                                               'sys_history,sys_log',
+                                               'sys_history.sys_log_uid=sys_log.uid
+                                                       AND sys_history.tablename='.$GLOBALS['TYPO3_DB']->fullQuoteStr($table, 'sys_history').'
+                                                       AND sys_history.recuid='.intval($uid),
+                                               '',
+                                               'sys_log.uid DESC',
+                                               $this->maxSteps
+                                       );
 
-               $lines=array();
-               if (is_array($entry['newRecord']))      {
+                               // Traversing the result, building up changesArray / changeLog:
+                       #$changesArray=array(); // used temporarily to track intermedia changes
+                       $changeLog=array();
+                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))      {
+                                       // only history until a certain syslog ID needed
+                               if ($row['sys_log_uid'] < $this->lastSyslogId && $this->lastSyslogId)   {
+                                       continue;
+                               }
+                               $hisDat = unserialize($row['history_data']);
+                               if (is_array($hisDat['newRecord']) && is_array($hisDat['oldRecord']))   {
 
-                       $t3lib_diff_Obj = t3lib_div::makeInstance('t3lib_diff');
+                                               // Add hisDat to the changeLog
+                                       $hisDat['uid']=$row['uid'];
+                                       $hisDat['tstamp']=$row['tstamp'];
+                                       $hisDat['user']=$row['userid'];
+                                       $hisDat['snapshot']=$row['snapshot'];
+                                       $hisDat['fieldlist']=$row['fieldlist'];
+                                       $hisDat['tablename']=$row['tablename'];
+                                       $hisDat['recuid']=$row['recuid'];
 
-                       $fieldsToDisplay = array_keys($entry['newRecord']);
-                       foreach($fieldsToDisplay as $fN)        {
-                               t3lib_div::loadTCA($table);
-                               if (is_array($TCA[$table]['columns'][$fN]) && $TCA[$table]['columns'][$fN]['config']['type']!='passthrough')    {
+                                       $changeLog[$row['sys_log_uid']]=$hisDat;
 
-                                               // Create diff-result:
-