D3ViewsLibraryInfoProcessor.inc in d3.js 7
File
modules/d3_views/includes/D3ViewsLibraryInfoProcessor.inc
View source
<?php
class D3ViewsLibraryInfoProcessor extends D3LibraryInfoProcessor {
public function process() {
parent::process();
$library =& $this->library
->value();
if (is_array($library['views']['fields'])) {
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']);
}
if (!isset($values['cardinality'])) {
$values['cardinality'] = 1;
}
}
protected function hash($element) {
foreach ($element as $key => $value) {
if (strpos($key, '#') === FALSE) {
$element['#' . $key] = $value;
unset($element[$key]);
}
}
return $element;
}
}