/** * _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; }
/** * 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; } } } }
/** * _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; }