Elgg  Version 3.0
Functions
deprecated-2.3.php File Reference

Go to the source code of this file.

Functions

 ajax_forward_hook ($hook, $type, $forward_url, $params)
 Catch calls to forward() in ajax request and force an exit. More...
 
 ajax_action_hook ()
 Buffer all output echo'd directly in the action for inclusion in the returned JSON. More...
 
 get_uploaded_file ($input_name)
 Get the contents of an uploaded file. More...
 
 get_resized_image_from_uploaded_file ($input_name, $maxwidth, $maxheight, $square=false, $upscale=false)
 Gets the jpeg contents of the resized version of an uploaded image (Returns false if the uploaded file was not an image) More...
 
 get_resized_image_from_existing_file ($input_name, $maxwidth, $maxheight, $square=false, $x1=0, $y1=0, $x2=0, $y2=0, $upscale=false)
 Gets the jpeg contents of the resized version of an already uploaded image (Returns false if the file was not an image) More...
 
 get_image_resize_parameters ($width, $height, array $params=[])
 Calculate the parameters for resizing an image. More...
 
 update_entity_last_action ($guid, $posted=null)
 Update the last_action column in the entities table for $guid. More...
 
 get_user_notification_settings ($user_guid=0)
 Get the notification settings for a given user. More...
 
 set_user_notification_setting ($user_guid, $method, $value)
 Set a user notification pref. More...
 
 elgg_error_page_handler ($hook, $type, $result, $params)
 Serve an error page. More...
 
 elgg_view_input ($input_type, array $vars=[])
 Renders a form field. More...
 
 sanitize_string ($string)
 Sanitizes a string for use in a query. More...
 
 sanitise_string ($string)
 Alias of sanitize_string. More...
 
 sanitize_int ($int, $signed=true)
 Sanitizes an integer for database use. More...
 
 sanitise_int ($int, $signed=true)
 Alias of sanitize_int. More...
 

Function Documentation

ajax_action_hook ( )

Buffer all output echo'd directly in the action for inclusion in the returned JSON.

Returns
void

Definition at line 67 of file deprecated-2.3.php.

ajax_forward_hook (   $hook,
  $type,
  $forward_url,
  $params 
)

Catch calls to forward() in ajax request and force an exit.

Forces response is json of the following form:

{
    "current_url": "the.url.we/were/coming/from",
    "forward_url": "the.url.we/were/going/to",
    "system_messages": {
        "messages": ["msg1", "msg2", ...],
        "errors": ["err1", "err2", ...]
    },
    "status": -1 //or 0 for success if there are no error messages present
}

where "system_messages" is all message registers at the point of forwarding

Definition at line 30 of file deprecated-2.3.php.

elgg_error_page_handler (   $hook,
  $type,
  $result,
  $params 
)

Serve an error page.

This is registered by Elgg for the 'forward', '404' plugin hook. It can registered for other hooks by plugins or called directly to display an error page.

Parameters
string$hookThe name of the hook
string$typeHttp error code
bool$resultThe current value of the hook
array$paramsParameters related to the hook
Returns
void

Definition at line 314 of file deprecated-2.3.php.

elgg_view_input (   $input_type,
array  $vars = [] 
)

Renders a form field.

Parameters
string$input_typeInput type, used to generate an input view ("input/$input_type")
array$varsFields and input vars. Field vars contain both field and input params. 'label', 'help', and 'field_class' params will not be passed on to the input view. Others, including 'required' and 'id', will be available to the input view. Both 'label' and 'help' params accept HTML, and will be printed unescaped within their wrapper element.
Returns
string
Since
2.1

Definition at line 357 of file deprecated-2.3.php.

get_image_resize_parameters (   $width,
  $height,
array  $params = [] 
)

Calculate the parameters for resizing an image.

Parameters
int$widthNatural width of the image
int$heightNatural height of the image
array$paramsResize parameters
  • 'maxwidth' maximum width of the resized image
  • 'maxheight' maximum height of the resized image
  • 'upscale' allow upscaling
  • 'square' constrain to a square
  • 'x1', 'y1', 'x2', 'y2' cropping coordinates
Returns
array|false
Since
1.7.2

Definition at line 193 of file deprecated-2.3.php.

get_resized_image_from_existing_file (   $input_name,
  $maxwidth,
  $maxheight,
  $square = false,
  $x1 = 0,
  $y1 = 0,
  $x2 = 0,
  $y2 = 0,
  $upscale = false 
)

Gets the jpeg contents of the resized version of an already uploaded image (Returns false if the file was not an image)

Parameters
string$input_nameThe name of the file on the disk
int$maxwidthThe desired width of the resized image
int$maxheightThe desired height of the resized image
bool$squareIf set to true, takes the smallest of maxwidth and maxheight and use it to set the dimensions on the new image. If no crop parameters are set, the largest square that fits in the image centered will be used for the resize. If square, the crop must be a square region.
int$x1x coordinate for top, left corner
int$y1y coordinate for top, left corner
int$x2x coordinate for bottom, right corner
int$y2y coordinate for bottom, right corner
bool$upscaleResize images smaller than $maxwidth x $maxheight?
Returns
false|mixed The contents of the resized image, or false on failure

Definition at line 143 of file deprecated-2.3.php.

get_resized_image_from_uploaded_file (   $input_name,
  $maxwidth,
  $maxheight,
  $square = false,
  $upscale = false 
)

Gets the jpeg contents of the resized version of an uploaded image (Returns false if the uploaded file was not an image)

Parameters
string$input_nameThe name of the file input field on the submission form
int$maxwidthThe maximum width of the resized image
int$maxheightThe maximum height of the resized image
bool$squareIf set to true, will take the smallest of maxwidth and maxheight and use it to set the dimensions on all size; the image will be cropped.
bool$upscaleResize images smaller than $maxwidth x $maxheight?
Returns
false|mixed The contents of the resized image, or false on failure

Definition at line 109 of file deprecated-2.3.php.

get_uploaded_file (   $input_name)

Get the contents of an uploaded file.

(Returns false if there was an issue.)

Parameters
string$input_nameThe name of the file input field on the submission form
Returns
mixed|false The contents of the file, or false on failure.

Definition at line 84 of file deprecated-2.3.php.

get_user_notification_settings (   $user_guid = 0)

Get the notification settings for a given user.

Parameters
int$user_guidThe user id
Returns
|false

Definition at line 251 of file deprecated-2.3.php.

sanitise_int (   $int,
  $signed = true 
)

Alias of sanitize_int.

See also
sanitize_int
Parameters
int$intValue to be sanitized
bool$signedWhether negative values should be allowed (true)
Returns
int

Definition at line 429 of file deprecated-2.3.php.

sanitise_string (   $string)

Alias of sanitize_string.

See also
Elgg::sanitizeString
Parameters
string$stringThe string to sanitize
Returns
string

Definition at line 401 of file deprecated-2.3.php.

sanitize_int (   $int,
  $signed = true 
)

Sanitizes an integer for database use.

See also
Elgg::sanitizeInt
Parameters
int$intValue to be sanitized
bool$signedWhether negative values should be allowed (true)
Returns
int

Definition at line 415 of file deprecated-2.3.php.

sanitize_string (   $string)

Sanitizes a string for use in a query.

See also
Elgg::sanitizeString
Parameters
string$stringThe string to sanitize
Returns
string

Definition at line 388 of file deprecated-2.3.php.

set_user_notification_setting (   $user_guid,
  $method,
  $value 
)

Set a user notification pref.

Parameters
int$user_guidThe user id.
string$methodThe delivery method (eg. email)
bool$valueOn(true) or off(false).
Returns
bool

Definition at line 277 of file deprecated-2.3.php.

update_entity_last_action (   $guid,
  $posted = null 
)

Update the last_action column in the entities table for $guid.

Warning
This is different to time_updated. Time_updated is automatically set, while last_action is only set when explicitly called.
Parameters
int$guidEntity annotation|relationship action carried out on
int$postedTimestamp of last action
Returns
int|false Timestamp or false on failure

Definition at line 230 of file deprecated-2.3.php.