Project

General

Profile

Bug #23010 » 14883_v1.diff

Administrator Admin, 2010-06-27 09:36

View differences:

t3lib/class.t3lib_basicfilefunc.php (working copy)
return preg_replace('/\.*$/', '', $cleanFileName);
}
/**
* Formats an integer, $sizeInBytes, to Mb or Kb or just bytes
*
* @param integer Bytes to be formated
* @return string Formatted with M,K or    appended.
* @deprecated since at least TYPO3 4.2 - Use t3lib_div::formatSize() instead
*/
function formatSize($sizeInBytes) {
t3lib_div::logDeprecatedFunction();
if ($sizeInBytes>900) {
if ($sizeInBytes>900000) { // MB
$val = $sizeInBytes/(1024*1024);
return number_format($val, (($val<20)?1:0), '.', '').' M';
} else { // KB
$val = $sizeInBytes/(1024);
return number_format($val, (($val<20)?1:0), '.', '').' K';
}
} else { // Bytes
return $sizeInBytes.'&nbsp;&nbsp;';
}
}
}
t3lib/class.t3lib_befunc.php (working copy)
if (count($rows)) return $rows;
}
}
/**
* Returns a WHERE clause which will make an AND search for the words in the $searchWords array in any of the fields in array $fields.
* Usage: 0
*
* @param array Array of search words
* @param array Array of fields
* @param string Table in which we are searching (for DBAL detection of quoteStr() method)
* @return string WHERE clause for search
* @deprecated since TYPO3 3.6, this function will be removed in TYPO3 4.5, use $GLOBALS['TYPO3_DB']->searchQuery() directly!
*/
public static function searchQuery($searchWords, $fields, $table = '') {
t3lib_div::logDeprecatedFunction();
return $GLOBALS['TYPO3_DB']->searchQuery($searchWords, $fields, $table);
}
/**
* Returns a WHERE clause that can find a value ($value) in a list field ($field)
* For instance a record in the database might contain a list of numbers, "34,234,5" (with no spaces between). This query would be able to select that record based on the value "34", "234" or "5" regardless of their positioni in the list (left, middle or right).
* Is nice to look up list-relations to records or files in TYPO3 database tables.
* Usage: 0
*
* @param string Table field name
* @param string Value to find in list
* @return string WHERE clause for a query
* @deprecated since TYPO3 3.6, this function will be removed in TYPO3 4.5, use $GLOBALS['TYPO3_DB']->listQuery() directly!
*/
public static function listQuery($field, $value) {
t3lib_div::logDeprecatedFunction();
return $GLOBALS['TYPO3_DB']->listQuery($field, $value, '');
}
/**
* Makes an backwards explode on the $str and returns an array with ($table, $uid).
* Example: tt_content_45 => array('tt_content', 45)
* Usage: 1
......
/*******************************************
*
* SQL-related, DEPRECATED functions
* (use t3lib_DB functions instead)
*
*******************************************/
/**
* Returns a SELECT query, selecting fields ($select) from two/three tables joined
* $local_table and $mm_table is mandatory. $foreign_table is optional.
* The JOIN is done with [$local_table].uid <--> [$mm_table].uid_local / [$mm_table].uid_foreign <--> [$foreign_table].uid
* The function is very useful for selecting MM-relations between tables adhering to the MM-format used by TCE (TYPO3 Core Engine). See the section on $TCA in Inside TYPO3 for more details.
*
* @param string Field list for SELECT
* @param string Tablename, local table
* @param string Tablename, relation table
* @param string Tablename, foreign table
* @param string Optional additional WHERE clauses put in the end of the query. DO NOT PUT IN GROUP BY, ORDER BY or LIMIT!
* @param string Optional GROUP BY field(s), if none, supply blank string.
* @param string Optional ORDER BY field(s), if none, supply blank string.
* @param string Optional LIMIT value ([begin,]max), if none, supply blank string.
* @return string Full SQL query
* @deprecated since TYPO3 3.6, this function will be removed in TYPO3 4.5, use $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query() instead since that will return the result pointer while this returns the query. Using this function may make your application less fitted for DBAL later.
* @see t3lib_DB::exec_SELECT_mm_query()
*/
public static function mm_query($select, $local_table, $mm_table, $foreign_table, $whereClause = '', $groupBy = '', $orderBy = '', $limit = '') {
t3lib_div::logDeprecatedFunction();
$query = $GLOBALS['TYPO3_DB']->SELECTquery(
$select,
$local_table.','.$mm_table.($foreign_table?','.$foreign_table:''),
$local_table.'.uid='.$mm_table.'.uid_local'.($foreign_table?' AND '.$foreign_table.'.uid='.$mm_table.'.uid_foreign':'').' '.
$whereClause, // whereClauseMightContainGroupOrderBy
$groupBy,
$orderBy,
$limit
);
return $query;
}
/**
* Creates an INSERT SQL-statement for $table from the array with field/value pairs $fields_values.
* DEPRECATED - $GLOBALS['TYPO3_DB']->INSERTquery() directly instead! But better yet, use $GLOBALS['TYPO3_DB']->exec_INSERTquery()
*
* @param string Table name
* @param array Field values as key=>value pairs.
* @return string Full SQL query for INSERT
* @deprecated since TYPO3 3.6, this function will be removed in TYPO3 4.5, use $GLOBALS['TYPO3_DB']->exec_INSERTquery() directly!
*/
public static function DBcompileInsert($table, $fields_values) {
t3lib_div::logDeprecatedFunction();
return $GLOBALS['TYPO3_DB']->INSERTquery($table, $fields_values);
}
/**
* Creates an UPDATE SQL-statement for $table where $where-clause (typ. 'uid=...') from the array with field/value pairs $fields_values.
* DEPRECATED - $GLOBALS['TYPO3_DB']->UPDATEquery() directly instead! But better yet, use $GLOBALS['TYPO3_DB']->exec_UPDATEquery()
*
* @param string Database tablename
* @param string WHERE clause, eg. "uid=1"
* @param array Field values as key=>value pairs.
* @return string Full SQL query for UPDATE
* @deprecated since TYPO3 3.6, this function will be removed in TYPO3 4.5, use $GLOBALS['TYPO3_DB']->exec_UPDATEquery() directly!
*/
public static function DBcompileUpdate($table, $where, $fields_values) {
t3lib_div::logDeprecatedFunction();
return $GLOBALS['TYPO3_DB']->UPDATEquery($table, $where, $fields_values);
}
/*******************************************
*
* Page tree, TCA related
*
*******************************************/
......
: '';
}
/**
* Returns either title = '' or alt = '' attribute. This depends on the client browser and whether it supports title = '' or not (which is the default)
* If no $content is given only the attribute name is returned.
* The returned attribute with content will have a leading space char.
* Warning: Be careful to submit empty $content var - that will return just the attribute name!
* Usage: 0
*
* @param string String to set as title-attribute. If no $content is given only the attribute name is returned.
* @param boolean If $hsc is set, then content of the attribute is htmlspecialchar()'ed (which is good for XHTML and other reasons...)
* @return string
* @deprecated since TYPO3 3.6, this function will be removed in TYPO3 4.5 - The idea made sense with older browsers, but now all browsers should support the "title" attribute - so just hardcode the title attribute instead!
*/
public static function titleAttrib($content = '', $hsc = 0) {
t3lib_div::logDeprecatedFunction();
global $CLIENT;
$attrib= ($CLIENT['BROWSER']=='net'&&$CLIENT['VERSION']<5)||$CLIENT['BROWSER']=='konqu' ? 'alt' : 'title';
return strcmp($content, '')?' '.$attrib.'="'.($hsc?htmlspecialchars($content):$content).'"' : $attrib;
}
/**
* Returns alt="" and title="" attributes with the value of $content.
* Usage: 7
......
return $itemArray;
}
/**
* Call to update the page tree frame (or something else..?) after
* t3lib_BEfunc::getSetUpdateSignal('updatePageTree') -> will set the page tree to be updated.
* t3lib_BEfunc::getSetUpdateSignal() -> will return some JavaScript that does the update (called in the typo3/template.php file, end() function)
* please use the setUpdateSignal function instead now, as it allows you to add more parameters
* Usage: 11
*
* @param string Whether to set or clear the update signal. When setting, this value contains strings telling WHAT to set. At this point it seems that the value "updatePageTree" is the only one it makes sense to set.
* @return string HTML code (<script> section)
* @see t3lib_BEfunc::getUpdateSignalCode()
* @see t3lib_BEfunc::setUpdateSignal()
* @deprecated since TYPO3 4.2, this function will be removed in TYPO3 4.5, use the setUpdateSignal function instead, as it allows you to add more parameters
*/
public static function getSetUpdateSignal($set = '') {
t3lib_div::logDeprecatedFunction();
// kept for backwards compatibility if $set is empty, use "getUpdateSignalCode()" instead
if ($set) {
return self::setUpdateSignal($set);
} else {
return self::getUpdateSignalCode();
}
}
/**
* Call to update the page tree frame (or something else..?) after
* use 'updatePageTree' as a first parameter will set the page tree to be updated.
......
return $paramArr;
}
/**
* Returns "list of backend modules". Most likely this will be obsolete soon / removed. Don't use.
* Usage: 0
*
* @param array Module names in array. Must be "addslashes()"ed
* @param string Perms clause for SQL query
* @param string Backpath
* @param string The URL/script to jump to (used in A tag)
* @return array Two keys, rows and list
* @internal
* @deprecated since TYPO3 3.6, this function will be removed in TYPO3 4.5.
* @obsolete
*/
public static function getListOfBackendModules($name, $perms_clause, $backPath = '', $script = 'index.php') {
t3lib_div::logDeprecatedFunction();
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'pages', 'doktype!=255 AND module IN (\'' . implode('\',\'', $name) . '\') AND' . $perms_clause . self::deleteClause('pages'));
if (!$GLOBALS['TYPO3_DB']->sql_num_rows($res)) return false;
$out = '';
$theRows = array();
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$theRows[] = $row;
$out.='<span class="nobr"><a href="'.htmlspecialchars($script.'?id='.$row['uid']).'">'.
t3lib_iconWorks::getIconImage('pages', $row, $backPath, 'title="' . htmlspecialchars(self::getRecordPath($row['uid'], $perms_clause, 20)) . '" align="top"') .
htmlspecialchars($row['title']).
'</a></span><br />';
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
return array('rows'=>$theRows, 'list'=>$out);
}
/**
* Returns the name of the backend script relative to the TYPO3 main directory.
*
t3lib/class.t3lib_beuserauth.php (working copy)
parent::start();
}
/**
* If flag is set and the extensions 'beuser_tracking' is loaded, this will insert a table row with the REQUEST_URI of current script - thus tracking the scripts the backend users uses...
* This function works ONLY with the "beuser_tracking" extension and is deprecated since it does nothing useful.
*
* @param boolean Activate insertion of the URL.
* @return void
* @deprecated since TYPO3 3.6, this function will be removed in TYPO3 4.5.
*/
function trackBeUser($flag) {
t3lib_div::logDeprecatedFunction();
if ($flag && t3lib_extMgm::isLoaded('beuser_tracking')) {
$insertFields = array(
'userid' => intval($this->user['uid']),
'tstamp' => $GLOBALS['EXEC_TIME'],
'script' => t3lib_div::getIndpEnv('REQUEST_URI')
);
$GLOBALS['TYPO3_DB']->exec_INSERTquery('sys_trackbeuser', $insertFields);
}
}
/**
* If TYPO3_CONF_VARS['BE']['enabledBeUserIPLock'] is enabled and an IP-list is found in the User TSconfig objString "options.lockToIP", then make an IP comparison with REMOTE_ADDR and return the outcome (true/false)
*
t3lib/class.t3lib_db.php (working copy)
*
**************************************/
/**
* Executes query
* mysql() wrapper function
* Usage count/core: 0
*
* @param string Database name
* @param string Query to execute
* @return pointer Result pointer / DBAL object
* @deprecated since TYPO3 3.6, will be removed in TYPO3 4.5
* @see sql_query()
*/
function sql($db, $query) {
t3lib_div::logDeprecatedFunction();
$res = mysql_query($query, $this->link);
if ($this->debugOutput) {
$this->debug('sql', $query);
}
return $res;
}
/**
* Executes query
* mysql_query() wrapper function
* Usage count/core: 1
*
t3lib/class.t3lib_div.php (working copy)
}
}
/**
* Returns the value of incoming data from globals variable $_POST or $_GET, with priority to $_POST (that is equalent to 'GP' order).
* Strips slashes of string-outputs, but not arrays UNLESS $strip is set. If $strip is set all output will have escaped characters unescaped.
* Usage: 2
*
* @param string GET/POST var to return
* @param boolean If set, values are stripped of return values that are *arrays!* - string/integer values returned are always strip-slashed()
* @return mixed POST var named $var and if not set, the GET var of the same name.
* @deprecated since TYPO3 3.6 - Use t3lib_div::_GP instead (ALWAYS delivers a value with un-escaped values!)
* @see _GP()
*/
public static function GPvar($var,$strip=0) {
self::logDeprecatedFunction();
if(empty($var)) return;
$value = isset($_POST[$var]) ? $_POST[$var] : $_GET[$var];
if (isset($value) && is_string($value)) { $value = stripslashes($value); } // Originally check '&& get_magic_quotes_gpc() ' but the values of $_GET are always slashed regardless of get_magic_quotes_gpc() because HTTP_POST/GET_VARS are run through addSlashesOnArray in the very beginning of index_ts.php eg.
if ($strip && isset($value) && is_array($value)) { self::stripSlashesOnArray($value); }
return $value;
}
/**
* Returns the global arrays $_GET and $_POST merged with $_POST taking precedence.
* Usage: 1
*
* @param string Key (variable name) from GET or POST vars
* @return array Returns the GET vars merged recursively onto the POST vars.
* @deprecated since TYPO3 3.7 - Use t3lib_div::_GPmerged instead
* @see _GP()
*/
public static function GParrayMerged($var) {
self::logDeprecatedFunction();
return self::_GPmerged($var);
}
/**
* Wrapper for the RemoveXSS function.
* Removes potential XSS code from an input string.
*
......
*
*************************/
/**
* Truncates string.
* Returns a new string of max. $chars length.
* If the string is longer, it will be truncated and appended with '...'.
* Usage: 39
*
* @param string string to truncate
* @param integer must be an integer with an absolute value of at least 4. if negative the string is cropped from the right end.
* @param string String to append to the output if it is truncated, default is '...'
* @return string new string
* @deprecated since TYPO3 4.1 - Works ONLY for single-byte charsets! Use t3lib_div::fixed_lgd_cs() instead
* @see fixed_lgd_pre()
*/
public static function fixed_lgd($string,$origChars,$preStr='...') {
self::logDeprecatedFunction();
$chars = abs($origChars);
if ($chars >= 4) {
if(strlen($string)>$chars) {
return $origChars < 0 ?
$preStr.trim(substr($string, -($chars-3))) :
trim(substr($string, 0, $chars-3)).$preStr;
}
}
return $string;
}
/**
* Truncates string.
* Returns a new string of max. $chars length.
* If the string is longer, it will be truncated and prepended with '...'.
* This works like fixed_lgd(), but is truncated in the start of the string instead of the end
* Usage: 6
*
* @param string string to truncate
* @param integer must be an integer of at least 4
* @return string new string
* @deprecated since TYPO3 4.1 - Use either fixed_lgd() or fixed_lgd_cs() (with negative input value for $chars)
* @see fixed_lgd()
*/
public static function fixed_lgd_pre($string,$chars) {
self::logDeprecatedFunction();
return strrev(self::fixed_lgd(strrev($string),$chars));
}
/**
* Truncates a string with appended/prepended "..." and takes current character set into consideration.
* Usage: 75
*
......
}
}
/**
* Breaks up the text for emails
* Usage: 1
*
* @param string The string to break up
* @param string The string to implode the broken lines with (default/typically \n)
* @param integer The line length
* @deprecated since TYPO3 4.1 - Use PHP function wordwrap()
* @return string
*/
public static function breakTextForEmail($str,$implChar=LF,$charWidth=76) {
self::logDeprecatedFunction();
$lines = explode(LF,$str);
$outArr=array();
foreach ($lines as $lStr) {
$outArr[] = self::breakLinesForEmail($lStr,$implChar,$charWidth);
}
return implode(LF,$outArr);
}
/**
* Breaks up a single line of text for emails
* Usage: 5
......
return rtrim($string, ',');
}
/**
* strtoupper which converts danish (and other characters) characters as well
* Usage: 0
*
* @param string String to process
* @return string
* @deprecated since TYPO3 3.5 - Use t3lib_cs::conv_case() instead or for HTML output, wrap your content in <span class="uppercase">...</span>)
* @ignore
*/
public static function danish_strtoupper($string) {
self::logDeprecatedFunction();
$value = strtoupper($string);
return strtr($value, '???????????????', '???????????????');
}
/**
* Change umlaut characters to plain ASCII with normally two character target
* Only known characters will be converted, so don't expect a result for any character.
*
* ? => ae, ? => Oe
*
* @param string String to convert.
* @deprecated since TYPO3 4.1 - Works only for western europe single-byte charsets! Use t3lib_cs::specCharsToASCII() instead!
* @return string
*/
public static function convUmlauts($str) {
self::logDeprecatedFunction();
$pat = array ( '/?/', '/?/', '/?/', '/?/', '/?/', '/?/', '/?/', '/?/', '/?/', '/?/', '/?/', '/?/', '/?/' );
$repl = array ( 'ae', 'Ae', 'oe', 'Oe', 'ue', 'Ue', 'ss', 'aa', 'AA', 'oe', 'OE', 'ae', 'AE' );
return preg_replace($pat,$repl,$str);
}
/**
* Tests if the input is an integer.
* Usage: 77
*
......
return $result;
}
/**
* Remove duplicate values from an array
* Usage: 0
*
* @param array Array of values to make unique
* @return array
* @ignore
* @deprecated since TYPO3 3.5 - Use the PHP function array_unique instead
*/
public static function uniqueArray(array $valueArray) {
self::logDeprecatedFunction();
return array_unique($valueArray);
}
/**
* Removes the value $cmpValue from the $array if found there. Returns the modified array
* Usage: 3
......
return $str;
}
/**
* Creates recursively a JSON literal from a multidimensional associative array.
* Uses native function of PHP >= 5.2.0
*
* @param array $jsonArray: The array to be transformed to JSON
* @return string JSON string
* @deprecated since TYPO3 4.3, use PHP native function json_encode() instead, will be removed in TYPO3 4.5
*/
public static function array2json(array $jsonArray) {
self::logDeprecatedFunction();
return json_encode($jsonArray);
}
/**
* Removes dots "." from end of a key identifier of TypoScript styled array.
* array('key.' => array('property.' => 'value')) --> array('key' => array('property' => 'value'))
*
......
return implode(' ',$list);
}
/**
* Implodes attributes in the array $arr for an attribute list in eg. and HTML tag (with quotes)
*
* @param array See implodeAttributes()
* @param boolean See implodeAttributes()
* @param boolean See implodeAttributes()
* @return string See implodeAttributes()
* @deprecated since TYPO3 3.7 - Name was changed into implodeAttributes
* @see implodeAttributes()
*/
public static function implodeParams(array $arr,$xhtmlSafe=FALSE,$dontOmitBlankAttribs=FALSE) {
self::logDeprecatedFunction();
return self::implodeAttributes($arr,$xhtmlSafe,$dontOmitBlankAttribs);
}
/**
* Wraps JavaScript code XHTML ready with <script>-tags
* Automatic re-identing of the JS code is done by using the first line as ident reference.
......
return $instance;
}
/**
* Return classname for new instance
* Takes the class-extensions API of TYPO3 into account
* Usage: 17
*
* @param string Base Class name to evaluate
* @return string Final class name to instantiate with "new [classname]"
* @deprecated since TYPO3 4.3 - Use t3lib_div::makeInstance('myClass', $arg1, $arg2, ..., $argN)
*/
public static function makeInstanceClassName($className) {
self::logDeprecatedFunction();
return (class_exists($className) && class_exists('ux_'.$className, false) ? self::makeInstanceClassName('ux_' . $className) : $className);
}
/**
* Returns the class name for a new instance, taking into account the
* class-extension API.
t3lib/class.t3lib_install.php (working copy)
return $content;
}
/**
* Reads the field definitions for the input SQL-file string
*
* @param string Should be a string read from an SQL-file made with 'mysqldump [database_name] -d'
* @return array Array with information about table.
* @deprecated since TYPO3 4.2, this function will be removed in TYPO3 4.5, use ->getFieldDefinitions_fileContent() instead!
*/
function getFieldDefinitions_sqlContent($fileContent) {
t3lib_div::logDeprecatedFunction();
return $this->getFieldDefinitions_fileContent($fileContent);
}
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_install.php']) {
t3lib/class.t3lib_matchcondition.php (working copy)
var $altRootLine=array();
var $hookObjectsArr = array();
/**
* Constructor for this class
*
* @return void
* @deprecated since TYPO3 4.3, will be removed in TYPO3 4.5 - The functionality was moved to t3lib_matchCondition_frontend
*/
function __construct() {
t3lib_div::logDeprecatedFunction();
parent::__construct();
}
/**
* Matching TS condition
*
......
return parent::getBrowserInfo($useragent);
}
/**
* Returns the version of a browser; Basically getting doubleval() of the input string, stripping of any non-numeric values in the beginning of the string first.
*
* @param string A string with version number, eg. "/7.32 blablabla"
* @return double Returns double value, eg. "7.32"
* @deprecated since TYPO3 4.3 - use t3lib_utility_Client::getVersion() instead
*/
function browserInfo_version($tmp) {
t3lib_div::logDeprecatedFunction();
return t3lib_utility_Client::getVersion($tmp);
}
/**
* Return global variable where the input string $var defines array keys separated by "|"
t3lib/class.t3lib_stdgraphic.php (working copy)
}
/**
* Writes the input GDlib image pointer to file. Now just a wrapper to ImageWrite.
*
* @param pointer The GDlib image resource pointer
* @param string The filename to write to
* @return mixed The output of either imageGif, imagePng or imageJpeg based on the filename to write
* @see imageWrite()
* @deprecated since TYPO3 4.0, this function will be removed in TYPO3 4.5.
*/
function imageGif($destImg, $theImage) {
t3lib_div::logDeprecatedFunction();
return $this->imageWrite($destImg, $theImage);
}
/**
* This function has been renamed and only exists for providing backwards compatibility.
* Please use $this->imageCreateFromFile() instead.
*
* @param string Image filename
* @return pointer Image Resource pointer
* @deprecated since TYPO3 4.0, this function will be removed in TYPO3 4.5.
*/
function imageCreateFromGif($sourceImg) {
t3lib_div::logDeprecatedFunction();
return $this->imageCreateFromFile($sourceImg);
}
/**
* Creates a new GDlib image resource based on the input image filename.
* If it fails creating a image from the input file a blank gray image with the dimensions of the input image will be created instead.
*
t3lib/class.t3lib_tceforms.php (working copy)
return 'document.'.$this->formName."['".$itemName."']";
}
/**
* Returns the "No title" string if the input $str is empty.
*
* DEPRECATED: Use t3lib_BEfunc::getRecordTitle with the $forceResult flag set.
*
* @param string The string which - if empty - will become the no-title string.
* @param array Array with wrappin parts for the no-title output (in keys [0]/[1])
* @return string
* @deprecated since TYPO3 4.1, this function will be removed in TYPO3 4.5.
*/
function noTitle($str,$wrapParts=array()) {
t3lib_div::logDeprecatedFunction();
return strcmp($str,'') ? $str : $wrapParts[0].'['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.no_title').']'.$wrapParts[1];
}
/**
* Returns 'this.blur();' string, if supported.
*
t3lib/class.t3lib_tceforms_inline.php (working copy)
/**
* Creates a link/button to create new records
*
* @param string $objectPrefix: The "path" to the child record to create (e.g. 'data-parentPageId-partenTable-parentUid-parentField-childTable')
* @param array $conf: TCA configuration of the parent(!) field
* @return string The HTML code for the new record link
* @deprecated since TYPO3 4.2.0-beta1, this function will be removed in TYPO3 4.5.
*/
function getNewRecordLink($objectPrefix, $conf = array()) {
t3lib_div::logDeprecatedFunction();
return $this->getLevelInteractionLink('newRecord', $objectPrefix, $conf);
}
/**
* Add Sortable functionality using script.acolo.us "Sortable".
*
* @param string $objectId: The container id of the object - elements inside will be sortable
......
/**
* Initialize environment for AJAX calls
*
* @param string $method: Name of the method to be called
* @param array $arguments: Arguments to be delivered to the method
* @return void
* @deprecated since TYPO3 4.2.0-alpha3, this function will be removed in TYPO3 4.5.
*/
function initForAJAX($method, &$arguments) {
t3lib_div::logDeprecatedFunction();
// Set t3lib_TCEforms::$RTEcounter to the given value:
if ($method == 'createNewRecord') {
$this->fObj->RTEcounter = intval(array_shift($arguments));
}
}
/**
* Generates an error message that transferred as JSON for AJAX calls
*
* @param string $message: The error message to be shown
......
/**
* Creates recursively a JSON literal from a mulidimensional associative array.
* Uses Services_JSON (http://mike.teczno.com/JSON/doc/)
*
* @param array $jsonArray: The array (or part of) to be transformed to JSON
* @return string If $level>0: part of JSON literal; if $level==0: whole JSON literal wrapped with <script> tags
* @deprecated Since TYPO3 4.2: Moved to t3lib_div::array2json, will be removed in TYPO3 4.4
*/
function getJSON($jsonArray) {
t3lib_div::logDeprecatedFunction();
return json_encode($jsonArray);
}
/**
* Checks if a uid of a child table is in the inline view settings.
*
* @param string $table: Name of the child table
t3lib/class.t3lib_timetrack.php (working copy)
$this->tsStackPointer--;
}
/**
* Returns the current time in milliseconds
*
* @return integer
* @deprecated since TYPO3 4.3, this function will be removed in TYPO3 4.5, use getDifferenceToStarttime() instead
*/
protected function mtime() {
t3lib_div::logDeprecatedFunction();
return $this->getDifferenceToStarttime();
}
/**
* Returns microtime input to milliseconds
*
* @param string PHP microtime string
* @return integer
* @deprecated since TYPO3 4.3, this function will be removed in TYPO3 4.5, use getMilliseconds() instead that expects microtime as float instead of a string
*/
public function convertMicrotime($microtime) {
t3lib_div::logDeprecatedFunction();
$parts = explode(' ',$microtime);
return round(($parts[0]+$parts[1])*1000);
}
/**
* Gets a microtime value as milliseconds value.
*
* @param float $microtime: The microtime value - if not set the current time is used
t3lib/class.t3lib_tstemplate.php (working copy)
return $outFile;
}
/**
* CheckFile runs through the $menuArr and checks every file-reference in $name
* (Not used anywhere)
*
* @param string Property name in the menu array
* @param array Menu array to traverse
* @return array Modified menu array
* @deprecated since TYPO3 3.6, this function will be removed in TYPO3 4.5.
* @internal
*/
function checkFile($name,$menuArr) {
t3lib_div::logDeprecatedFunction();
foreach ($menuArr as $aKey => $value) {
$menuArr[$aKey][$name] = $this->getFileName($menuArr[$aKey][$name]);
}
return $menuArr;
}
/**
* Compiles the content for the page <title> tag.
*
t3lib/core_autoload.php (working copy)
return array(
'gzip_encode' => PATH_t3lib . 'class.gzip_encode.php',
't3lib_admin' => PATH_t3lib . 'class.t3lib_admin.php',
't3lib_ajax' => PATH_t3lib . 'class.t3lib_ajax.php',
't3lib_arraybrowser' => PATH_t3lib . 'class.t3lib_arraybrowser.php',
typo3/class.db_list_extra.inc (working copy)
}
}
/**
* Write sys_refindex entries for current record to $this->references
*
* @param string Table name
* @param integer Uid of current record
* @return void
*
* @deprecated since 4.4: Use getReferenceCount instead
*/
function setReferences($table, $uid) {
t3lib_div::logDeprecatedFunction();
$rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
'tablename, recuid, field',
'sys_refindex',
'ref_table='.$GLOBALS['TYPO3_DB']->fullQuoteStr($table,'sys_refindex').
' AND ref_uid='.intval($uid).
' AND deleted=0'
);
$this->references = $rows;
}
/**
* Gets the number of records referencing the record with the UID $uid in
* the table $tableName.
*
......
<div class="typo3-clipCtrl">'.implode('',$cells).'</div>';
}
/**
* Make reference count
*
* @param string Table name
* @param integer UID of record
* @return string HTML-table
*
* @deprecated since 4.4: Use getReferenceHTML() instead
*/
function makeRef($table,$uid) {
t3lib_div::logDeprecatedFunction();
// Compile information for title tag:
$infoData=array();
if (is_array($this->references)) {
foreach ($this->references as $row) {
$infoData[]=$row['tablename'].':'.$row['recuid'].':'.$row['field'];
}
}
return count($infoData) ? '<a href="#" onclick="'.htmlspecialchars('top.launchView(\''.$table.'\', \''.$uid.'\'); return false;').'" title="'.htmlspecialchars(t3lib_div::fixed_lgd_cs(implode(' / ',$infoData),100)).'">'.count($infoData).'</a>' : '';
}
/**
* Creates the HTML for a reference count for the record with the UID $uid
* in the table $tableName.
typo3/index.php (working copy)
return $output;
}
/**
* Outputs an empty string. This function is obsolete and kept for the
* compatibility only.
*
* @param string $unused Unused
* @return string HTML output
* @deprecated since TYPO3 4.3, all the functionality was put in $this->startForm() and $this->addFields_hidden
*/
function getHiddenFields($unused = '') {
t3lib_div::logDeprecatedFunction();
return '';
}
/**
* Creates JavaScript for the login form
typo3/mod/tools/em/class.nusoap.php (working copy)
"</SOAP-ENV:Envelope>";
}
/**
* formats a string to be inserted into an HTML stream
*
* @param string $str The string to format
* @return string The formatted string
* @access public
* @deprecated since at least TYPO3 4.3, will be removed in TYPO3 4.5
*/
function formatDump($str){
t3lib_div::logDeprecatedFunction();
$str = htmlspecialchars($str);
return nl2br($str);
}
/**
* contracts (changes namespace to prefix) a qualified name
*
......
}
}
/**
* sleeps some number of microseconds
*
* @param string $usec the number of microseconds to sleep
* @access public
* @deprecated since at least TYPO3 4.3, will be removed in TYPO3 4.5.
*/
function usleepWindows($usec)
{
t3lib_div::logDeprecatedFunction();
$start = gettimeofday();
do
{
$stop = gettimeofday();
$timePassed = 1000000 * ($stop['sec'] - $start['sec'])
+ $stop['usec'] - $start['usec'];
}
while ($timePassed < $usec);
}
/**
* Contains information for a SOAP fault.
* Mainly used for returning faults from deployed functions
......
$this->debug('<' . $this->schemaTargetNamespace . '> '.$string);
}
/**
* get the PHP type of a user defined type in the schema
* PHP type is kind of a misnomer since it actually returns 'struct' for assoc. arrays
* returns false if no type exists, or not w/ the given namespace
* else returns a string that is either a native php type, or 'struct'
*
* @param string $type, name of defined type
* @param string $ns, namespace of type
* @return mixed
* @access public
* @deprecated since at least TYPO3 4.3, will be removed in TYPO3 4.5.
*/
function getPHPType($type,$ns){
t3lib_div::logDeprecatedFunction();
if(isset($this->typemap[$ns][$type])){
//print "found type '$type' and ns $ns in typemap<br>";
return $this->typemap[$ns][$type];
} elseif(isset($this->complexTypes[$type])){
//print "getting type '$type' and ns $ns from complexTypes array<br>";
return $this->complexTypes[$type]['phpType'];
}
return false;
}
/**
* returns an associative array of information about a given type
* returns false if no type exists by the given name
......
return false;
}
/**
* returns a sample serialization of a given type, or false if no type by the given name
*
* @param string $type, name of type
* @return mixed
* @access public
* @deprecated since at least TYPO3 4.3, will be removed in TYPO3 4.5.
*/
function serializeTypeDef($type){
t3lib_div::logDeprecatedFunction();
//print "in sTD() for type $type<br>";
if($typeDef = $this->getTypeDef($type)){
$str .= '<'.$type;
if(is_array($typeDef['attrs'])){
foreach($attrs as $attName => $data){
$str .= " $attName=\"{type = ".$data['type']."}\"";
}
}
$str .= " xmlns=\"".$this->schema['targetNamespace']."\"";
if(count($typeDef['elements']) > 0){
$str .= ">";
foreach($typeDef['elements'] as $element => $eData){
$str .= $this->serializeTypeDef($element);
}
$str .= "</$type>";
} elseif($typeDef['typeClass'] == 'element') {
$str .= "></$type>";
} else {
$str .= "/>";
}
return $str;
}
return false;
}
/**
* returns HTML form elements that allow a user
* to enter values for creating an instance of the given type.
*
* @param string $name, name for type instance
* @param string $type, name of type
* @return string
* @access public
* @deprecated since at least TYPO3 4.3, will be removed in TYPO3 4.5.
*/
function typeToForm($name,$type){
t3lib_div::logDeprecatedFunction();
// get typedef
if($typeDef = $this->getTypeDef($type)){
// if struct
if($typeDef['phpType'] == 'struct'){
$buffer .= '<table>';
foreach($typeDef['elements'] as $child => $childDef){
$buffer .= "
<tr><td align='right'>$childDef[name] (type: ".$this->getLocalPart($childDef['type'])."):</td>
<td><input type='text' name='parameters[".$name."][$childDef[name]]'></td></tr>";
}
$buffer .= '</table>';
// if array
} elseif($typeDef['phpType'] == 'array'){
$buffer .= '<table>';
for($i=0;$i < 3; $i++){
$buffer .= "
<tr><td align='right'>array item (type: $typeDef[arrayType]):</td>
<td><input type='text' name='parameters[".$name."][]'></td></tr>";
}
$buffer .= '</table>';
// if scalar
} else {
$buffer .= "<input type='text' name='parameters[$name]'>";
}
} else {
$buffer .= "<input type='text' name='parameters[$name]'>";
}
return $buffer;
}
/**
* adds a complex type to the schema
*
......
}
}
/**
* decode a string that is encoded w/ "chunked' transfer encoding
* as defined in RFC2068 19.4.6
*
* @param string $buffer
* @param string $lb
* @returns string
* @access public
* @deprecated since at least TYPO3 4.3, will be removed in TYPO3 4.5.
*/
function decodeChunked($buffer, $lb){
t3lib_div::logDeprecatedFunction();
// length := 0
$length = 0;
$new = '';
// read chunk-size, chunk-extension (if any) and CRLF
// get the position of the linebreak
$chunkend = strpos($buffer, $lb);
if ($chunkend == FALSE) {
$this->debug('no linebreak found in decodeChunked');
return $new;
}
$temp = substr($buffer,0,$chunkend);
$chunk_size = hexdec( trim($temp) );
$chunkstart = $chunkend + strlen($lb);
// while (chunk-size > 0) {
while ($chunk_size > 0) {
$this->debug("chunkstart: $chunkstart chunk_size: $chunk_size");
$chunkend = strpos( $buffer, $lb, $chunkstart + $chunk_size);
// Just in case we got a broken connection
if ($chunkend == FALSE) {
$chunk = substr($buffer,$chunkstart);
// append chunk-data to entity-body
$new .= $chunk;
$length += strlen($chunk);
break;
}
// read chunk-data and CRLF
$chunk = substr($buffer,$chunkstart,$chunkend-$chunkstart);
// append chunk-data to entity-body
$new .= $chunk;
// length := length + chunk-size
$length += strlen($chunk);
// read chunk-size and CRLF
$chunkstart = $chunkend + strlen($lb);
$chunkend = strpos($buffer, $lb, $chunkstart) + strlen($lb);
if ($chunkend == FALSE) {
break; //Just in case we got a broken connection
}
$temp = substr($buffer,$chunkstart,$chunkend-$chunkstart);
$chunk_size = hexdec( trim($temp) );
$chunkstart = $chunkend;
}
return $new;
}
/*
* Writes payload, including HTTP headers, to $this->outgoing_payload.
*/
......
return $xml;
}
/**
* serialize a PHP value according to a WSDL message definition
*
* TODO
* - multi-ref serialization
* - validate PHP values against type definitions, return errors if invalid
*
* @param string $ type name
* @param mixed $ param value
* @return mixed new param or false if initial value didn't validate
* @access public
* @deprecated since at least TYPO3 4.3, will be removed in TYPO3 4.5.
*/
function serializeParameters($operation, $direction, $parameters)
{
t3lib_div::logDeprecatedFunction();
$this->debug("in serializeParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion");
$this->appendDebug('parameters=' . $this->varDump($parameters));
if ($direction != 'input' && $direction != 'output') {
$this->debug('The value of the \$direction argument needs to be either "input" or "output"');
$this->setError('The value of the \$direction argument needs to be either "input" or "output"');
return false;
}
if (!$opData = $this->getOperationData($operation)) {
$this->debug('Unable to retrieve WSDL data for operation: ' . $operation);
$this->setError('Unable to retrieve WSDL data for operation: ' . $operation);
return false;
}
$this->debug('opData:');
$this->appendDebug($this->varDump($opData));
// Get encoding style for output and set to current
$encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
$encodingStyle = $opData['output']['encodingStyle'];
$enc_style = $encodingStyle;
}
// set input params
$xml = '';
if (isset($opData[$direction]['parts']) && sizeof($opData[$direction]['parts']) > 0) {
$use = $opData[$direction]['use'];
$this->debug("use=$use");
$this->debug('got ' . count($opData[$direction]['parts']) . ' part(s)');
if (is_array($parameters)) {
$parametersArrayType = $this->isArraySimpleOrStruct($parameters);
$this->debug('have ' . $parametersArrayType . ' parameters');
foreach($opData[$direction]['parts'] as $name => $type) {
$this->debug('serializing part "'.$name.'" of type "'.$type.'"');
// Track encoding style
if(isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) {
$encodingStyle = $opData[$direction]['encodingStyle'];
$enc_style = $encodingStyle;
} else {
$enc_style = false;
}
// NOTE: add error handling here
// if serializeType returns false, then catch global error and fault
if ($parametersArrayType == 'arraySimple') {
$p = array_shift($parameters);
$this->debug('calling serializeType w/indexed param');
$xml .= $this->serializeType($name, $type, $p, $use, $enc_style);
} elseif (isset($parameters[$name])) {
$this->debug('calling serializeType w/named param');
$xml .= $this->serializeType($name, $type, $parameters[$name], $use, $enc_style);
} else {
// TODO: only send nillable
$this->debug('calling serializeType w/null param');
$xml .= $this->serializeType($name, $type, null, $use, $enc_style);
}
}
} else {
$this->debug('no parameters passed.');
}
}
$this->debug("serializeParameters returning: $xml");
return $xml;
}
/**
* serializes a PHP value according a given type definition
*
* @param string $name name of value (part or element)
......
$this->persistentConnection = true;
}
/**
* gets the default RPC parameter setting.
* If true, default is that call params are like RPC even for document style.
* Each call() can override this value.
*
* This is no longer used.
*
* @return boolean
* @access public
* @deprecated since at least TYPO3 4.3, will be removed in TYPO3 4.5.
*/
function getDefaultRpcParams() {
t3lib_div::logDeprecatedFunction();
return $this->defaultRpcParams;
}
/**
* sets the default RPC parameter setting.
* If true, default is that call params are like RPC even for document style
* Each call() can override this value.
*
* This is no longer used.
*
* @param boolean $rpcParams
* @access public
* @deprecated since at least TYPO3 4.3, will be removed in TYPO3 4.5.
*/
function setDefaultRpcParams($rpcParams) {
t3lib_div::logDeprecatedFunction();
$this->defaultRpcParams = $rpcParams;
}
/**
* dynamically creates an instance of a proxy class,
* allowing user to directly call methods from wsdl
*
typo3/sysext/cms/layout/class.tx_cms_layout.php (working copy)
}
}
/**
* Returns an icon, which has its title attribute set to a massive amount of information about the element.
*
* @param array Array where values are human readable output of field values (not htmlspecialchars()'ed though). The values are imploded by a linebreak.
* @return string HTML img tag if applicable.
* @deprecated since TYPO3 4.4, this function will be removed in TYPO3 4.6
*/
function infoGif($infoArr) {
t3lib_div::logDeprecatedFunction();
if (count($infoArr) && $this->tt_contentConfig['showInfo']) {
return t3lib_iconWorks::getSpriteIcon('actions-document-info', array('title' => htmlspecialchars(implode(LF, $infoArr))));
}
}
/**
* Creates onclick-attribute content for a new content element
*
typo3/sysext/cms/tslib/class.tslib_content.php (working copy)
return $newVal;
}
/**
* Formats a number to GB, Mb or Kb or just bytes
*
* @param integer Number of bytes to format.
* @param string Labels for bytes, kilo, mega and giga separated by vertical bar (|) and possibly encapsulated in "". Eg: " | K| M| G" (which is the default value)
* @return string
* @see t3lib_div::formatSize(), stdWrap()
* @deprecated since TYPO3 3.6 - Use t3lib_div::formatSize() instead
*/
function bytes($sizeInBytes,$labels) {
t3lib_div::logDeprecatedFunction();
return t3lib_div::formatSize($sizeInBytes,$labels);
}
/**
* Returns the 'age' of the tstamp $seconds
*
......
}
}
/**
* Checking syntax of input email address
*
* @param string Input string to evaluate
* @return boolean Returns true if the $email address (input string) is valid; Has a "@", domain name with at least one period and only allowed a-z characters.
* @see t3lib_div::validEmail()
* @deprecated since TYPO3 3.6 - Use t3lib_div::validEmail() instead
*/
function checkEmail($email) {
t3lib_div::logDeprecatedFunction();
return t3lib_div::validEmail($email);
}
/**
* Clears TypoScript properties listed in $propList from the input TypoScript array.
*
typo3/sysext/cms/tslib/class.tslib_fe.php (working copy)
}
}
/**
* Connect to MySQL database
* May exit after outputting an error message or some JavaScript redirecting to the install tool.
*
* @return void
* @deprecated since TYPO3 3.8, this function will be removed in TYPO3 4.5, use connectToDB() instead!
*/
function connectToMySQL() {
t3lib_div::logDeprecatedFunction();
$this->connectToDB();
}
/**
* Connect to SQL database
* May exit after outputting an error message or some JavaScript redirecting to the install tool.
......
}
}
/**
* Processes a query-string with GET-parameters and returns two strings, one with the parameters that CAN be encoded and one array with those which can't be encoded (encoded by the M5 or B6 methods)
*
* @param string Query string to analyse
* @return array Two num keys returned, first is the parameters that MAY be encoded, second is the non-encodable parameters.
* @see makeSimulFileName(), t3lib_tstemplate::linkData()
* @deprecated since TYPO3 4.3, will be removed in TYPO3 4.5, please use the "simulatestatic" sysext directly
*/
function simulateStaticDocuments_pEnc_onlyP_proc($linkVars) {
t3lib_div::logDeprecatedFunction();
if (t3lib_extMgm::isLoaded('simulatestatic')) {
return t3lib_div::callUserFunction(
'EXT:simulatestatic/class.tx_simulatestatic.php:&tx_simulatestatic->processEncodedQueryString',
$linkVars,
$this
);
} else {
return false;
}
}
/**
* Returns the simulated static file name (*.html) for the current page (using the page record in $this->page)
*
* @return string The filename (without path)
* @see makeSimulFileName(), publish.php
* @deprecated since TYPO3 4.3, will be removed in TYPO3 4.5, please use the "simulatestatic" sysext directly
* @todo Deprecated but still used in the Core!
*/
function getSimulFileName() {
return $this->makeSimulFileName(
$this->page['title'],
($this->page['alias'] ? $this->page['alias'] : $this->id),
$this->type
) . '.html';
}
/**
* Checks and sets replacement character for simulateStaticDocuments. Default is underscore.
*
* @return void
* @deprecated since TYPO3 4.3, will be removed in TYPO3 4.5, please use the "simulatestatic" sysext directly
*/
function setSimulReplacementChar() {
t3lib_div::logDeprecatedFunction();
... This diff was truncated because it exceeds the maximum size that can be displayed.
(1-1/2)