/** * process_request function * * Initialize/validate custom request array, based on contents of $_REQUEST, * to keep track of this component's request variables. * * @return void **/ private function process_request() { global $ai1ec_settings; $this->request = Ai1ec_Routing_Factory::create_argument_parser_instance(); if (!is_admin() && $ai1ec_settings->calendar_page_id && is_page($ai1ec_settings->calendar_page_id)) { foreach (array('cat', 'tag') as $name) { $implosion = $this->_add_defaults($name); if ($implosion) { $this->request['ai1ec_' . $name . '_ids'] = $implosion; $_REQUEST['ai1ec_' . $name . '_ids'] = $implosion; } } } }
/** * @param Ai1ec_Settings $ai1ec_settings */ public static function set_ai1ec_settings($ai1ec_settings) { Ai1ec_Routing_Factory::$ai1ec_settings = $ai1ec_settings; }
/** * _get_view_and_restore_globals method * * Set global request ($_REQUEST) variables, call rendering routines * and reset $_REQUEST afterwards. * * @uses do_action To launch * 'ai1ec_load_frontend_js' action * * @param array $arguments Arguments to set for rendering * * @return string Rendered view */ protected function _get_view_and_restore_globals($arguments) { global $ai1ec_calendar_controller, $ai1ec_app_controller, $ai1ec_settings; $ai1ec_router = Ai1ec_Router::instance(); $cookie_dto = $ai1ec_router->get_cookie_set_dto(); if (true === $cookie_dto->get_is_cookie_set_for_shortcode()) { $cookie = $cookie_dto->get_shortcode_cookie(); $cookie_for_shortcode = array(); foreach (Ai1ec_Cookie_Utility::$types as $type) { $cookie_for_shortcode[$type] = implode(',', $cookie[$type]); } // in the cookie i save an array with action. tag_ids and cat_ids. // if something is saved, we use that $arguments = $cookie_for_shortcode + $arguments; } $request = Ai1ec_Routing_Factory::create_argument_parser_instance($arguments); $page_content = $ai1ec_calendar_controller->get_calendar_page($request); // Load requirejs for the calendar do_action('ai1ec_load_frontend_js', true, true); return $page_content; }
/** * _get_view_and_restore_globals method * * Set global request ($_REQUEST) variables, call rendering routines * and reset $_REQUEST afterwards. * * @uses do_action To launch * 'ai1ec_load_frontend_js' action * * @param array $arguments Arguments to set for rendering * * @return string Rendered view */ protected function _get_view_and_restore_globals($arguments) { global $ai1ec_calendar_controller, $ai1ec_app_controller, $ai1ec_settings; $request = Ai1ec_Routing_Factory::create_argument_parser_instance($arguments); $page_content = $ai1ec_calendar_controller->get_calendar_page($request); // Load requirejs for the calendar do_action('ai1ec_load_frontend_js', true); return $page_content; }
// parameter disable compression, until reversing change // is made. Causative issue: AIOEC-1192. if (isset($_REQUEST['ai1ec_disable_gzip_compression'])) { $ai1ec_settings->disable_gzip_compression = true; $ai1ec_settings->save(); } // This is a fix for AIOEC-73. I need to set those values as soon as possible so that // the platofrom controller has the fresh data and can act accordingly // I do not trigger the save action at this point because there are too many things going on // there and i might break things if (isset($_POST['ai1ec_save_settings'])) { $ai1ec_settings->event_platform = isset($_POST['event_platform']); $ai1ec_settings->event_platform_strict = isset($_POST['event_platform_strict']); } // Set up the Routing Factory Ai1ec_Routing_Factory::set_ai1ec_settings($ai1ec_settings); // ================================ // = Initialize and setup HELPERS = // ================================ global $ai1ec_view_helper, $ai1ec_settings_helper, $ai1ec_calendar_helper, $ai1ec_app_helper, $ai1ec_events_helper, $ai1ec_importer_helper, $ai1ec_exporter_helper, $ai1ec_platform_helper, $ai1ec_localization_helper, $ai1ec_importer_plugin_helper, $ai1ec_events_list_helper; $ai1ec_view_helper = Ai1ec_View_Helper::get_instance(); $ai1ec_settings_helper = Ai1ec_Settings_Helper::get_instance(); $ai1ec_calendar_helper = Ai1ec_Calendar_Helper::get_instance(); $ai1ec_app_helper = Ai1ec_App_Helper::get_instance(); $ai1ec_events_helper = Ai1ec_Events_Helper::get_instance(); $ai1ec_importer_helper = Ai1ec_Importer_Helper::get_instance(); $ai1ec_exporter_helper = Ai1ec_Exporter_Helper::get_instance(); $ai1ec_platform_helper = Ai1ec_Platform_Helper::get_instance(); $ai1ec_localization_helper = Ai1ec_Localization_Helper::get_instance(); $ai1ec_importer_plugin_helper = Ai1ec_Importer_Plugin_Helper::get_instance(); $ai1ec_events_list_helper = Ai1ec_Events_List_Helper::get_instance();