Beispiel #1
0
 /**
  * @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);
     }
 }