Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/units/reports/reports_tag_processor.php
Show First 20 Lines • Show All 79 Lines • ▼ Show 20 Line(s) | |||||
} | } | ||||
function ReportTypeEquals($params) | function ReportTypeEquals($params) | ||||
{ | { | ||||
$field_values = unserialize($this->Application->RecallVar('report_options')); | $field_values = unserialize($this->Application->RecallVar('report_options')); | ||||
return ($field_values['ReportType'] == $params['value']); | return ($field_values['ReportType'] == $params['value']); | ||||
} | } | ||||
/** | |||||
* Returns report option value. | |||||
* | |||||
* @param array $params Tag params. | |||||
* | |||||
* @return string | |||||
*/ | |||||
protected function ReportOptionValue(array $params) | |||||
{ | |||||
$field_values = unserialize($this->Application->RecallVar('report_options')); | |||||
return $field_values[$params['name']]; | |||||
} | |||||
/** | |||||
* Replaces "IDField" unit config option to be inline with current report | |||||
* | |||||
* @param array $params Tag params. | |||||
* | |||||
* @return string | |||||
*/ | |||||
protected function SyncIDFieldDeclaration(array $params) | |||||
{ | |||||
$field_values = unserialize($this->Application->RecallVar('report_options')); | |||||
$this->Application->setUnitOption($this->Prefix, 'IDField', $field_values['id_field']); | |||||
return ''; | |||||
} | |||||
function CalculateChart($params) | function CalculateChart($params) | ||||
{ | { | ||||
$a_report_options = unserialize($this->Application->RecallVar('report_options')); | $a_report_options = unserialize($this->Application->RecallVar('report_options')); | ||||
$metric = $this->Application->RecallVar('ChartMetric'); | $metric = $this->Application->RecallVar('ChartMetric'); | ||||
if ($metric == '') | if ($metric == '') | ||||
{ | { | ||||
// get first option from unit config | // get first option from unit config | ||||
▲ Show 20 Lines • Show All 334 Lines • ▼ Show 20 Line(s) | |||||
return rand(1,10000000); | return rand(1,10000000); | ||||
} | } | ||||
function IsPHPxOrGreater($params) | function IsPHPxOrGreater($params) | ||||
{ | { | ||||
$curver = explode(".", phpversion()); | $curver = explode(".", phpversion()); | ||||
return ($curver[0] >= $params['version']); | return ($curver[0] >= $params['version']); | ||||
} | } | ||||
} | } | ||||
No newline at end of file |