phpDocumentor pivotx
extensions
[ class tree: pivotx ] [ index: pivotx ] [ all elements ]

Class: Extensions

Source Location: /modules/module_extensions.php

Class Extensions

Property Summary
mixed   $active  
mixed   $filenames  
mixed   $full_list  
mixed   $hidearray  
mixed   $hooks  
mixed   $list  
mixed   $scanned  

[ Top ]
Method Summary
Extensions   __construct()   Initialise the Extensions object.
void   addHook()  
void   delHook()  
void   executeAfterParse()  
void   executeBeforeParse()  
void   executeConfigurationAdd()  
void   executeDuringParse()  
void   executeGenericHook()   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.
void   executeHook()  
void   executeInPivotxTemplate()   Execute hooks encountered in PivotX templates. $action is the name of the
void   executeMessages()  
void   executeWidget()  
string   fixPaths()   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.
void   getActivated()   Get a list of extensions that are activated. The optional filter parameter lets you select the type of extensions to return.
object Form   getAdminForm()   Get a form with some defaults set, so extension authors can add forms easier.
void   getAdminFormHtml()   Gets the HTML for the admin-screen form. It also sets the default value, for ease of use.
array   getAdminScreenName()   Get a single name of a currently activated extension, identified by $key
array   getAdminScreenNames()   Get a list of currently activated extensions, that have their own administration screen.
array   getHook()   Gets a hooks, identified by $key..
array   getHooks()   Gets a list of hooks, filtered by $type or $action..
array   getIdentifiers()   Get a list of the 'identifiers' as set in the extensions.
void   getLoadCode()   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.
boolean   hasHook()   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'.
void   haveHook()  
void   hide()   Hide a certain element in templates. For instance, call $extension->hide('example'), to hide the contents of
array   scanExtensions()   Scan the pivotx/extensions folder, and compile a list of all available extensions.
void   setActivated()   Set a list of extensions that are activated.
string   __scanDocumentation()   Helper function for __scanFile, to check if the extension has any documentation.
array   __scanFile()   Helper function for scanExtensions, to check if files are extensions.
void   __scanFolder()   Helper function for scanExtensions, to recursively scan folders for available extensions.

[ Top ]
Properties
mixed   $active [line 37]

[ Top ]
mixed   $filenames [line 38]

[ Top ]
mixed   $full_list [line 40]

[ Top ]
mixed   $hidearray [line 42]

[ Top ]
mixed   $hooks [line 41]

[ Top ]
mixed   $list [line 39]

[ Top ]
mixed   $scanned [line 43]

[ Top ]
Methods
Constructor __construct  [line 50]

  Extensions __construct( )

Initialise the Extensions object.



[ Top ]
addHook  [line 524]

  void addHook( [ $type = ""], [ $action = ""], [ $parameters = ""]  )

Parameters:
   $type: 
   $action: 
   $parameters: 


[ Top ]
delHook  [line 545]

  void delHook( [ $type = ""], [ $action = ""], [ $parameters = ""]  )

Parameters:
   $type: 
   $action: 
   $parameters: 


[ Top ]
executeAfterParse  [line 746]

  void executeAfterParse( &$target  )

Parameters:
   &$target: 


[ Top ]
executeBeforeParse  [line 693]

  void executeBeforeParse( &$target  )

Parameters:
   &$target: 


[ Top ]
executeConfigurationAdd  [line 875]

  void executeConfigurationAdd( &$action  )

Parameters:
   &$action: 


[ Top ]
executeDuringParse  [line 718]

  void executeDuringParse( &$target  )

Parameters:
   &$target: 


[ Top ]
executeGenericHook  [line 667]

  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: 


[ Top ]
executeHook  [line 589]

  void executeHook( $type, &$target, [ $value = ""]  )

Parameters:
   $type: 
   &$target: 
   $value: 


[ Top ]
executeInPivotxTemplate  [line 827]

  void executeInPivotxTemplate( &$action  )

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:
   &$action: 


[ Top ]
executeMessages  [line 925]

  void executeMessages( $action  )

Parameters:
   $action: 


[ Top ]
executeWidget  [line 903]

  void executeWidget( &$output  )

Parameters:
   &$output: 


[ Top ]
fixPaths  [line 1006]

  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:
string   $str: 


[ Top ]
getActivated  [line 491]

  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:
string   $filter: 


[ Top ]
getAdminForm  [line 1175]

  object Form getAdminForm( string $key, string $name  )

Get a form with some defaults set, so extension authors can add forms easier.

Parameters:
string   $key: 
string   $name: 


[ Top ]
getAdminFormHtml  [line 1357]

  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: 


[ Top ]
getAdminScreenName  [line 1324]

  array getAdminScreenName( string $key  )

Get a single name of a currently activated extension, identified by $key

Parameters:
string   $key: 


[ Top ]
getAdminScreenNames  [line 1283]

  array getAdminScreenNames( )

Get a list of currently activated extensions, that have their own administration screen.



[ Top ]
getHook  [line 984]

  array getHook( string $key  )

Gets a hooks, identified by $key..

Parameters:
string   $key: 


[ Top ]
getHooks  [line 952]

  array getHooks( [string $type = ""], [string $action = ""]  )

Gets a list of hooks, filtered by $type or $action..

Parameters:
string   $type: 
string   $action: 


[ Top ]
getIdentifiers  [line 124]

  array getIdentifiers( [ $neededtype = ""], mixed $type  )

Get a list of the 'identifiers' as set in the extensions.

Parameters:
mixed   $type: 
   $neededtype: 


[ Top ]
getLoadCode  [line 1045]

  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:
See:  http://mikeindustries.com/blog/archive/2007/06/widget-deployment-with-wedje


[ Top ]
hasHook  [line 569]

  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:
string   $type: 


[ Top ]
haveHook  [line 582]

  void haveHook( $type, $action  )

Parameters:
   $type: 
   $action: 


[ Top ]
hide  [line 1392]

  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:
string   $name: 


[ Top ]
scanExtensions  [line 224]

  array scanExtensions( )

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] => [email protected] [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] => [email protected] [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] => [email protected] [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] => [email protected] [site] => http://www.pivotx.net [description] => A simple example to demonstrate 'Hello world' as a Widget Extension. [date] => 2007-05-20 [type] => widget )

)



[ Top ]
setActivated  [line 445]

  void setActivated( array $identifiers  )

Set a list of extensions that are activated.

Parameters:
array   $identifiers: 


[ Top ]
__scanDocumentation  [line 403]

  string __scanDocumentation( array $info, $title  )

Helper function for __scanFile, to check if the extension has any documentation.

Parameters:
array   $info: 
   $title: 

API Tags:
See:  Extensions::__scanFile


[ Top ]
__scanFile  [line 323]

  array __scanFile( string $file  )

Helper function for scanExtensions, to check if files are extensions.

Parameters:
string   $file: 

API Tags:
See:  Extensions::scanExtensions


[ Top ]
__scanFolder  [line 283]

  void __scanFolder( string $dir  )

Helper function for scanExtensions, to recursively scan folders for available extensions.

Parameters:
string   $dir: 

API Tags:
See:  Extensions::scanExtensions


[ Top ]

Documentation generated on Tue, 05 Sep 2017 01:06:06 +0200 by phpDocumentor 1.4.3