DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: punkt.de Library

Author:Rainer Kuhn
Created:2004-07-09T10:59:48
Changed by:Rainer Kuhn
Changed:2007-07-09T16:00:35
Author:Rainer Kuhn
Company:punkt.de GmbH
Email:t3extensions@punkt.de
Info 4:

EXT: punkt.de Library

Extension Key: pt_lib

Copyright 2004-2007, Rainer Kuhn, <t3extensions@punkt.de>

revised for version 0.6.6, 2007-07-09

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

EXT: punkt.de Library 1

Introduction 1

What does it do? 1

Screenshots 2

Users manual 3

Configuration 3

To-Do list 4

Changelog 4

Appendix: API documentation 5

lib/class.tx_ptlib_base.php 5

lib/class.tx_ptlib_formcheck.php 12

lib/class.tx_ptlib_file.php 15

lib/class.tx_ptlib_formReloadHandler.php 16

Introduction

This extension provides PHP4 code libraries for some extensions from punkt.de (extension key pt_*). The extension includes a library with general methods, a class to check form content, a class for file handling and a class for web form reload handling, which may be helpful for other extensions, too. If you'll find some helpful code in here, feel free to use these libraries for your own extensions (see Users manual below and Appendix: API documentation).

IMPORTANT (07/2007): This extension is provided in TER as dependency library for legacy PHP4 extensions (e.g. pt_conference). Besides maintenance updates it will not be continued anymore since it has been superseded by the PHP5 library extension pt_tools.

What does it do?

There are four libraries available:

class.tx_ptlib_base.php This library contains a class with several basic methods for different purposes (e.g. session handling, database access, string conversion and general methods) and a debugging function for “trace” display and logging while developing. This "trace" function is non OO (available as a function outside the class) for quick and easy access from every script that includes this file.

class.tx_ptlib_formcheck.php This library class provides several methods for checking input content, usually originating from web forms (includes a lot of special type checks like text, digits, email, zip and many more), and one method for displaying information and messages in a HTML-Messagebox, which can be used for arbitrary output (independent of form checks)

class.tx_ptlib_file.php This library class provides methods for file handling. At the moment it is limited to handle file uploads, later it may be extended with general file handling methods.

class.tx_ptlib_formReloadHandler.php This library class provides methods for web form reload handling. With use of its methods the double execution of form initiated action can be prevented performing a token check.

Screenshots

img-1

Configuration of pt_lib extension (v0.4.2) in TYPO3's Constant Editor

img-2

MessageBox from tx_ptlib_formcheck()::msgbox(), used for form checking errors

img-3

MessageBox from tx_ptlib_formcheck()::msgbox(), used for user information

Users manual

If you want to use pt_lib for your own extensions, you have to install this extension and create a dependency to pt_lib in your ext_emconf.phpfile. Include the appropriate libraries from pt_lib in your extension script.

((generated))

((generated))
Example
// Inclusion of pt_lib libraries (used version of pt_lib: v0.6.0)
require_once t3lib_extMgm::extPath('pt_lib').'lib/class.tx_ptlib_base.php';
require_once t3lib_extMgm::extPath('pt_lib').'lib/class.tx_ptlib_formcheck.php';
require_once t3lib_extMgm::extPath('pt_lib').'lib/class.tx_ptlib_file.php';

Methods of this library can be used by developers for their own scripts by making an instance of the appropriatelibrary class: $myInstance = t3lib_div::makeInstance("librayClassName"); a method is called via the new instance, e.g. $myInstance->methodName()in this case.

Example
// Instantiation
$this->formCheck = t3lib_div::makeInstance("tx_ptlib_formcheck");
// Method call
$this->formCheck->msgbox();

Another possibility is to access the methods of class tx_ptlib_base directly (without making an instance of the library class before): librayClassName::methodName()- this will not work offhand for methods of the class tx_ptlib_formcheck as the existing class constructor is not invoked if you do not instantiate the class.

Example
// Direct method call without instantiation (class tx_ptlib_base only)
$pwd = tx_ptlib_base::createPassword(8);

To get an overview of all classes, methods and functions of pt_lib please refer to the Appendix: API documentation.

Configuration

Some elements of the pt_lib libraries can be configured in TYPO3's Constant Editor. The available settings are:

Admin email for system mails [config.pt_lib.adminMail]Admin email for system mails: Email adress (comma-seperated list for multiple recipients) for auto-generated admin mails of pt_lib extension (e.g. trace logging errors).

Trace log output directory [config.pt_lib.logDir]Directory path for generated debugging trace logs if $trace is set to '2' (absolute server path, don't forget the prefacing and closing slashes "/").Example: /var/log/apache/myproject/

MessageBox icon directory [config.pt_lib.msgboxIconDir]Directory path for icons used in MessageBoxes (webserver path [document root=htdocs], don't forget the prefacing and closing slashes "/"). Don't change the name of the icon files as they're used in the code of tx_ptlib_formcheck()::msgbox().Default: /typo3conf/ext/pt_lib/res/

  • MessageBox header font [config.pt_lib.msgboxFontHeader]CSS notation for MessageBox header font (for tx_ptlib_formcheck()::msgbox()).Default: font-family:Verdana,Arial ,sans-serif; font-size:13px; font-weight:bold; color:#333366;
  • MessageBox message font [config.pt_lib.msgboxFontMsg]CSS notation for MessageBox message text font (for tx_ptlib_formcheck()::msgbox()).Default: font-family:Verdana,Arial ,sans-serif; font-size:11px; font-weight:normal; color:#333366;
  • MessageBox header background color [config.pt_lib.msgboxColHeaderBg]Background color of a MessageBox header area (for tx_ptlib_formcheck()::msgbox()).Default: #e4e4e4
  • MessageBox message background color [config.pt_lib.msgboxColMsgBg]Background color of a MessageBox message text area (for tx_ptlib_formcheck()::msgbox()).Default: #ffffff
  • MessageBox border color [config.pt_lib.msgboxColBorder]Border color of MessageBoxes (for tx_ptlib_formcheck()::msgbox()).Default: #9999cc

To-Do list

improve integration into TYPO3 Core APIs, check for similar TYPO3 core functions

Changelog

  • v0.6.6: tx_ptlib_file::handleFileUpload(): enhancement for compatibility with Apache 2; removed additional translations in tx_ptlib_base::htmlOutput()
  • v0.6.5: tx_ptlib_base: resolved conflict of trace() with extension pt_tools; improved German language labels
  • v0.6.4: new class tx_ptlib_formReloadHandler added; new methods in tx_ptlib_base: returnLastBuiltSelectQuery(), returnLastBuiltDeleteQuery(), returnLastBuiltUpdateQuery(), returnLastBuiltInsertQuery()
  • v0.6.3: added new methods in tx_ptlib_base: htmlOutput(), htmlOutputArray() (XSS prevention), hookRequest() (TYPO3 hooks); added XSS-enhancement for tx_ptlib_base::createPulldownOptions()
  • v0.6.2: Code/security improvements, class tx_ptlib_file: improved error messages, corrected mixed up messages/comments
  • v0.6.1: Additional Finnish translations merged. Thanks for support!
  • v0.6.0: Added new library class tx_ptlib_file for file handling (limited to file upload handling at the moment); minor change in tx_ptlib_formcheck::checkText: Slash character '/' added to the list of allowed chars.
  • v0.5.2: Finnish translation merged. Thanks for support!
  • v0.5.1: added XHTML compliance and message box border colors for non- IE browsers
  • v0.5.0:- class tx_ptlib_formcheck: multilanguage capabilities implemented via TYPO3 locallang file and localization featuresof tslib_base; therefore changed class tx_ptlib_formcheck to extend TYPO3 class tslib_pibase and added localization initialization into class constructor.- class tx_ptlib_formcheck: fixed RegExp bug with non-devaluated '-' char in several check*() methods- class tx_ptlib_formcheck: display of invalid character added for all “...contains wrong characters” messages- class tx_ptlib_formcheck: new method checkPulldown() added, usable for required selectorboxes- class tx_ptlib_formcheck: fieldTitle param now required for all check*() methods- class tx_ptlib_formcheck: checkLogin() and checkPwd(): required field check added;.,_#:& removed from RegEx check- class.tx_ptlib_base.php: major revision of the non-OO debugging functions trace()/startTraceLog() (startTraceLog() now obsolete, but kept in empty state for backwards compability)- class.tx_ptlib_base.php: replaced all occurences of “$this->” within methods with “tx_ptlib_base::” to allow direct access to the methods without former instantiationclass.tx_ptlib_base.php: revision of localRedirect() method; better integration into TYPO3 Core APIs; minor translations- added new configuration parameter config.pt_lib.adminMail to Constant Editor- this manual: chapter “Users manual”: Direct method call paragraph changed, chapter “Configuration” and API updated
  • v0.4.2: documentation updated
  • v0.4.1: initial version uploaded to TER

Appendix: API documentation

lib/class.tx_ptlib_base.php

a

class tx_ptlib_base

Provides a base library for punkt.de extensions (pt_*) with several general methodsfor different purposes (e.g. session handling, database access, string conversion)

Returns:

a

Returns:

b

[type]

c

...

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-05

((Unknown Property))

a

b

@package TYPO3

((Unknown Property))

a

b

@subpackage tx_ptlib

function createPassword($length=8)

Creates an eays-to-remember mnemonic passwordAll passwords created by this method follow the scheme "every consonantis followed by a vowel" (e.g. "rexegubo")

$length=8

a

$length=8

b

integer

c

required length of password (optional, default is 8)

Returns:

a

Returns:

b

string

c

mnemonic password

((Unknown Property))

a

b

@see

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-05

function createLogin($str, $uniqueCheck=1, $dbTable="fe_users", $dbField="username")

Creates a login with 4 to 6 chars and 3 attached digitsThe chars are based on a passed string (e.g. lastname) of length n. The first 6 charsof this string are used (if existing), if n < 4 the function adds 4-n chars.By default a unique check for a given database field is activated (if thecreated login already exists in the database a new login is generated).

$str

a

$str

b

string

c

string used as base for the login (e.g. lastname)

$uniqueCheck=1

a

$uniqueCheck=1

b

boolean

c

flag to activate/deactivate the unique check (optional, default is true)

$dbTable="fe_users"

a

$dbTable="fe_users"

b

string

c

database table name for unique check (optional, default is fe_users)

$dbField="username"

a

$dbField="username"

b

string

c

database field name for unique check (optional, default is username)

Returns:

a

Returns:

b

string

c

login/username

((Unknown Property))

a

b

@see createPassword()

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-05

function createPulldownOptions($table, $selectedId=NULL, $sorting=0)

Returns the option tags for an HTML pulldown menu (selectorbox) from all active records of a given database helper table.Applicable for database tables following the helper table scheme ('uid' as ID field label and 'title' as entry field label) only.The returned pulldown options contain the uid as value and the title as option description.

$table

a

$table

b

string

c

database table name

$selectedId=NULL

a

$selectedId=NULL

b

integer

c

ID of an option that should be pre-selected (optional)

$sorting=0

a

$sorting=0

b

boolean

c

flag to sort options according to 'sorting' db column if existent (optional, default is false)

Returns:

a

Returns:

b

string

c

HTML option tags for a pulldown menu (selectorbox)

((Unknown Property))

a

b

@see getRecords($table, $sorting)

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-04

function checkCookieFeUser()

Checks if a FE user cookie is set (e.g. used for sessions)

((Unknown Property))

a

b

void

c

Returns:

a

Returns:

b

boolean

c

true if cookie is set, else false

((Unknown Property))

a

b

@global array $_COOKIE

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-06

function checkFeUser($checkID)

Compares a passed ID with the ID of the currently logged-in FE user(e.g. used for security check of certain access rights)

$checkID

a

$checkID

b

integer

c

ID to compare with the ID of the currently logged-in FE user

Returns:

a

Returns:

b

boolean

c

true if IDs are equal, else false

((Unknown Property))

a

b

@global integer $GLOBALS['TSFE']->fe_user->user['uid']

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-04

function localRedirect($localPath, $msgBox=NULL)

Redirects the user to a local page and saves existing messageboxes to the session.Notice: This method may also be used for reload of the current page after executing a database query(to prevent from double execution of database queries on user page reload)

$localPath

a

$localPath

b

string

c

local page to redirect to: URL path exclusive domain and leading slash (e.g. for redirection to http://mydomain.com/contact.html just pass "contact.html")

$msgBox=NULL

a

$msgBox=NULL

b

string

c

HTML-Messagebox to pass to the redirected page via TYPO3 session (optional)

Returns:

a

Returns:

b

void

c

((Unknown Property))

a

b

@global array $GLOBALS['TSFE']

((Unknown Property))

a

b

@see tx_ptlib_formcheck::msgBox(), t3lib_div::locationHeaderUrl()

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-05

function &hookRequest($extKey, $hookArrayKey, $functionName)

Returns an object reference to the hook object if any

$extKey

a

$extKey

b

string

c

TYPO3 extension key of the extension to use the hook in (e.g. 'pt_gsashop')

$hookArrayKey

a

$hookArrayKey

b

string

c

name of hook array of the extensions $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extKey] in ext_localconf.php (e.g. 'pi1_hooks')

$functionName

a

$functionName

b

string

c

name of the function you want to call / hook key

Returns:

a

Returns:

b

object

c

Hook object, if any. Otherwise null.

((Unknown Property))

a

b

@global array $TYPO3_CONF_VARS

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>, based on tx_indexedsearch::hookRequest() by Kasper Skårhøj <kasperYYYY@typo3.com>/Christian Jul Jensen <christian@typo3.com>

((Unknown Property))

a

b

@since 2006-02-28/2006-10-18 within this class

function sessionSetKey($key, $val, $type="ses")

Saves a session key *immediately* to TYPO3 session (not waiting for complete script execution)

$key

a

$key

b

string

c

name of session key to save value to (array key)

$val

a

$val

b

string

c

value to be saved with session key

$type="ses"

a

$type="ses"

b

string

c

type of TYPO3 session (optional): "ses" for browser based session (default), "user" for FE user based session

Returns:

a

Returns:

b

void

c

((Unknown Property))

a

b

@global array $GLOBALS['TSFE']

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-05

function sessionUnsetKey($key, $type="ses")

Deletes a session value *immediately* from TYPO3 session (not waiting for complete script execution)

$key

a

$key

b

string

c

name of session key to delete (array key)

$type="ses"

a

$type="ses"

b

string

c

type of TYPO3 session (optional): "ses" for browser based session (default), "user" for FE user based session

Returns:

a

Returns:

b

void

c

((Unknown Property))

a

b

@global array $GLOBALS['TSFE']

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-05

function sessionGetKey($key, $type="ses")

Gets a key from TYPO3 session (alias for $GLOBALS["TSFE"]->fe_user->getKey($type, $key))

$key

a

$key

b

string

c

name of session key to get (array key)

$type="ses"

a

$type="ses"

b

string

c

type of TYPO3 session (optional): "ses" for browser based session (default), "user" for FE user based session

Returns:

a

Returns:

b

mixed

c

associated value from session

((Unknown Property))

a

b

@global array $GLOBALS['TSFE']

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-05

function sessionSaveArray($a_data, $type="ses")

Saves an array *immediately* to TYPO3 session (with session keys equal to array keys)

$a_data

a

$a_data

b

string

c

array to save (session keys will be equal to array keys)

$type="ses"

a

$type="ses"

b

string

c

type of TYPO3 session (optional): "ses" for browser based session (default), "user" for FE user based session

Returns:

a

Returns:

b

void

c

((Unknown Property))

a

b

@global array $GLOBALS['TSFE']

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-05

function getRecords($table, $sorting=0)

Returns a two-dimensional numbered result array of all active records of a given database helper table.Applicable for database tables following the helper table scheme ('uid' as ID field label and 'title' as entry field label) only.

$table

a

$table

b

string

c

database table name

$sorting=0

a

$sorting=0

b

boolean

c

flag to sort results according to 'sorting' db column if existent (optional, default is false)

Returns:

a

Returns:

b

array

c

two-dimensional numbered result array

((Unknown Property))

a

b

@global array $GLOBALS['TSFE']

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-04

function getRecordTitle($table, $id)

Returns the title of a specified record of a given database helper table.Applicable for database tables following the helper table scheme ('uid' as ID field label and 'title' as entry field label) only.

$table

a

$table

b

string

c

database table name

$id

a

$id

b

integer

c

ID of the requested database record

Returns:

a

Returns:

b

string

c

title of the specified record

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-04

function getRecordUid($table, $title)

Returns the uid of a specified record of a given database helper table.Applicable for database tables following the helper table scheme ('uid' as ID field label and 'title' as entry field label) only.

$table

a

$table

b

string

c

database table name

$title

a

$title

b

string

c

title of the requested database record

Returns:

a

Returns:

b

string

c

uid of the specified record

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-05

function returnLastBuiltSelectQuery($dbObject, $select_fields, $from_table, $where_clause, $groupBy='', $orderBy='', $limit='')

Returns the last built SQL SELECT query with tabs removed.This function tries to retrieve the last built SQL SELECT query from the database object property $this->debug_lastBuiltQuery (works only since T3 3.8.0 with $GLOBALS['TYPO3_DB']->store_lastBuiltQuery = true). If this does not succeed, a fallback method is used (for former versions of class.t3lib_db.php [TYPO3 3.6.0-3.8.0beta1] or $GLOBALS['TYPO3_DB']->store_lastBuiltQuery _not_ set to true) to retrieve the query string from t3lib_db::SELECTquery() - as this is an overhead (t3lib_db::SELECTquery() is called a second time after the call from t3lib_db::exec_SELECT_query) IMO this should not be a permanent solution.

$dbObject

a

$dbObject

b

object

c

TYPO3 database object (instance of t3lib_db) used for last executed SQL query

$select_fields

a

$select_fields

b

string

c

select field name(s) passed to last executed SQL query (see comment of t3lib_db::exec_SELECTquery())

$from_table

a

$from_table

b

string

c

from clause/table name(s) passed to last executed SQL query (see comment of t3lib_db::exec_SELECTquery())

$where_clause

a

$where_clause

b

string

c

where clause passed to last executed SQL query (see comment of t3lib_db::exec_SELECTquery())

$groupBy=''

a

$groupBy=''

b

string

c

(optional) order by clause passed to last executed SQL query (see comment of t3lib_db::exec_SELECTquery())

$orderBy=''

a

$orderBy=''

b

string

c

(optional) group by clause passed to last executed SQL query (see comment of t3lib_db::exec_SELECTquery())

$limit=''

a

$limit=''

b

string

c

(optional) limit clause passed to last executed SQL query (see comment of t3lib_db::exec_SELECTquery())

Returns:

a

Returns:

b

string

c

last built SQL query with tabs removed

((Unknown Property))

a

b

@see class.t3lib_db.php, t3lib_db::exec_SELECTquery()

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2005-04-26

function returnLastBuiltDeleteQuery($dbObject, $from_table, $where_clause)

Returns the last built SQL DELETE query with tabs removed.This function tries to retrieve the last built SQL DELETE query from the database object property $this->debug_lastBuiltQuery (works only since T3 3.8.0 with $GLOBALS['TYPO3_DB']->store_lastBuiltQuery = true). If this does not succeed, a fallback method is used (for former versions of class.t3lib_db.php [TYPO3 3.6.0-3.8.0beta1] or $GLOBALS['TYPO3_DB']->store_lastBuiltQuery _not_ set to true) to retrieve the query string from t3lib_db::DELETEquery() - as this is an overhead (t3lib_db::DELETEquery() is called a second time after the call from t3lib_db::exec_SELECT_query) IMO this should not be a permanent solution.

$dbObject

a

$dbObject

b

object

c

TYPO3 database object (instance of t3lib_db) used for last executed SQL query

$from_table

a

$from_table

b

string

c

from clause/table name passed to last executed SQL query (see comment of t3lib_db::exec_DELETEquery())

$where_clause

a

$where_clause

b

string

c

where clause passed to last executed SQL query (see comment of t3lib_db::exec_DELETEquery())

Returns:

a

Returns:

b

string

c

last built SQL query with tabs removed

((Unknown Property))

a

b

@see class.t3lib_db.php, t3lib_db::exec_DELETEquery()

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2005-11-16

function returnLastBuiltUpdateQuery($dbObject, $table, $where, $updateFieldsArr)

Returns the last built SQL UPDATE query with tabs removed.This function tries to retrieve the last built SQL UPDATE query from the database object property $this->debug_lastBuiltQuery (works only since T3 3.8.0 with $GLOBALS['TYPO3_DB']->store_lastBuiltQuery = true). If this does not succeed, a fallback method is used (for former versions of class.t3lib_db.php [TYPO3 3.6.0-3.8.0beta1] or $GLOBALS['TYPO3_DB']->store_lastBuiltQuery _not_ set to true) to retrieve the query string from t3lib_db::UPDATEquery() - as this is an overhead (t3lib_db::UPDATEquery() is called a second time after the call from t3lib_db::exec_UPDATE_query) IMO this should not be a permanent solution.

$dbObject

a

$dbObject

b

object

c

TYPO3 database object (instance of t3lib_db) used for last executed SQL query

$table

a

$table

b

string

c

table name passed to last executed SQL query (see comment of t3lib_db::exec_UPDATEquery())

$where

a

$where

b

string

c

where clause passed to last executed SQL query (see comment of t3lib_db::exec_UPDATEquery())

$updateFieldsArr

a

$updateFieldsArr

b

array

c

array containing field/value-pairs passed to last executed SQL query (see comment of t3lib_db::exec_UPDATEquery())

Returns:

a

Returns:

b

string

c

last built SQL query with tabs removed

((Unknown Property))

a

b

@see class.t3lib_db.php, t3lib_db::exec_UPDATEquery()

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2005-11-17

function returnLastBuiltInsertQuery($dbObject, $table, $insertFieldsArr)

Returns the last built SQL INSERT query with tabs removed.This function tries to retrieve the last built SQL INSERT query from the database object property $this->debug_lastBuiltQuery (works only since T3 3.8.0 with $GLOBALS['TYPO3_DB']->store_lastBuiltQuery = true). If this does not succeed, a fallback method is used (for former versions of class.t3lib_db.php [TYPO3 3.6.0-3.8.0beta1] or $GLOBALS['TYPO3_DB']->store_lastBuiltQuery _not_ set to true) to retrieve the query string from t3lib_db::INSERTquery() - as this is an overhead (t3lib_db::INSERTquery() is called a second time after the call from t3lib_db::exec_INSERT_query) IMO this should not be a permanent solution.

$dbObject

a

$dbObject

b

object

c

TYPO3 database object (instance of t3lib_db) used for last executed SQL query

$table

a

$table

b

string

c

table name passed to last executed SQL query (see comment of t3lib_db::exec_INSERTquery())

$insertFieldsArr

a

$insertFieldsArr

b

array

c

array containing field/value-pairs passed to last executed SQL query (see comment of t3lib_db::exec_INSERTquery())

Returns:

a

Returns:

b

string

c

last built SQL query with tabs removed

((Unknown Property))

a

b

@see class.t3lib_db.php, t3lib_db::exec_INSERTquery()

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2005-11-17

function dateConv($dateOrig, $reverse=0)

Converts a given date string from euro format to US format or vice versa and returns the converted string

$dateOrig

a

$dateOrig

b

string

c

date string to convert

$reverse=0

a

$reverse=0

b

boolean

c

flag for conversion direction (optional): 0 = converts DD.MM.YYYY (or DD-MM-YYYY) to YYYY-MM-DD (default), 1 = converts YYYY-MM-DD to DD.MM.YYYY

Returns:

a

Returns:

b

string

c

converted date (YYYY-MM-DD by default, if 2. param is set to true DD.MM.YYYY)

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2002-06

function dateToday($euroFormat=0)

Returns the current date

$euroFormat=0

a

$euroFormat=0

b

boolean

c

flag for date format (optional): 0 = YYYY-MM-DD (default), 1 = DD.MM.YYYY

Returns:

a

Returns:

b

string

c

current date (YYYY-MM-DD by default, if 2. param is set to true DD.MM.YYYY)

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2002-10

function htmlOutput($value)

Filters a given value for HTML output on web pages to prevent XSS attacks and similar hacks. Should be used instead of htmlspecialchars() for any output value in FE plugins.

$value

a

$value

b

mixed

c

output value to be filtered (mixed type string/integer/double; use tx_ptlib_base::htmlOutputArray() for arrays)

Returns:

a

Returns:

b

void

c

((Unknown Property))

a

b

@global

((Unknown Property))

a

b

@see tx_ptlib_base::htmlOutputArray()

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2006-05-16

function htmlOutputArray($array, $filterKeys=1)

Filters the elements of a given array for HTML output on web pages to prevent XSS attacks and similar hacks. Should be used instead of htmlspecialchars() for any output array in FE plugins.

$array

a

$array

b

array

c

array with output values to be filtered

$filterKeys=1

a

$filterKeys=1

b

boolean

c

(optional) flag whether the array keys should be filtered, too (default=1). This is useful if the array keys will be used for HTML output, e.g. in selectorboxes.

Returns:

a

Returns:

b

void

c

((Unknown Property))

a

b

@global

((Unknown Property))

a

b

@see tx_ptlib_base::htmlOutput()

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2006-05-16

function formatStringAsDecimal($value)

Returns a given numeric string as a fixed-point decimal number with 2 decimal places(e.g. "10"->"10.00", "10.44"->"10.44")

$value

a

$value

b

string

c

numeric string to convert

Returns:

a

Returns:

b

string

c

numeric string as as a fixed-point decimal number with 2 decimal places

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-06

function convMailOutput($tmp)

Returns a given string read from database converted to be send in an ASCII plain text email

$tmp

a

$tmp

b

string

c

string to convert

Returns:

a

Returns:

b

string

c

converted string with slashes stripped

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-04

function convPost2Screen($tmp)

Returns a given string of a form post converted to be displayed on screen as HTMLRequirements: This method requires the PHP setting 'magic_quotes_gpc' to be set to 'on'(this means all ' (single- quote), " (double quote), (backslash) and NUL's of GPC (Get/Post/Cookie) dataare escaped with a backslash automatically. )

$tmp

a

$tmp

b

string

c

string to convert

Returns:

a

Returns:

b

string

c

converted string

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-06

function convEntry2Screen($tmp)

Returns a given string read from database converted to be displayed on screen as HTMLRequirements: Data send by POST forms has been written unmodified by any user script to database with the PHP setting'magic_quotes_gpc' set to 'on' (this means all ' (single- quote), " (double quote), (backslash) and NUL'sof GPC (Get/Post/Cookie) data has been escaped with a backslash automatically. )

$tmp

a

$tmp

b

string

c

string to convert

Returns:

a

Returns:

b

string

c

converted string

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-06

function convFormInput($tmp)

Returns a given string of a form post converted to be saved in the databaseNotice: this methods originates from my very first TYPO3 extension, which worked with TYPO3s GPvar().Conversion concept has to be reviewed at a later date.

$tmp

a

$tmp

b

string

c

string to convert

Returns:

a

Returns:

b

string

c

converted string with database applicable replaced special chars

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-04

function convScreenOutput($tmp, $isForm=0)

Returns a given string read from database converted to be displayed on screen as HTMLNotice: this methods originates from my very first TYPO3 extension, which worked with TYPO3s GPvar().Conversion concept has to be reviewed at a later date.

$tmp

a

$tmp

b

string

c

string to convert

$isForm=0

a

$isForm=0

b

boolean

c

flag to activate special conversion for HTML form fields: line breaks are not converted to <br /> (optional, default = false)

Returns:

a

Returns:

b

string

c

converted string with special chars as HTML applicable entities

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-04

function prepareDataForDB($a_data)

Returns a given one-dimensional array of strings of a form post converted to be saved in the databaseNotice: doesn't work for multidimensional arrays!

$a_data

a

$a_data

b

array

c

one-dimensional array of strings to convert

Returns:

a

Returns:

b

array

c

one-dimensional array of converted strings

((Unknown Property))

a

b

@see convFormInput()

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-04

function prepareDataForScreen($a_data, $isForm=0)

Returns a given one-dimensional array of strings read from database converted to be displayed on the screen as HTMLNotice: doesn't work for multidimensional arrays!

$a_data

a

$a_data

b

array

c

one-dimensional array of strings to convert

$isForm=0

a

$isForm=0

b

boolean

c

flag to activate special conversion for HTML form fields: line breaks are not converted to <br /> (optional, default = false)

Returns:

a

Returns:

b

array

c

one-dimensional array of converted strings

((Unknown Property))

a

b

@see convScreenOutput()

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-04

function trace($element, $return=0, $marker=NULL)

Prints, returns or logs debugging/tracing information for a given element.

This function analyzes an element's data type and outputs this together with its value/content.Array and object values are displayed itemized as human-readable information.Depending on the global variable $trace, which has to be set at the beginning of each script that uses trace(),tracing output can be configured individually for each script/page: tracing can be switched off,be printed/returned as a string, or be written to a log file (configurable in TYPO3's Constant Editor).

IMPORTANT: Be careful with objects and multidimensional arrays (> 2D): this function is not able todissolve cyclic references. This means the output of an array or an object, that is contained in itself(e.g. $GLOBALS) will never end!

$element

a

$element

b

mixed

c

element to analyse and output its value

$return=0

a

$return=0

b

boolean

c

flag to return output as a string (e.g. to be placed inside a HTML page) instead of printing (optional, default: 0 = print)

$marker=NULL

a

$marker=NULL

b

string

c

marker text to write at beginning and end of trace output (optional)

Returns:

a

Returns:

b

mixed

c

HTML string with element type and element value if $return=0 (default), else void

((Unknown Property))

a

b

@global integer $trace: variable set at each script that uses trace() to control function individually: 0=tracing off, 1=print tracing as HTML strings, 2=log tracing to file

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2002-07 (major revision 2004-09)

function startTraceLog($trace)

OBSOLETE function - integrated in trace() sind v0.5.0 of pt_lib. Kept here in empty state for backwards compatibility of pt_lib.

$trace

a

$trace

b

integer

c

$trace: variable set at each script that uses trace() to control function individually: 0=tracing off, 1=print tracing as HTML strings, 2=log tracing to file

Returns:

a

Returns:

b

void

c

((Unknown Property))

a

b

@see trace()

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-06

lib/class.tx_ptlib_formcheck.php

a

class tx_ptlib_formcheck extends tslib_pibase

Class for frontend use, provides methods for checking input content, usually originating from web forms.This includes several special type checks like text, digits, email, zip and many more)and one method for displaying user information and error messages in a HTML- Messagebox,which can be used for arbitrary output (independent of form checks)

Returns:

a

Returns:

b

[type]

c

...

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de> (thanks to Tino Bickel for spadework and inspiration)

((Unknown Property))

a

b

@since 2003-05

((Unknown Property))

a

b

@package TYPO3

((Unknown Property))

a

b

@subpackage tx_ptlib

function tx_ptlib_formcheck()

Class Constructor: sets properties from Constant Editor configuration

((Unknown Property))

a

b

void

c

Returns:

a

Returns:

b

void

c

((Unknown Property))

a

b

@global array $GLOBALS['TSFE']

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-07

function msgBox($type, $title, $message)

Returns a HTML-Messagebox (displays errors, warnings, infos, questions)The Messagebox (msgbox) uses selectable icons (found in the 'res'directory of this extension), depending on the passed type. It can beused for arbitrary ouptput (independent from form checks).

$type

a

$type

b

string

c

type of required msgbox (allowed types: "error"|"warning"|"question"|"info")

$title

a

$title

b

string

c

title text of msgbox (headline)

$message

a

$message

b

string

c

text message to display

Returns:

a

Returns:

b

string

c

HTML formatted msgbox (or empty string if no message text entered)

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2003-05

function checkResults($a_check)

Returns a HTML formatted error msgbox if errors found in the passed check arrayEvaluates return strings from field check methods (check* methods of this class, see below)passed in an array and returns a HTML formatted error msgbox if errors has been found.

$a_check

a

$a_check

b

array

c

numbered array containing return strings from field check methods

Returns:

a

Returns:

b

mixed

c

string of HTML messagebox if errors are found, else void

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-05

function checkText($input, $fieldTitle, $required=0, $maxLength=NULL)

Text check (general): checks for special chars and string length

$input

a

$input

b

string

c

field input to check (if originated directly from POST-Vars the param's value has to be passed through stripslashes() before - depending on the magic_quotes setting of your PHP installation)

$fieldTitle

a

$fieldTitle

b

string

c

display title of the form field on the web page (used for error descriptions)

$required=0

a

$required=0

b

boolean

c

flag for mandatory field (initiates additional check for empty field, optional)

$maxLength=NULL

a

$maxLength=NULL

b

integer

c

maximum number of chars allowed for input (e.g. for database limitations, optional)

Returns:

a

Returns:

b

string

c

result of field check: error message text on error, else 'OK'

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2003-05

function checkDigit($input, $fieldTitle, $required=0)

Digit check (general): checks for digits only (no decimal points, blanks etc. allowed)

$input

a

$input

b

string

c

field input to check (if originated directly from POST-Vars the param's value has to be passed through stripslashes() before - depending on the magic_quotes setting of your PHP installation)

$fieldTitle

a

$fieldTitle

b

string

c

display title of the form field on the web page (used for error descriptions)

$required=0

a

$required=0

b

boolean

c

flag for mandatory field (initiates additional check for empty field, optional)

Returns:

a

Returns:

b

string

c

result of field check: error message text on error, else 'OK'

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2003-05

function checkTel($input, $fieldTitle, $required=0)

Telecommunication number check: checks phone, fax, mobile phone numbers etc. (some special chars allowed)

$input

a

$input

b

string

c

field input to check (if originated directly from POST-Vars the param's value has to be passed through stripslashes() before - depending on the magic_quotes setting of your PHP installation)

$fieldTitle

a

$fieldTitle

b

string

c

display title of the form field on the web page (used for error descriptions)

$required=0

a

$required=0

b

boolean

c

flag for mandatory field (initiates additional check for empty field, optional)

Returns:

a

Returns:

b

string

c

result of field check: error message text on error, else 'OK'

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2003-05

function checkZip($input, $fieldTitle, $required=0, $minlength=4, $maxlength=5, $minZip=1000)

Zip check: checks content and length of zip number codes

$input

a

$input

b

string

c

field input to check (if originated directly from POST-Vars the param's value has to be passed through stripslashes() before - depending on the magic_quotes setting of your PHP installation)

$fieldTitle

a

$fieldTitle

b

string

c

display title of the form field on the web page (used for error descriptions)

$required=0

a

$required=0

b

boolean

c

flag for mandatory field (initiates additional check for empty field, optional)

$minlength=4

a

$minlength=4

b

integer

c

minimum number of digits allowed for input (optional, default is for Germany)

$maxlength=5

a

$maxlength=5

b

integer

c

maximum number of digits allowed for input (optional, default is for Germany)

$minZip=1000

a

$minZip=1000

b

integer

c

minimum zip number (optional, default is for Germany)

Returns:

a

Returns:

b

string

c

result of field check: error message text on error, else 'OK'

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2003-05

function checkEmail($input, $fieldTitle, $required=0, $mxCheck=0)

Email address check: checks email addresses, optionally by regular expression check or MX check

$input

a

$input

b

string

c

field input to check (if originated directly from POST-Vars the param's value has to be passed through stripslashes() before - depending on the magic_quotes setting of your PHP installation)

$fieldTitle

a

$fieldTitle

b

string

c

display title of the form field on the web page (used for error descriptions)

$required=0

a

$required=0

b

boolean

c

flag for mandatory field (initiates additional check for empty field, optional)

$mxCheck=0

a

$mxCheck=0

b

boolean

c

flag for MX check (optional, default ist regular expression check)

Returns:

a

Returns:

b

string

c

result of field check: error message text on error, else 'OK'

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2003-05

function checkDomain($input, $fieldTitle, $required=0)

Domain check: checks domain part of urls (without subdomain, TLD, points)

$input

a

$input

b

string

c

field input to check (if originated directly from POST-Vars the param's value has to be passed through stripslashes() before - depending on the magic_quotes setting of your PHP installation)

$fieldTitle

a

$fieldTitle

b

string

c

display title of the form field on the web page (used for error descriptions)

$required=0

a

$required=0

b

boolean

c

flag for mandatory field (initiates additional check for empty field, optional)

Returns:

a

Returns:

b

string

c

result of field check: error message text on error, else 'OK'

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2003-05

function checkFtp($input, $fieldTitle, $required=0)

FTP directory check: checks ftp directories for correct chars

$input

a

$input

b

string

c

field input to check (if originated directly from POST-Vars the param's value has to be passed through stripslashes() before - depending on the magic_quotes setting of your PHP installation)

$fieldTitle

a

$fieldTitle

b

string

c

display title of the form field on the web page (used for error descriptions)

$required=0

a

$required=0

b

boolean

c

flag for mandatory field (initiates additional check for empty field, optional)

Returns:

a

Returns:

b

string

c

result of field check: error message text on error, else 'OK'

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2003-05

function checkLogin($input, $fieldTitle, $required=1, $minlength=4, $maxlength=20)

Login (username) check: checks content and length of logins

$input

a

$input

b

string

c

field input to check (if originated directly from POST-Vars the param's value has to be passed through stripslashes() before - depending on the magic_quotes setting of your PHP installation)

$fieldTitle

a

$fieldTitle

b

string

c

display title of the form field on the web page (used for error descriptions)

$required=1

a

$required=1

b

boolean

c

flag for mandatory field (initiates additional check for empty field, optional, default=true)

$minlength=4

a

$minlength=4

b

integer

c

minimum number of chars allowed for input (optional, default is 4)

$maxlength=20

a

$maxlength=20

b

integer

c

maximum number of chars allowed for input (optional, default is 20)

Returns:

a

Returns:

b

string

c

result of field check: error message text on error, else 'OK'

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2003-05

function checkPwd($input, $fieldTitle, $required=1, $minlength=4, $maxlength=20)

Password check: checks content and length of passwords

$input

a

$input

b

string

c

field input to check (if originated directly from POST-Vars the param's value has to be passed through stripslashes() before - depending on the magic_quotes setting of your PHP installation)

$fieldTitle

a

$fieldTitle

b

string

c

display title of the form field on the web page (used for error descriptions)

$required=1

a

$required=1

b

boolean

c

flag for mandatory field (initiates additional check for empty field, optional, default=true)

$minlength=4

a

$minlength=4

b

integer

c

minimum number of chars allowed for input (optional, default is 4)

$maxlength=20

a

$maxlength=20

b

integer

c

maximum number of chars allowed for input (optional, default is 20)

Returns:

a

Returns:

b

string

c

result of field check: error message text on error, else 'OK'

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2003-05

function checkDate($input, $fieldTitle, $required=0, $euroFormat=1)

Date check (general): checks dates for format (yy)yy-mm-dd or dd.mm.(yy)yy

$input

a

$input

b

string

c

field input to check (if originated directly from POST-Vars the param's value has to be passed through stripslashes() before - depending on the magic_quotes setting of your PHP installation)

$fieldTitle

a

$fieldTitle

b

string

c

display title of the form field on the web page (used for error descriptions)

$required=0

a

$required=0

b

boolean

c

flag for mandatory field (initiates additional check for empty field, optional)

$euroFormat=1

a

$euroFormat=1

b

boolean

c

changes required date format from (yy)yy-mm-dd to euro format dd.mm.(yy)yy (optional, default is true)

Returns:

a

Returns:

b

string

c

result of field check: error message text on error, else 'OK'

((Unknown Property))

a

b

@author Ursula Klinger <klinger@punkt.de>, Rainer Kuhn

((Unknown Property))

a

b

@since 2004-05

function checkPulldown($input, $fieldTitle, $noSelectionValue="")

Required pulldown menu (selectorbox) checkChecks if user didn't made a selection in a required pulldown menu with a blank or descriptive first entry

$input

a

$input

b

string

c

field input to check (value from pulldown menu)

$fieldTitle

a

$fieldTitle

b

string

c

display title of the form field on the web page (used for error descriptions)

$noSelectionValue=""

a

$noSelectionValue=""

b

string

c

value of blank or descriptive first entry, submitted if no user selection was made (optional, default is "")

Returns:

a

Returns:

b

string

c

result of field check: error message text on error, else 'OK'

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2004-09-21

lib/class.tx_ptlib_file.php

a

class tx_ptlib_file extends tslib_pibase

Provides a file handling library for punkt.de extensions (pt_*)

Returns:

a

Returns:

b

[type]

c

...

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2005-01

((Unknown Property))

a

b

@package TYPO3

((Unknown Property))

a

b

@subpackage tx_ptlib

function tx_ptlib_file()

Class Constructor: needed for usage of localization features of tslib_pibase

((Unknown Property))

a

b

void

c

Returns:

a

Returns:

b

void

c

((Unknown Property))

a

b

@global void

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2005-01-14

function handleFileUpload(&$errorMsg, $formElemName, $maxSize, $targetDir, $targetFileNameBody='', $allowMime='', $allowExt='', $excludeMime='', $excludeExt='', $overwrite=1)

Handles a PHP file upload and returns the server file path on successOn success the file path of the uploaded file on the server is returned and the reference &$errorMsg contains an empty string.On error an empty string is returned and the reference &$errorMsg contains an error message.If no file has been uploaded an empty string is returned and the reference &$errorMsg contains an empty string, too.

&$errorMsg

a

&$errorMsg

b

string

c

mandatory empty string reference: contains error message if upload does not succeed (no value has to be passed to the function)

$formElemName

a

$formElemName

b

string

c

form element name of the HTML upload input field

$maxSize

a

$maxSize

b

integer

c

maximum file size (same value as used for the HTML hidden input field "MAX_FILE_SIZE")

$targetDir

a

$targetDir

b

string

c

directory path of the target directory where the uploaded file should be moved to (ending slash optional)

$targetFileNameBody=''

a

$targetFileNameBody=''

b

string

c

optional predefined name body (file name excluding name extension) for the uploaded file on the server (default='' => original file name is used)

$allowMime=''

a

$allowMime=''

b

string

c

optional comma separated list of mime types allowed for the file upload (default='' => allows all mime types)

$allowExt=''

a

$allowExt=''

b

string

c

optional comma separated list of file name extensions (without leading dot '.') allowed for the file upload (e.g. 'jpg,gif,png'; default='' => allows all extensions)

$excludeMime=''

a

$excludeMime=''

b

string

c

optional comma separated list of file name extensions (without leading dot '.') allowed for the file upload (e.g. 'jpg,gif,png'; default='' => allows all extensions)

$excludeExt=''

a

$excludeExt=''

b

string

c

optional comma separated list of file name extensions (without leading dot '.') _forbidden_ for the file upload (e.g. 'exe,php,php3,pl,sql'; default='' => excludes no extensions)

$overwrite=1

a

$overwrite=1

b

boolean

c

flag if an existing file should be overwritten (default=1 => existing files will be overwritten)

Returns:

a

Returns:

b

string

c

server file path of the uploaded file on success, else empty string

((Unknown Property))

a

b

@global array $_FILES (PHP internal file upload superglobal array)

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2005-01-11

function getUserUploadDir($parentDir)

Checks existence of/tries to create a FE user specific upload directory, returns directory path on successChecks wether the upload parent directory (passed as param) exists/is writeable and wether a user directory(named with the FE users login username) exists/is writeable. If the user dir is not found, it is tried tocreate one. Returns the user specific directory path on success and empty string on error.

$parentDir

a

$parentDir

b

string

c

path to desired parent directory which should contain the FE user subdirectories (ending slash optional)

Returns:

a

Returns:

b

string

c

user specific directory path for file uploads on success, empty string on error

((Unknown Property))

a

b

@global array $GLOBALS["TSFE"]->fe_user (data of logged-in front end user)

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2005-01-11

lib/class.tx_ptlib_formReloadHandler.php

a

class tx_ptlib_formReloadHandler

Web form reload handler class, based on PHP5 class tx_pttools_formReloadHandler

Returns:

a

Returns:

b

[type]

c

...

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2005-12-01 (adapted for PHP4/pt_lib 2006-12-08)

((Unknown Property))

a

b

@package TYPO3

((Unknown Property))

a

b

@subpackage tx_ptlib

function createToken()

Creates and returns a unique token

((Unknown Property))

a

b

void

c

Returns:

a

Returns:

b

string

c

a 32 character identifier (a 128 bit hex number)

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2005-12-01 (adapted for PHP4/pt_lib 2006-12-08)

function checkToken($token)

Checks if a specified token can be used for a form related action

$token

a

$token

b

string

c

token to check (see tx_ptlib_formReloadHandler::createToken())

Returns:

a

Returns:

b

boolean

c

TRUE if the token can be used (has not been used so far), FALSE if token has been used before

((Unknown Property))

a

b

@global object $GLOBALS['TSFE']: tslib_fe Object

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2005-12-01 (adapted for PHP4/pt_lib 2006-12-08)

function returnTokenHiddenInputTag($tokenInputName='__formToken')

Returns an HTML hidden input form field tag with a newly created token as value

$tokenInputName='__formToken'

a

$tokenInputName='__formToken'

b

string

c

name of the input field, used as HTML 'name' attribute

Returns:

a

Returns:

b

string

c

HTML hidden input form field tag with a newly created token as value

((Unknown Property))

a

b

@author Rainer Kuhn <kuhn@punkt.de>

((Unknown Property))

a

b

@since 2005-12-01 (adapted for PHP4/pt_lib 2006-12-08)

img-4 EXT: punkt.de Library - 16