/gp-includes/misc.php

Description
Functions
gp_array_all (line 290)
void gp_array_all ( $callback,  $array)
  • $callback
  • $array
gp_array_any (line 281)
void gp_array_any ( $callback,  $array)
  • $callback
  • $array
gp_array_flatten (line 61)

Makes from an array of arrays a flat array.

  • return: flattenned array
array gp_array_flatten (array $array)
  • array $array: the arra to flatten
gp_array_get (line 34)

Retrieves a value from $array

  • return: if exists or $default
mixed gp_array_get (array $array, string $key, [mixed $default = ''])
  • array $array
  • string $key: name of array value
  • mixed $default: value to return if $array[$key] doesn't exist. Default is ''
gp_array_zip (line 247)

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.

void gp_array_zip ()
gp_const_get (line 38)
void gp_const_get ( $name, [ $default = ''])
  • $name
  • $default
gp_const_set (line 42)
void gp_const_set ( $name,  $value)
  • $name
  • $value
gp_error_log_dump (line 299)
void gp_error_log_dump ( $value)
  • $value
gp_generate_password (line 235)

Generates a random password drawn from the defined set of characters

  • return: the password
string gp_generate_password ([ $length = 12], [ $special_chars = true])
  • $length
  • $special_chars
gp_get (line 21)

Retrieves a value from $_GET

  • return: if exists or $default
mixed gp_get (string $key, [mixed $default = ''])
  • string $key: name of get value
  • mixed $default: value to return if $_GET[$key] doesn't exist. Default is ''
gp_hash (line 223)
void gp_hash ( $data, [ $scheme = 'auth'])
  • $data
  • $scheme
gp_has_translation_been_updated (line 317)

Has this translation been updated since the passed timestamp?

bool gp_has_translation_been_updated (GP_Translation_Set $translation_set, [int $timestamp = 0])
  • GP_Translation_Set $translation_set: Translation to check
  • int $timestamp: Optional; unix timestamp to compare against. Defaults to HTTP_IF_MODIFIED_SINCE if set.
gp_limit_for_page (line 141)

Builds SQL LIMIT/OFFSET clause for the given page

void gp_limit_for_page (integer $page, integer $per_page)
  • integer $page: The page number. The first page is 1.
  • integer $per_page: How many items are there in a page
gp_member_get (line 51)
void gp_member_get ( $object,  $key, [ $default = ''])
  • $object
  • $key
  • $default
gp_notice (line 87)

Retrieves a notice message, set by gp_notice()

void gp_notice ([string $key = 'notice'])
  • string $key: Optional. Message key. The default is 'notice'
gp_notice_set (line 78)

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.

void gp_notice_set (string $message, [string $key = 'notice'])
  • string $message: The message to be passed
  • string $key: Optional. Key for the message. You can pass several messages under different keys. A key has one message. The default is 'notice'.
gp_object_has_var (line 306)
void gp_object_has_var ( $object,  $var_name)
  • $object
  • $var_name
gp_parity_factory (line 131)

Returns a function, which returns the string "odd" or the string "even" alternatively.

void gp_parity_factory ()
gp_populate_notices (line 91)
void gp_populate_notices ()
gp_post (line 10)

Retrieves a value from $_POST

  • return: if exists or $default
mixed gp_post (string $key, [mixed $default = ''])
  • string $key: name of post value
  • mixed $default: value to return if $_POST[$key] doesn't exist. Default is ''
gp_project_cache_delete_translation_sets (line 345)

Delete counts cache for all translation sets of a project

void gp_project_cache_delete_translation_sets (int $project_id)
  • int $project_id: project ID
gp_redirect (line 109)

Sets headers, which redirect to another page.

  • return: False if $location is not set
bool gp_redirect (string $location, [int $status = 302])
  • string $location: The path to redirect to
  • int $status: Status code to use
gp_salt (line 188)
void gp_salt ([ $scheme = 'auth'])
  • $scheme
gp_translation_set_cache_delete (line 336)

Delete translation set counts cache

void gp_translation_set_cache_delete (int $id)
  • int $id: translation set ID
_gp_get_salt (line 161)
void _gp_get_salt ( $constants, [ $option = false])
  • $constants
  • $option
_gp_get_secret_key (line 148)
void _gp_get_secret_key ( $key, [ $default_key = false])
  • $key
  • $default_key

Documentation generated on Thu, 20 Jun 2013 01:46:39 +0100 by phpDocumentor 1.4.3