File/functions.php

Description

This file is part of P4A - PHP For Applications.

P4A is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

P4A is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with Foobar. If not, see <http://www.gnu.org/licenses/agpl.html>.

To contact the authors write to:
CreaLabs SNC
Via Medail, 32
10144 Torino (Italy)
Website: http://www.crealabs.it
E-mail: info@crealabs.it

Functions
P4A_Array2file (line 61)

Converts an array into a "file" value

string P4A_Array2file (array $aFile)
  • array $aFile
P4A_Embedded_Player (line 266)

Return HTML tag containig embedded audio/video player

string P4A_Embedded_Player (string $src, string $mime_type, [string $width = 300], [string $height = 200])
  • string $src: File path
  • string $mime_type
  • string $width
  • string $height
P4A_Error_Handler (line 456)
boolean P4A_Error_Handler (integer $error_number, string $error_string, string $error_file, integer $error_line)
  • integer $error_number
  • string $error_string
  • string $error_file
  • integer $error_line
P4A_Exception_Handler (line 539)
void P4A_Exception_Handler ( $e, Exception $exception)
  • Exception $exception
  • Exception $e
P4A_File2array (line 39)

Converts a "file" value into an array

array P4A_File2array (string $file)
  • string $file
P4A_Filename2File (line 81)

Converts a file path into a "file" format value

string P4A_Filename2File (string $filename, string $uploads_dir)
  • string $filename
  • string $uploads_dir
P4A_Generate_Default_Label (line 378)
string P4A_Generate_Default_Label (string $string)
  • string $string
P4A_Generate_Widget_Layout_Table (line 401)
string P4A_Generate_Widget_Layout_Table ([string $column1 = null], [string $column2 = null], [string $additional_css_classes = null], [string $html_attributes = null])
  • string $column1
  • string $column2
  • string $additional_css_classes
  • string $html_attributes
P4A_Get_File_Extension (line 217)

Returns the extension of the passed file path/url

string P4A_Get_File_Extension (string $url)
  • string $url
P4A_Get_Microtime (line 174)
integer P4A_Get_Microtime ()
P4A_Get_Num_Pages (line 121)

Takes records number, page limit and returns the num of pages

integer P4A_Get_Num_Pages (integer $records_number, integer $page_limit)
  • integer $records_number
  • integer $page_limit
P4A_Get_Offset (line 106)

Takes page number, records number, page limit and returns the necessary offset for a query

integer P4A_Get_Offset (integer $page_number, integer $records_number, integer $page_limit)
  • integer $page_number
  • integer $records_number
  • integer $page_limit
P4A_Get_Unique_File_Name (line 137)

Tests if a file with the same name exists and return the correct file name.

Appends _1 (_2, _3) at the end fo the file name.

string P4A_Get_Unique_File_Name (string $filename, string $directory)
  • string $filename: The filename without path
  • string $directory: The directory (absolute)
P4A_Get_Valid_File_Name (line 164)

Strips "strange" chars from filename

string P4A_Get_Valid_File_Name (string $filename)
  • string $filename
P4A_Highlight_AccessKey (line 388)
string P4A_Highlight_AccessKey (string $string, string $accesskey)
  • string $string
  • string $accesskey
P4A_Include_Objects (line 184)

Includes all p4a objects for the application

void P4A_Include_Objects (string $dir)
  • string $dir
P4A_Is_Browser_Event (line 365)

Can the event be managed by the browser? eg: P4A_Is_Browser_Event('onclick') will return true

boolean P4A_Is_Browser_Event (string $event)
  • string $event
P4A_Is_Extension_Allowed (line 227)

Check if the extension is allowed to be uploaded

boolean P4A_Is_Extension_Allowed (string $extension)
  • string $extension
P4A_Is_Mime_Type_Embeddable (line 247)
boolean P4A_Is_Mime_Type_Embeddable (string $mime_type)
  • string $mime_type
P4A_Mkdir_Recursive (line 423)
boolean P4A_Mkdir_Recursive (string $dir)
  • string $dir
P4A_Output_File (line 656)

creates a temp file and outputs it to the browser (script will die).

The file will be deleted after being transfered to the client.

void P4A_Output_File (string|array $file_content, string $file_name)
  • string|array $file_content
  • string $file_name: file name with extension
P4A_Quote_Javascript_String (line 414)
string P4A_Quote_Javascript_String (string $string)
  • string $string
P4A_Redirect_To_File (line 625)
  • throws: P4A_Exception if the file does not exists in P4A_UPLOADS_DIR
void P4A_Redirect_To_File (string $file)
  • string $file
P4A_Redirect_To_Url (line 603)
void P4A_Redirect_To_Url (string $url)
  • string $url
P4A_Rmdir_Recursive (line 432)
boolean P4A_Rmdir_Recursive (string $dir)
  • string $dir
P4A_Strip_Double_Backslashes (line 349)
void P4A_Strip_Double_Backslashes ( $string)
  • $string
P4A_Strip_Double_Slashes (line 336)
void P4A_Strip_Double_Slashes ( $string)
  • $string
_P4A_Debug_Print_Variable (line 298)

Used for internal debugging (within session browser)

string _P4A_Debug_Print_Variable (mixed $v)
  • mixed $v: Variable to print
__ (line 238)

Returns an i18n translated string (like gettext)

string __ (string $string)
  • string $string: string to be translated

Documentation generated on Mon, 23 Jun 2008 11:44:58 +0200 by phpDocumentor 1.4.2