Transaction Engine 3 Application Programming Interface
[ class tree: Transaction Engine 3 Application Programming Interface ] [ index: Transaction Engine 3 Application Programming Interface ] [ all elements ]

Procedural File: KT_functions.inc.php

Source Location: /common/KT_functions.inc.php



Page Details:









KT_addReplaceParam [line 311]

string KT_addReplaceParam( string $qstring, string $paramName, [string $paramValue = null])

Adding or replacing a param/value in the string.



Tags:

return:  return the URL (ex. ?myvar=myvalue&myvar2=a or ?myvar2=v );


Parameters

string   $qstring   the query string wich will be the subject (ex. ?myvar=1&myvar2=a or myvar=3&myvar2=v);
string   $paramName   the name of the variable wich will be strip from or will have a new value (ex. myvar or othervar);
string   $paramValue   if is not null this will be the value of the $paramName, if not the $paramName will be strip off (ex. myvalue or null);
[ Top ]



KT_applyDate2rule [line 988]

array KT_applyDate2rule( string $date, array $rule)

Splits a date into a chunked representation;



Tags:

return:  the date in a chunked form, containig yyyy, mm, dd, HH, ii and ss;


Parameters

string   $date   The date to be precessed;
array   $rule   Associative array containing the date chunks order ('y'=> 1, 'm' => 3, etc);
[ Top ]



KT_applyOutRule2date [line 1071]

string KT_applyOutRule2date( array &$dateArr, array &$formatRule, string &$outStringRule)

Processes a date array in a usable format;



Tags:

return:  the date in the $outStringRule format;


Parameters

array   $dateArr   Associative array containing date chunks ('y'=>'2004', 'm'=>'5', etc.);
array   $formatRule   Associative array containing the output date formatting rules ('y'=> 2 chars, 'm' => 1 char, etc);
string   $outStringRule   Defines the output date format;
[ Top ]



KT_CanonizeRelPath [line 118]

string KT_CanonizeRelPath( string $relPath)

Try to canonize a path (replace ../ and ./ );



Tags:

return:  return the canonized path;


Parameters

string   $relPath   the path to be canonize;
[ Top ]



KT_compareDates [line 1246]

integer KT_compareDates( array &$dateArr1, array &$dateArr2)

Compares 2 date arrays



Tags:

return:  -1, 1 or 0


Parameters

array   $dateArr1  
array   $dateArr2  
[ Top ]



KT_convertDate [line 881]

string KT_convertDate( string $date, string $inFmt, string $outFmt)

Converts a date/time/datetime from one format to another



Tags:

return:  the new date


Parameters

string   $date   The date
string   $inFmt   The input format (the format of the input date)
string   $outFmt   The output format (the format of the output date)
[ Top ]



KT_convertDateCall [line 1328]

string KT_convertDateCall( string $date, [string $toScreen = ''])

Wrapper for KT_convertDate

For internal use




Tags:

return:  the date in the new format


Parameters

string   $date   The date in input format
string   $toScreen   if $toScreen == 'toscreen' the date will be outputed in screen format; otherwise in database format
[ Top ]



KT_DynamicData [line 582]

string KT_DynamicData( string $expression, object or $tNG, [string $escapeMethod = ''], [booolean $useSavedData = false], [array $extraParams = array()], [mixed $errorIfNotFound = true])

Function KT_DynamicData replace all the dynamic data with their values;



Tags:

return:  the string with the dynamic data replaced with their values;


Parameters

string   $expression   The expression to be evaluated
string   $escapeMethod   The string escape method for the evaluated values (rawurlencode and SQL)
booolean   $useSavedData   Weather to use the current tNG data or the saved values
array   $extraParams   Extra expression parameters passed when for evaluation (of form $key => $value; any encounter of key will be replaced with its value)
object or   $tNG   null $tNG The tNG context in which the expression is evaluated
[ Top ]



KT_escapeAttribute [line 414]

string KT_escapeAttribute( string $val)

Escape the " > < from a string with the html entities;



Tags:

return:  the escaped value;


Parameters

string   $val   the value to be escaped;
[ Top ]



KT_escapeExpression [line 1424]

string KT_escapeExpression( string $expr)

Escape the expression for \ and ';



Tags:

return:  escaped expression if not null or null;


Parameters

string   $expr   the expression to be escaped;
[ Top ]



KT_escapeFieldName [line 1559]

string KT_escapeFieldName( string $colName)

Escapes a value of a field name to be used in the transaction SQL

Ex: First Name gets translated into `First Name`




Tags:

return:  The escaped field name
access:  public


Parameters

string   $colName   The DataBase field name
[ Top ]



KT_escapeForSql [line 1492]

object unknown KT_escapeForSql( object unknown $colValue, string $colType, [bool $forFakeRs = false])

Escapes a value against a specific type to be used in the transaction SQL

Ex: value=ab'b and type=STRING, result=ab\'b (escapes slashes)




Tags:

return:  The escaped value
access:  public


Parameters

object unknown   $colValue   The value to prepare
string   $colType   The type (STRING_TYPE, NUMERIC_TYPE, etc)
bool   $forFakeRs   if it should return values for an SQL query, or for an fake recordset
[ Top ]



KT_escapeJS [line 424]

string KT_escapeJS( string $val)

Apply addcslashes php function on the argument for the charlist: \t\r\n\'\\ ;



Tags:

return:  the escaped value;


Parameters

string   $val   the value to be escaped;
[ Top ]



KT_expandTime [line 1294]

new KT_expandTime( string $date)

Expands time expressions to full screen format



Tags:

return:  datetime with full time part


Parameters

string   $date   - datetime expression
[ Top ]



KT_format2newDF [line 912]

string KT_format2newDF( string $dateformat)

Convert a date format from an old type date format %Y-%m-%d into new ones;



Tags:

return:  (ex. yyyy-mm-dd);


Parameters

string   $dateformat   the string to be parsed (ex. %Y-%m-%d );
[ Top ]



KT_format2outRule [line 1049]

string KT_format2outRule( string $format)

Removes extra chars from a date format, in order to obtain a parsable definition;



Tags:

return:  (ex. y-m-d);


Parameters

string   $format   The format to be stripped (ex. yyyy-mm-dd);
[ Top ]



KT_format2rule [line 927]

array KT_format2rule( string $format)

Splits a date format into a chunked representation



Tags:

return:  the format in a chunked form (with chunks position and length)


Parameters

string   $format   The format to be precessed
[ Top ]



KT_formatDate [line 1415]

string KT_formatDate( string $date)

Converts a date/time/datetime from database format to screen format

Used for date display




Tags:

return:  the date in screen format


Parameters

string   $date   The date in database format
[ Top ]



KT_formatDate2DB [line 1405]

void KT_formatDate2DB( string $date)

Converts a date/time/datetime from screen format to database format

For internal use




Parameters

string   $date   The date in screen format returns string the date in database format
[ Top ]



KT_FormatForList [line 1440]

string KT_FormatForList( string $value, int $maxChars)

Return a strip string (without html tags and no longer than $maxchars);



Tags:

return:  the last day of the month (ex. 31 );


Parameters

string   $value   the string wich will be parsed;
int   $maxChars   -1 or bigger then 0;
[ Top ]



KT_getDaysOfMonth [line 1211]

string KT_getDaysOfMonth( string $month, int $year)

Return the last day of the given month for the given year;



Tags:

return:  the last day of the month (ex. 31 );


Parameters

string   $month   the month in a numeric format (ex. 01 );
int   $year   the value of the year (ex. 2004)
[ Top ]



KT_getFullUri [line 292]

string KT_getFullUri( )

Return the URL of the page in which the script is called and the query string if exists.



Tags:

return:  return the URL (ex. http://server.com/dir/papa.php?mod=return );


[ Top ]



KT_getInternalTimeFormat [line 1387]

nothing KT_getInternalTimeFormat( )

Converts mm to ii in time formats and sets globals

For internal use maybe must be called from tng?




[ Top ]



KT_getPHP_SELF [line 250]

string KT_getPHP_SELF( )

Return the current page name and the query string if exists.



Tags:

return:  current page and query string (ex. index.php?mod=return );


[ Top ]



KT_getRealValue [line 798]

object unknown KT_getRealValue( string $method, string $reference)

Compiles a method and a reference into a value

Ex: method=GET and reference=test, return value=$_GET['test']




Tags:

return:  The compiled value the return has stripped slashes if necessary
access:  public


Parameters

string   $method   The method (GET, POST, etc)
string   $reference   The reference (variable name)
[ Top ]



KT_getReplacementsFromMessage [line 561]

array KT_getReplacementsFromMessage( string &$string)

Parse the string for values like {...} and return an array with all the conted from {};



Parameters

string   $string   the string to be searched;
[ Top ]



KT_getServerName [line 233]

string KT_getServerName( )

Return the server name on which the page reside.



Tags:

return:  return the server name (ex. http://server.com/ );


[ Top ]



KT_getSiteRoot [line 433]

string KT_getSiteRoot( )

Return the real path of the folder where includes folder resides ;



Tags:

return:  the siteRoot path (ex. var/html/www/mysite/);


[ Top ]



KT_getUri [line 268]

string KT_getUri( )

Return the URL of the page in which the script is called.



Tags:

return:  return the URL (ex. http://server.com/dir/papa.php );


[ Top ]



KT_getUriFolder [line 280]

string KT_getUriFolder( )

Return the folder of the page in which the script is called.



Tags:

return:  return the folder (ex. var/www/html/mysite/admin/ );


[ Top ]



KT_isValidDate [line 1156]

boolean KT_isValidDate( $dateArr &$dateArr, [mixed $fullDateTime = true])

Validates a date array



Tags:

return:  the date is valid or not


Parameters

$dateArr   &$dateArr   the date array
[ Top ]



KT_makeIncludedURL [line 399]

nothing KT_makeIncludedURL( string $url)

Return $GLOBALS['KT_REL_PATH'] in front of the URL if the URL si not absolute and $GLOBALS['KT_REL_PATH'] is setted;



Tags:

return:  (ex. ../../admin/shop/);


Parameters

string   $url   the URL string (ex. admin/shop/);
[ Top ]



KT_pathinfo [line 497]

array KT_pathinfo( string $fileName)

Extracts parts of a file (dirname, basename, filename, extension)



Tags:

return:  returns associative array containing the dirname, basename, filename, extension;


Parameters

string   $fileName   The file name
[ Top ]



KT_realpath [line 522]

string KT_realpath( string $pathName, [boolean $isFolder = true])

Transforms a path into its absolute value

Path separator is always "/" and for folders, always adds the trailing "/" If folder/file does not exist, the "pathName" will be added to the current folder path




Tags:

return:  return the absolute path


Parameters

string   $pathName   The path to be translated
boolean   $isFolder   Specifies if the path is a folder or a file
[ Top ]



KT_redir [line 372]

nothing; KT_redir( string $url)

Make the redirect on server side;



Parameters

string   $url   the URL to which is makeing the redirect;
[ Top ]



KT_Rel2AbsUrl [line 92]

string KT_Rel2AbsUrl( string $pageUrl, string $templateUrl, string $relUrl)

Try to transform a relative path in an absolut one;



Tags:

return:  return the absolute url;


Parameters

string   $pageUrl   the url of the calling script;
string   $templateUrl   the url of the template url;
string   $relUrl   the url to transform in absolute if case;
[ Top ]



KT_SessionKtBack [line 1592]

nothing; KT_SessionKtBack( string $newUrl)

Add the URL to the $_SESSION['KT_backArr'] array if this array not exist; If the array $_SESSION['KT_backArr'] exist check if the last entry is identical with the argument; If this 2 url are identical the old one is replaced with the new one, if not the new one is append it.



Parameters

string   $newUrl   the url to be add to the array;
[ Top ]



KT_session_start [line 444]

nothing; KT_session_start( )

Start the session if it is not started and put in session the values from _SESSION[md5($siteroot)] ;



[ Top ]



KT_setDbType [line 1469]

string KT_setDbType( object $connection)

Set the database type and server model in $GLOBALS and return the database type;



Tags:

return:  the type of the database;


Parameters

object   $connection   the connection object;
[ Top ]



KT_setFilePermissions [line 1627]

boolean KT_setFilePermissions( mixed $fileName, [mixed $isFolder = false])

Set the the permissions for folder/file setted in GLOBALS['KT_folder_mode']/GLOBALS['KT_file_mode'];



Tags:

return:  true is ;


[ Top ]



KT_setServerVariables [line 10]

nothing; KT_setServerVariables( )

Try to set certain _SERVER vars if not setted from _ENV vars;



[ Top ]



KT_setSessionVar [line 465]

nothing; KT_setSessionVar( string $var)

Put in the $_SESSION[$siteroot][$var] key the $_SESSION[$var] value ;



Parameters

string   $var   the name of the variable to be setted from _SESSION[$var] to _SESSION[$siteroot][$var];
[ Top ]



KT_stripslashes [line 785]

nothing; KT_stripslashes( string $value, string $key)

Wrapper for stripslashes; it is used as callbackfunction;



Parameters

string   $value   the string to be searched;
string   $key   the string to be searched;
[ Top ]



KT_stripTime [line 1264]

new KT_stripTime( string $date)

Strips empty values from time expressions



Tags:

return:  datetime without 0's


Parameters

string   $date   - datetime expression
[ Top ]



KT_transformsPaths [line 153]

void KT_transformsPaths( mixed $templateUrl, mixed $text)

Known bugs:

    2. URL contains inside "simple quotes" or 'double quotes' will be removed




    [ Top ]



    KT_unsetSessionVar [line 480]

    nothing; KT_unsetSessionVar( string $var)

    Unset the $_SESSION[$siteroot][$var] and $_SESSION[$var] ;



    Parameters

    string   $var   the name of the variable to be unseted;
    [ Top ]




    Documentation generated on Tue, 6 Dec 2005 15:11:31 +0200 by phpDocumentor 1.3.0RC3