private function statspro::get_calc_fields in Statistics Pro 6
Same name and namespace in other branches
- 6.2 statspro.inc \StatsPro::get_calc_fields()
1 call to statspro::get_calc_fields()
- statspro::get_stats in ./
statspro.inc - Get statictics for output.
File
- ./
statspro.inc, line 61 - statspro class for statistics pro module.
Class
- statspro
- Manages the data saving and retrieval according to the user defined parameters.
Code
private function get_calc_fields($whitelist, $blacklist) {
if (is_array($whitelist) && is_array($blacklist)) {
die('whitelist and blacklist cannot be used togther.');
}
elseif (is_array($whitelist)) {
$fields = array();
foreach ($this->fields as $field => $desc) {
if (in_array($field, $whitelist)) {
$fields[$field] = $desc;
}
}
}
elseif (is_array($blacklist)) {
$fields = array();
foreach ($this->fields as $field => $desc) {
if (!in_array($field, $blacklist)) {
$fields[$field] = $desc;
}
}
}
else {
// all fields
$fields = $this->fields;
}
return $fields;
}