[ Index ]

PHP Cross Reference of GlotPress

title

Body

[close]

/gp-includes/ -> misc.php (summary)

(no description)

File Size: 308 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 23 functions

  gp_post()
  gp_get()
  gp_array_get()
  gp_const_get()
  gp_const_set()
  gp_member_get()
  gp_array_flatten()
  gp_notice_set()
  gp_notice()
  gp_populate_notices()
  gp_redirect()
  gp_parity_factory()
  gp_limit_for_page()
  _gp_get_secret_key()
  _gp_get_salt()
  gp_salt()
  gp_hash()
  gp_generate_password()
  gp_array_zip()
  gp_array_any()
  gp_array_all()
  gp_error_log_dump()
  gp_object_has_var()

Functions
Functions that are not part of a class:

gp_post( $key, $default = '' )   X-Ref
Retrieves a value from $_POST

param: string $key name of post value
param: mixed $default value to return if $_POST[$key] doesn't exist. Default is ''
return: mixed $_POST[$key] if exists or $default

gp_get( $key, $default = '' )   X-Ref
Retrieves a value from $_GET

param: string $key name of get value
param: mixed $default value to return if $_GET[$key] doesn't exist. Default is ''
return: mixed $_GET[$key] if exists or $default

gp_array_get( $array, $key, $default = '' )   X-Ref
Retrieves a value from $array

param: array $array
param: string $key name of array value
param: mixed $default value to return if $array[$key] doesn't exist. Default is ''
return: mixed $array[$key] if exists or $default

gp_const_get( $name, $default = '' )   X-Ref
No description

gp_const_set( $name, $value )   X-Ref
No description

gp_member_get( $object, $key, $default = '' )   X-Ref
No description

gp_array_flatten( $array )   X-Ref
Makes from an array of arrays a flat array.

param: array $array the arra to flatten
return: array flattenned array

gp_notice_set( $message, $key = 'notice' )   X-Ref
Passes the message set through the next redirect.

Works best for edit requests, which want to pass error message or notice back to the listing page.

param: string $message The message to be passed
param: string $key Optional. Key for the message. You can pass several messages under different keys.

gp_notice( $key = 'notice' )   X-Ref
Retrieves a notice message, set by {@link gp_notice()}

param: string $key Optional. Message key. The default is 'notice'

gp_populate_notices()   X-Ref
No description

gp_redirect( $location, $status = 302 )   X-Ref
Sets headers, which redirect to another page.

param: string $location The path to redirect to
param: int $status Status code to use
return: bool False if $location is not set

gp_parity_factory()   X-Ref
Returns a function, which returns the string "odd" or the string "even" alternatively.


gp_limit_for_page( $page, $per_page )   X-Ref
Builds SQL LIMIT/OFFSET clause for the given page

param: integer $page The page number. The first page is 1.
param: integer $per_page How many items are there in a page

_gp_get_secret_key( $key, $default_key = false )   X-Ref
No description

_gp_get_salt( $constants, $option = false )   X-Ref
No description

gp_salt($scheme = 'auth')   X-Ref
No description

gp_hash( $data, $scheme = 'auth' )   X-Ref
No description

gp_generate_password( $length = 12, $special_chars = true )   X-Ref
Generates a random password drawn from the defined set of characters

return: string the password

gp_array_zip()   X-Ref
Returns an array of arrays, where the i-th array contains the i-th element from
each of the argument arrays. The returned array is truncated in length to the length
of the shortest argument array.

The function works only with numerical arrays.

gp_array_any( $callback, $array )   X-Ref
No description

gp_array_all( $callback, $array )   X-Ref
No description

gp_error_log_dump( $value )   X-Ref
No description

gp_object_has_var( $object, $var_name )   X-Ref
No description



Generated: Thu May 24 03:59:35 2012 Hosted by follow the white rabbit.