/** * @see FWS_Document_Renderer_HTML_Default::before_render() */ protected function before_render() { $tpl = FWS_Props::get()->tpl(); $doc = FWS_Props::get()->doc(); $msgs = FWS_Props::get()->msgs(); $js = FWS_Javascript::get_instance(); $js->set_cache_folder('cache'); $tpl->add_global_ref('gjs', $js); $tpl->add_allowed_method('gjs', 'get_file'); $url = new PC_URL(); $tpl->add_global_ref('gurl', $url); $tpl->add_allowed_method('gurl', 'build_mod_url'); $tpl->add_allowed_method('gurl', 'build_submod_url'); // add redirect information $redirect = $doc->get_redirect(); if ($redirect) { $tpl->add_variable_ref('redirect', $redirect, 'inc_header.htm'); } // notify the template if an error has occurred $tpl->add_global('module_error', $doc->get_module()->error_occurred()); $action_result = $this->get_action_result(); $tpl->add_global('action_result', $action_result); // add messages if ($msgs->contains_msg()) { $this->handle_msgs($msgs); } }
/** * @see FWS_Document_Renderer_HTML_Default::before_render() */ protected final function before_render() { $tpl = FWS_Props::get()->tpl(); $msgs = FWS_Props::get()->msgs(); $locale = FWS_Props::get()->locale(); $doc = FWS_Props::get()->doc(); $user = FWS_Props::get()->user(); // add redirect information $redirect = $doc->get_redirect(); if ($redirect) { $tpl->add_variable_ref('redirect', $redirect, 'inc_header.htm'); } // notify the template if an error has occurred $tpl->add_global('module_error', !$this->has_access() || $doc->get_module()->error_occurred()); if (!$this->has_access()) { $msgs->add_error($locale->_('You don\'t have access to this module!')); } // add global variables $action_result = $this->get_action_result(); $tpl->add_global('action_result', $action_result); $tpl->add_global('path', FWS_Path::client_app()); $tpl->add_global('fwspath', FWS_Path::client_fw()); // add objects $js = FWS_Javascript::get_instance(); $js->set_cache_folder('cache/'); $js->set_shrink(false); $tpl->add_global_ref('js', $js); $url = new TDL_URL(); $tpl->add_global_ref('url', $url); $tpl->add_global_ref('locale', $locale); $tpl->add_global_ref('user', $user); // set callable methods $tpl->add_allowed_method('url', 'simple_url'); $tpl->add_allowed_method('js', 'get_file'); $tpl->add_allowed_method('locale', '*'); $tpl->add_allowed_method('user', 'get_theme_item_path'); // add messages if ($msgs->contains_msg()) { $this->_handle_msgs($msgs); } }