void action_smartsearch(
)
|
|
The action handler method.
atkNode &addNodeAndAttrEntry(
&$path,
&$node, String
$attrName,
&$includeSelf,
&$excludes, Array
$path, atkNode
$node, Boolean
$includeSelf, Array
$excludes
)
|
|
Adds a node/attribute entry to the node/attribute path.
The entry consists of the the following fields:
- nr, number in the node/attribute path (>= 0)
- node, reference to the node for this path entry
- attr, reference to the currently selected attribute for this path entry
- attrs, all searchable attributes for this node
- includeSelf, whatever the attribute list should contain a reference to ourselves or not
- selectSelf, should the self option be selected? (only valid if includeSelf is true)
This method will modify the $path, $includeSelf and $excludes parameters to prepare them for the next call to this method.
Parameters:
|
Array |
$path: |
reference to the current path |
|
atkNode |
$node: |
reference to the current node |
|
String |
$attrName: |
currently selected attribute |
|
Boolean |
$includeSelf: |
should we include ourselves? |
|
Array |
$excludes: |
attributes to exclude |
|
|
&$path: |
|
|
|
&$node: |
|
|
|
&$includeSelf: |
|
|
|
&$excludes: |
|
API Tags:
void getAttributeList(
Array
$entry
)
|
|
Returns a select element with searchable attributes for a certain node.
Parameters:
void getCriterium(
String
$id, [Array
$data = array()]
)
|
|
Returns the criterium parameters needed to render a criterium. The data structure contains the already known information about the currently selected field and values (if any).
Parameters:
|
String |
$id: |
criterium identifier |
|
Array |
$data: |
criterium data |
String getCriteriumField(
Integer
$id, Array
$path,
&$scriptCode, Array
$scriptCode
)
|
|
Returns the criterium field for the given path.
Parameters:
|
Integer |
$id: |
criterium id |
|
Array |
$path: |
criterium path |
|
Array |
$scriptCode: |
lines of JavaScript |
|
|
&$scriptCode: |
|
API Tags:
| Return: | criterium field HTML |
void getCriteriumMode(
Integer
$id, Array
$path, [Array
$value = array()], [Array
$mode = array()], String
4
)
|
|
Returns the criterium mode field for the given path.
Parameters:
|
Integer |
$id: |
criterium id |
|
Array |
$path: |
criterium path |
|
Array |
$value: |
current search value |
|
Array |
$mode: |
current search mode |
|
String |
4: |
criterium mode field HTML |
void getCriteriumValue(
Integer
$id, Array
$path, [Array
$value = array()], [Array
$mode = array()], String
4
)
|
|
Returns the criterium value field for the given path.
Parameters:
|
Integer |
$id: |
criterium id |
|
Array |
$path: |
criterium path |
|
Array |
$value: |
current search value |
|
Array |
$mode: |
current search mode |
|
String |
4: |
criterium value field HTML |
Returns the base labels for use in the templates.
Contains labels for the following fields: 'field', 'value', 'add', 'remove'
API Tags:
Array getNodeAndAttrPath(
Array
$attrPath
)
|
|
Returns the node/attribute path for the given attribute name path.
Parameters:
|
Array |
$attrPath: |
attribute name path |
API Tags:
| Return: | node/attribute path |
String getResetCriteria(
)
|
|
Returns a link for resetting the currently selected criteria.
API Tags:
Array getSearchableAttributes(
&$node, Array
$excludes, atkNode
$node
)
|
|
Get searchable attributes for the given node.
Parameters:
|
atkNode |
$node: |
reference to the node |
|
Array |
$excludes: |
attribute exclude list |
|
|
&$node: |
|
API Tags:
| Return: | list of reference to searchable attributes |
full getTemplate(
String
$name
)
|
|
Returns the template path with the given name.
Name can be either 'form' or 'criterium'.
Parameters:
|
String |
$name: |
template name |
API Tags:
void partialCriteriumField(
)
|
|
Partial criterium field.
void partialCriteriumMode(
)
|
|
Partial criterium value.
void partialCriteriumValue(
)
|
|
Partial criterium value.
void redirectToResults(
Array
$criteria
)
|
|
Redirect to search results based on the given criteria.
Parameters:
String renderCriterium(
Array
$criterium
)
|
|
Renders a single criterium (field and value).
Parameters:
|
Array |
$criterium: |
criterium structure (from getCriterium) |
API Tags:
| Return: | rendered criterium |
String smartSearchForm(
[String
$name = ""], [Array
$criteria = array()]
)
|
|
This method returns a form that the user can use to search records.
Parameters:
|
String |
$name: |
|
|
Array |
$criteria: |
|
API Tags:
| Return: | The searchform in html form. |
String smartSearchPage(
[String
$name = ""], [Array
$criteria = array()]
)
|
|
This method returns an html page that can be used as a search form.
Parameters:
|
String |
$name: |
|
|
Array |
$criteria: |
|
API Tags:
| Return: | The html search page. |
void _getCriteriumValueOrMode(
Integer
$id, Array
$path, Array
$value, Array
$mode, String
$type, String
5
)
|
|
Returns the criterium value or mode field for the given path.
Parameters:
|
Integer |
$id: |
criterium id |
|
Array |
$path: |
criterium path |
|
Array |
$value: |
current search value |
|
Array |
$mode: |
current search mode |
|
String |
$type: |
return either 'value' or 'mode' field |
|
String |
5: |
criterium value or mode field HTML |
void _partialCriteriumValueOrMode(
string
$type
)
|
|
Partial criterium value / mode.
Parameters:
|
string |
$type: |
'value' or 'mode' partial? |