| 1 |
// $Id: API.txt,v 1.3 2008/01/24 01:57:10 cwgordon7 Exp $ |
// $Id: API.txt,v 1.4 2008/02/29 22:11:51 cwgordon7 Exp $ |
| 2 |
|
|
| 3 |
There are three major hooks to implement, hook_flexifilters, hook_flexifilter_conditions, and hook_flexifilter_components. Hook_flexifilters is for defining default flexifilters; hook_flexifilter_conditions is for describing your module's conditions to flexifilter; hook_flexifilter_components is for describing your module's components to flexifilter. |
There are three major hooks to implement, hook_flexifilters, hook_flexifilter_conditions, and hook_flexifilter_components. Hook_flexifilters is for defining default flexifilters; hook_flexifilter_conditions is for describing your module's conditions to flexifilter; hook_flexifilter_components is for describing your module's components to flexifilter. |
| 4 |
|
|
|
|
|
|
|
|
|
|
|
| 5 |
For hook_flexifilters, an array should be returned, each value of the array corresponding to an exported flexifilter (as an array itself). |
For hook_flexifilters, an array should be returned, each value of the array corresponding to an exported flexifilter (as an array itself). |
| 6 |
|
|
| 7 |
|
<?php |
| 8 |
function hook_flexifilter() { |
function hook_flexifilter() { |
| 9 |
return array( |
return array( |
| 10 |
array( |
array( |
| 15 |
), |
), |
| 16 |
); |
); |
| 17 |
} |
} |
| 18 |
|
?> |
|
|
|
|
|
|
| 19 |
|
|
| 20 |
A description of hook_flexifilter_components: |
A description of hook_flexifilter_components: |
| 21 |
|
|
| 42 |
|
|
| 43 |
- It has no 'step' attribute. |
- It has no 'step' attribute. |
| 44 |
|
|
|
|
|
|
|
|
|
|
|
| 45 |
Two examples of a function specified in the 'callback' key follows: |
Two examples of a function specified in the 'callback' key follows: |
| 46 |
|
|
| 47 |
|
<?php |
| 48 |
function flexifilter_component_foo($op, $settings, $text) { |
function flexifilter_component_foo($op, $settings, $text) { |
| 49 |
switch ($op) { |
switch ($op) { |
| 50 |
case 'settings': |
case 'settings': |
| 81 |
return FALSE; |
return FALSE; |
| 82 |
} |
} |
| 83 |
} |
} |
| 84 |
|
?> |
|
|
|
| 85 |
|
|
| 86 |
Some useful API functions follow: |
Some useful API functions follow: |
| 87 |
|
|