function forena_data_block_autocomplete in Forena Reports 7.5
Same name and namespace in other branches
- 6.2 forena.module \forena_data_block_autocomplete()
- 6 forena.module \forena_data_block_autocomplete()
- 7 forena.module \forena_data_block_autocomplete()
- 7.2 forena.module \forena_data_block_autocomplete()
- 7.3 forena.module \forena_data_block_autocomplete()
- 7.4 forena.module \forena_data_block_autocomplete()
Auto complete for data blocks
Parameters
$string:
Return value
unknown_type
1 string reference to 'forena_data_block_autocomplete'
- forena_menu in ./
forena.module - Implementation of hook_menu.
File
- ./
forena.module, line 488
Code
function forena_data_block_autocomplete() {
require_once 'forena.admin.inc';
$args = func_get_args();
$search = implode('/', $args);
if (strlen($search) < 2) {
$search .= '*';
}
else {
$search = "*{$search}*";
}
$data_blocks = Frx::DataFile()
->userBlocks($search);
if ($data_blocks) {
$temp = array_keys($data_blocks);
$data_blocks = array_combine($temp, $temp);
}
else {
$data_blocks = array();
}
print drupal_json_output($data_blocks);
}