function _forena_filter_process in Forena Reports 7.4
Same name and namespace in other branches
- 8 forena.module \_forena_filter_process()
- 6.2 forena.module \_forena_filter_process()
- 6 forena.module \_forena_filter_process()
- 7.5 forena.module \_forena_filter_process()
- 7 forena.module \_forena_filter_process()
- 7.2 forena.module \_forena_filter_process()
- 7.3 forena.module \_forena_filter_process()
Process tag replacement for xml filters
1 string reference to '_forena_filter_process'
- forena_filter_info in ./
forena.module - Implememntation of hook_filter
File
- ./
forena.module, line 1519
Code
function _forena_filter_process($text = '') {
require_once 'forena.admin.inc';
global $language;
// initial Parameters
$in_parms = Frx::Data()
->getContext('parm');
if (!$in_parms) {
$parms = $_GET;
}
// Find the instances of [xmlreport:view,
if (preg_match_all("/\\[report?:?([^\\]]+)\\]/i", $text, $match)) {
foreach ($match[1] as $idx => $value) {
$parms = $in_parms;
// Separate view from parmeters
@(list($report_name, $parmsStr) = explode(':', $value));
// Get any static parmeters
$pairs = explode(',', $parmsStr);
if ($pairs) {
foreach ($pairs as $pair) {
@(list($key, $value) = explode('=', $pair));
if ($key) {
$parms[$key] = $value;
}
}
}
// Render it
$output = forena_report($report_name, $parms, FALSE);
// Finally replace the parameters
$find[] = $match[0][$idx];
$replace[] = $output;
}
return str_replace($find, $replace, $text);
}
// If we didn't find anything return the text.
return $text;
}