/** * Retreives the options array required to set up a report according to the default * report parameters. * @param string $args * @param <type> $readAuth * @return string */ private static function get_report_calendar_options($args, $readAuth) { self::$siteUrlParams = array(self::$locationKey => array('name' => self::$locationKey, 'value' => isset($_GET[self::$locationKey]) ? $_GET[self::$locationKey] : null)); $presets = get_options_array_with_user_data($args['param_presets']); $reportOptions = array('id' => 'report-grid', 'dataSource' => $args['report_name'], 'mode' => 'report', 'readAuth' => $readAuth, 'extraParams' => $presets); if (self::$siteUrlParams[self::$locationKey]['value'] != null) { $reportOptions['extraParams']['location_id'] = self::$siteUrlParams[self::$locationKey]['value']; } return $reportOptions; }
/** * Get the parameters required for the current filter. */ private static function get_site_url_params() { if (!self::$siteUrlParams) { self::$siteUrlParams = array(self::$locationKey => array('name' => self::$locationKey, 'value' => isset($_GET[self::$locationKey]) ? $_GET[self::$locationKey] : ''), self::$locationTypeKey => array('name' => self::$locationTypeKey, 'value' => isset($_GET[self::$locationTypeKey]) ? $_GET[self::$locationTypeKey] : ''), self::$yearKey => array('name' => self::$yearKey, 'value' => isset($_GET[self::$yearKey]) ? $_GET[self::$yearKey] : date('Y')), self::$SurveyKey => array('name' => self::$SurveyKey, 'value' => ''), self::$URLExtensionKey => array('name' => self::$URLExtensionKey, 'value' => '')); } return self::$siteUrlParams; }