class D3ViewsLibraryInfoProcessor in d3.js 7
D3 Views custom Library info processor.
Should be overridden with a hook.
Hierarchy
- class \D3LibraryInfoProcessor
- class \D3ViewsLibraryInfoProcessor
Expanded class hierarchy of D3ViewsLibraryInfoProcessor
2 string references to 'D3ViewsLibraryInfoProcessor'
- d3_views_library_info_handlers in modules/
d3_views/ d3_views.module - hook_library_info_handlers in ./
d3.api.php - Add custom library info handlers.
File
- modules/
d3_views/ includes/ D3ViewsLibraryInfoProcessor.inc, line 8
View source
class D3ViewsLibraryInfoProcessor extends D3LibraryInfoProcessor {
public function process() {
parent::process();
$library =& $this->library
->value();
if (is_array($library['views']['fields'])) {
// Set default for the data key.
if (!empty($library['views']['fields']['rows']) && empty($library['views']['fields']['rows']['_info']['data_key'])) {
$library['views']['fields']['_info']['data_key'] = 'rows';
}
}
}
public function postProcessMeta(&$values) {
if (!empty($values['form_element'])) {
$values['form_element'] = $this
->hash($values['form_element']);
}
// TODO: Add functionality for the rows data type.
if (!isset($values['cardinality'])) {
$values['cardinality'] = 1;
}
}
/**
* Ensure there are hashes in form_element arrays.
*
* Could potentially go in parent class.
*/
protected function hash($element) {
foreach ($element as $key => $value) {
if (strpos($key, '#') === FALSE) {
$element['#' . $key] = $value;
unset($element[$key]);
}
}
return $element;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
D3LibraryInfoProcessor:: |
private | property | Current key being processed. | |
D3LibraryInfoProcessor:: |
private | property | Specific keys to parse in the info file. | |
D3LibraryInfoProcessor:: |
protected | property | Current library to process. | |
D3LibraryInfoProcessor:: |
public | function | Get the current key being processed. | |
D3LibraryInfoProcessor:: |
protected | function | Parse special strings into arrays. | |
D3LibraryInfoProcessor:: |
protected | function | Load a file specified in an info file. | |
D3LibraryInfoProcessor:: |
protected | function | Parse through magic meta keys. | |
D3LibraryInfoProcessor:: |
protected | function | Sub function to start a recursive process. | |
D3LibraryInfoProcessor:: |
public | function | Set the current key being processed. | |
D3LibraryInfoProcessor:: |
public | function | Set the info file keys to be processed. | |
D3LibraryInfoProcessor:: |
protected | function | Helper function to process info line with [] or {}. | |
D3LibraryInfoProcessor:: |
public | function | ||
D3ViewsLibraryInfoProcessor:: |
protected | function | Ensure there are hashes in form_element arrays. | |
D3ViewsLibraryInfoProcessor:: |
public | function | ||
D3ViewsLibraryInfoProcessor:: |
public | function |
Main function to process the info file for the current keys. Overrides D3LibraryInfoProcessor:: |