/functions/plugin.php

Description

plugin.php

This file provides the framework for a plugin architecture.

Documentation on how to write plugins might show up some time.

Includes
require_once (SM_PATH.'functions/global.php') (line 17)

Everything needs global..

Functions
boolean_hook_function (line 130)

This function is used for hooks which are to return true or false. If $priority is > 0, any one or more trues will override any falses. If $priority < 0, then one or more falses will override any trues.

Priority 0 means majority rules. Ties will be broken with $tie

  • return: the result of the function
bool boolean_hook_function (string $name, [mixed $parm = NULL], [int $priority = 0], [bool $tie = false])
  • string $name: name the hook name
  • mixed $parm: parm the parameters for the hook function
  • int $priority: priority
  • bool $tie: tie
concat_hook_function (line 97)

This function executes a hook, concatenating the results of each plugin that has the hook defined.

  • return: a concatenation of the results of each plugin function
string concat_hook_function (string $name, [mixed $parm = NULL])
  • string $name: name the name of the hook
  • mixed $parm: parm optional hook function parameters
do_hook (line 42)

This function executes a hook.

mixed do_hook (string $name)
  • string $name: Name of hook to fire
do_hook_function (line 69)

This function executes a hook and allows for parameters to be passed.

  • return: the return value of the hook function
mixed do_hook_function (string $name, [mixed $parm = NULL])
  • string $name: name the name of the hook
  • mixed $parm: param the parameters to pass to the hook function
soupNazi (line 179)

This function checks whether the user's USER_AGENT is known to be broken. If so, returns true and the plugin is invisible to the offending browser.

*** THIS IS A TEST FOR JAVASCRIPT SUPPORT *** FIXME: This function needs to have its name changed! FIXME: The test in this function is outdated - plenty more browsers support JavaScript, newer browser versions (Mozilla at least) exist, and moreover, we shouldn't be doing user-agent testing - should be trusting our $javascript_on global -- REMOVE THIS FUNCTION IF NOT BEING USED ANYWHERE ELSE

  • return: whether this browser properly supports JavaScript
bool soupNazi ()
use_plugin (line 27)

This function adds a plugin.

void use_plugin (string $name)
  • string $name: Internal plugin name (ie. delete_move_next)

Documentation generated on Mon, 13 Jan 2020 04:25:10 +0100 by phpDocumentor 1.4.3