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   Extensions()   Initialise the Extensions object.
void   addHook()  
void   executeAddSearchText()   Execute 'AddSearchText' hook.
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()   Execute a hook
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 Extensions  [line 50]

  Extensions Extensions( )

Initialise the Extensions object.



[ Top ]
addHook  [line 547]

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

Parameters:
   $type: 
   $action: 
   $parameters: 


[ Top ]
executeAddSearchText  [line 686]

  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: 


[ Top ]
executeAfterParse  [line 824]

  void executeAfterParse( &$target  )

Parameters:
   &$target: 


[ Top ]
executeBeforeParse  [line 771]

  void executeBeforeParse( &$target  )

Parameters:
   &$target: 


[ Top ]
executeConfigurationAdd  [line 965]

  void executeConfigurationAdd( &$action  )

Parameters:
   &$action: 


[ Top ]
executeDuringParse  [line 796]

  void executeDuringParse( &$target  )

Parameters:
   &$target: 


[ Top ]
executeGenericHook  [line 745]

  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 603]

  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


[ Top ]
executeInPivotxTemplate  [line 905]

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


[ Top ]
executeMessages  [line 1015]

  void executeMessages( $action  )

Parameters:
   $action: 


[ Top ]
executeWidget  [line 993]

  void executeWidget( &$output  )

Parameters:
   &$output: 


[ Top ]
fixPaths  [line 1096]

  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 514]

  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 1265]

  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 1447]

  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 1414]

  array getAdminScreenName( string $key  )

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

Parameters:
string   $key: 


[ Top ]
getAdminScreenNames  [line 1373]

  array getAdminScreenNames( )

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



[ Top ]
getHook  [line 1074]

  array getHook( string $key  )

Gets a hooks, identified by $key..

Parameters:
string   $key: 


[ Top ]
getHooks  [line 1042]

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

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

Parameters:
string   $type: 
string   $action: 


[ Top ]
getIdentifiers  [line 129]

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

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

Parameters:
mixed   $type: 
   $neededtype: 


[ Top ]
getLoadCode  [line 1135]

  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 573]

  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 586]

  void haveHook( $type, $action  )

Parameters:
   $type: 
   $action: 


[ Top ]
hide  [line 1482]

  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 229]

  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] => 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 )

)



[ Top ]
setActivated  [line 461]

  void setActivated( array $identifiers  )

Set a list of extensions that are activated.

Parameters:
array   $identifiers: 


[ Top ]
__scanDocumentation  [line 419]

  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 339]

  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 299]

  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 Thu, 17 May 2012 01:07:15 +0200 by phpDocumentor 1.4.3