/** * A Flexy helper method to return the value of a field for display. * * Overrides the parent Flexy helper method so that it can deal with * displaying warnings for average calculations, etc. * * @param array $aArray An array of items. * @param string $k The index name of the item to display. * @return mixed The item to display. */ function showValue($aArray, $k) { if ($k == 'average') { if ($aArray[$k] === true || is_numeric($aArray[$k]) && $aArray[$k] > 0) { self::$averagedColumnDisplayed = true; return '<img src="' . OX::assetPath() . '/images/warning.gif" width="16 height="16" alt="" title="" />'; } else { if (preg_match('/light$/', $aArray[$k])) { return parent::showValue($aArray, $k); } else { if (preg_match('/dark$/', $aArray[$k])) { return parent::showValue($aArray, $k); } else { return '-'; } } } } else { return parent::showValue($aArray, $k); } }
/** * A PHP5-style constructor that can be used to perform common * class instantiation by children classes. * * @param array $aParams An array of parameters. The array should * be indexed by the name of object variables, * with the values that those variables should * be set to. For example, the parameter: * $aParams = array('foo' => 'bar') * would result in $this->foo = bar. */ function __construct($aParams) { // Set the output type & template directory for targeting statistcs $this->outputType = 'targetingHistory'; $this->templateDir = MAX_PATH . '/lib/OA/Admin/Statistics/Targeting/themes/'; // Get list order and direction $this->listOrderField = MAX_getStoredValue('listorder', 'key'); $this->listOrderDirection = MAX_getStoredValue('orderdirection', 'down'); // Ensure the history class is prepared $this->useHistoryClass = true; // Disable graphs in targeting pages $this->aGraphData = array('noGraph' => true); parent::__construct($aParams); // Store the preferences $this->aPagePrefs['listorder'] = $this->listOrderField; $this->aPagePrefs['orderdirection'] = $this->listOrderDirection; }