Initialise the Extensions object.
void addHook(
[
$type = ""], [
$action = ""], [
$parameters = ""]
)
|
|
Parameters:
|
|
$type: |
|
|
|
$action: |
|
|
|
$parameters: |
|
void executeAddSearchText(
&$target, string
$type, mixed
$target
)
|
|
Execute 'AddSearchText' hook.
This hook gets called just before a page or entry save is performed (before entry_edit_beforesave / page_edit_beforesave). Its purpose is to collect all the text that should be searchable in a standard PivotX search. This function collects all text per page/entry and collects all unique words and stores them in 'extra_search_text'. Returned texts is strip-tagged and lowered aswell.
Parameters:
|
mixed |
$target: |
|
|
string |
$type: |
|
|
|
&$target: |
|
void executeAfterParse(
&$target
)
|
|
Parameters:
void executeBeforeParse(
&$target
)
|
|
Parameters:
void executeConfigurationAdd(
&$action
)
|
|
Parameters:
void executeDuringParse(
&$target
)
|
|
Parameters:
void executeGenericHook(
&$target, string
$type, string
$action, mixed
$target
)
|
|
Execute a 'generic hook'. Basically all hooks of this type work the same: They take some input, call a callback function with that input, and return the output of that function to the caller.
Note that the $target is passed by reference, so the callback function can modify the $target, as well as give some output. If this is useful depends on how the hook is used.
Parameters:
|
mixed |
$target: |
|
|
string |
$type: |
|
|
string |
$action: |
|
|
|
&$target: |
|
void executeHook(
string
$type, mixed
&$target, [mixed
$value = ""], [mixed
$arguments = false]
)
|
|
Execute a hook
Note: $arguments are only used for in_pivotx_template hook's atm
Parameters:
|
string |
$type: |
type of hook to execute |
|
mixed |
&$target: |
target |
|
mixed |
$value: |
value to call hook with |
|
mixed |
$arguments: |
other type of arguments for the hook |
void executeInPivotxTemplate(
&$action, [
$arguments = false]
)
|
|
Execute hooks encountered in PivotX templates. $action is the name of the
hook. I.E. when called after [[ hook name='foo' value='bar' ]], $action will be 'foo', and $this->value will be 'bar'
Parameters:
void executeMessages(
$action
)
|
|
Parameters:
void executeWidget(
&$output
)
|
|
Parameters:
string fixPaths(
string
$str
)
|
|
Translate some paths into the correct ones. We do this translation at the end, because when the hooks are added, $PIVOTX may be not initialised yet.
Note: These look like smarty tags but are not.
Parameters:
void getActivated(
[string
$filter = ""]
)
|
|
Get a list of extensions that are activated. The optional filter parameter lets you select the type of extensions to return.
Parameters:
Get a form with some defaults set, so extension authors can add forms easier.
Parameters:
|
string |
$key: |
|
|
string |
$name: |
|
void getAdminFormHtml(
object
$form, [array
$ext_config = array()]
)
|
|
Gets the HTML for the admin-screen form. It also sets the default value, for ease of use.
Parameters:
|
object |
$form: |
|
|
array |
$ext_config: |
|
array getAdminScreenName(
string
$key
)
|
|
Get a single name of a currently activated extension, identified by $key
Parameters:
array getAdminScreenNames(
)
|
|
Get a list of currently activated extensions, that have their own administration screen.
array getHook(
string
$key
)
|
|
Gets a hooks, identified by $key..
Parameters:
array getHooks(
[string
$type = ""], [string
$action = ""]
)
|
|
Gets a list of hooks, filtered by $type or $action..
Parameters:
|
string |
$type: |
|
|
string |
$action: |
|
array getIdentifiers(
[
$neededtype = ""], mixed
$type
)
|
|
Get a list of the 'identifiers' as set in the extensions.
Parameters:
|
mixed |
$type: |
|
|
|
$neededtype: |
|
void getLoadCode(
string
$mode, string
$target, [string
$wrapstyle = ""]
)
|
|
Widgets can slow down a page significantly. For instance if it includes a lot of HTML or if it calls an external javascript file. In the second case, if the server from which you're trying to include the javascript is down, it'll prevent your page from displaying at all.
This function will return the HTML code that can be inserted in your page, by either including the requested widget immediately, or by doing so after the page has loaded and is rendered. The four accepted modes are:
immediate_file: Insert the file immediately immediate_script: Insert the HTML code to load the script immediately defer_file: Insert the file, after the page has loaded (via Ajax) defer_script: Insert the HTML to load the script after the page is rendered.
The deferred javascript method was made (mostly) by Mike Davidson, http://mikeindustries.com
Note: if you use 'immediate_file', PHP will not be parsed if it's present in the file. 'defer_file' will parse PHP, though. If you'd like to use PHP in a 'direct' widget, use include() in your widget callback function.
Parameters:
|
string |
$mode: |
|
|
string |
$target: |
|
|
string |
$wrapstyle: |
|
API Tags:
boolean hasHook(
string
$type
)
|
|
Check if a particular hook has been set. $type can be a simple value like 'before_parse', or a compound one like 'make_link#pages'.
Parameters:
void haveHook(
$type,
$action
)
|
|
Parameters:
void hide(
string
$name
)
|
|
Hide a certain element in templates. For instance, call $extension->hide('example'), to hide the contents of
[[ if $hide.medialineimage ]]<!--[[/if x="-->"]] This will be hidden! [[ if $hide.medialineimage ]]-->[[/if]]
Note: the parameter in the [[/if]] is there solely to not confuse editors that use HTML syntax coloring.
Parameters:
Scan the pivotx/extensions folder, and compile a list of all available extensions.
If all goes well, we'll get back a multidimensional array, with all found extensions, grouped by type. Like so:
[admin] => Array ( [0] => Array ( [extension] => Hello World admin page [version] => 0.1 [author] => PivotX Team [email] => admin@pivotx.net [site] => http://www.pivotx.net [description] => A simple example to demonstrate the 'Hello world' administration page. [date] => 2007-05-20 [type] => admin )
)
[hook] => Array ( [0] => Array ( [extension] => Hello World hook [version] => 0.1 [author] => PivotX Team [email] => admin@pivotx.net [site] => http://www.pivotx.net [description] => A simple example to demonstrate 'Hello world' as a Hook Extension. [date] => 2007-05-20 [type] => hook )
)
[snippet] => Array ( [0] => Array ( [extension] => Hello World snippet [version] => 0.1 [author] => PivotX Team [email] => admin@pivotx.net [site] => http://www.pivotx.net [description] => A simple example to demonstrate 'Hello world' as a Snippet Extension. [date] => 2007-05-20 [type] => snippet )
)
[widget] => Array ( [0] => Array ( [extension] => Hello World widget [version] => 0.1 [author] => PivotX Team [email] => admin@pivotx.net [site] => http://www.pivotx.net [description] => A simple example to demonstrate 'Hello world' as a Widget Extension. [date] => 2007-05-20 [type] => widget )
)
void setActivated(
array
$identifiers
)
|
|
Set a list of extensions that are activated.
Parameters:
string __scanDocumentation(
array
$info,
$title
)
|
|
Helper function for __scanFile, to check if the extension has any documentation.
Parameters:
API Tags:
| See: | Extensions::__scanFile |
array __scanFile(
string
$file
)
|
|
Helper function for scanExtensions, to check if files are extensions.
Parameters:
API Tags:
| See: | Extensions::scanExtensions |
void __scanFolder(
string
$dir
)
|
|
Helper function for scanExtensions, to recursively scan folders for available extensions.
Parameters:
API Tags:
| See: | Extensions::scanExtensions |