templates/3rdParty/pla/lib/hooks.php

Properties

Description

Functions related to hooks management.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Functions

sort_array_by_priority(   $a,   $b, ) : \-1

Description

Compares two arrays by numerically comparing their 'prority' value. Standard `cmp-like' function.

Arguments

Name Type Description Default
$a n/a
$b n/a

Return value

Type Description
\-1 if priority of first element is smaller than second element priority. 1 otherwise.

run_hook(   $hook_name,   $args, ) : true

Description

Runs procedures attached to a hook.

Arguments

Name Type Description Default
$hook_name n/a
$args n/a

Return value

Type Description
true if all procedures returned true, false otherwise.

add_hook(   $hook_name,   $hook_function,   $priority = 0,   $rollback_function = null, ) : n/a

Description

Adds a procedure to a hook for later execution.

Arguments

Name Type Description Default
$hook_name n/a
$hook_function n/a
$priority n/a 0
$rollback_function n/a null

Return value

Type Description
n/a n/a

remove_hook(   $hook_name,   $hook_function,   $priority,   $rollback_function, ) : n/a

Description

Removes a procedure from a hook, based on a filter.

Arguments

Name Type Description Default
$hook_name n/a
$hook_function n/a
$priority n/a
$rollback_function n/a

Return value

Type Description
n/a n/a

clear_hooks(   $hook_name, ) : n/a

Description

Removes all procedures from a hook.

Arguments

Name Type Description Default
$hook_name n/a

Return value

Type Description
n/a n/a
Documentation was generated by phpDocumentor 2.0.1 .

Namespaces

  • global

    Packages