def __init__(self, plugin_manager, user_manager, default_template_dir, default_layout, default_layout_lti, use_minified=True):
        """
        Init the Template Helper
        :param plugin_manager: an instance of a PluginManager
        :param user_manager: an instance of UserManager. Can be None; in this case, LTI layout detection will never be used.
        :param default_template_dir: the path to the template dir. If it is not absolute, it will be taken from the root of the inginious package.
        :param default_layout: the path to the layout. If it is not absolute, it will be taken from the root of the inginious package.
        :param default_layout_lti: same but for the lti layout
        :param use_minified: weither to use minified js/css or not. Use True in production, False in dev envs.
        """

        self._base_helpers = {"header_hook": (lambda **kwargs: self._generic_hook('header_html', **kwargs)),
                              "main_menu": (lambda **kwargs: self._generic_hook('main_menu', **kwargs)),
                              "course_menu": (lambda **kwargs: self._generic_hook('course_menu', **kwargs)),
                              "task_menu": (lambda **kwargs: self._generic_hook('task_menu', **kwargs)),
                              "welcome_text": (lambda **kwargs: self._generic_hook('welcome_text', **kwargs)),
                              "javascript_header": (lambda **_: self._javascript_helper("header")),
                              "javascript_footer": (lambda **_: self._javascript_helper("footer")),
                              "css": (lambda **_: self._css_helper())}
        self._plugin_manager = plugin_manager
        self._template_dir = default_template_dir
        self._user_manager = user_manager # can be None!
        self._layout = default_layout
        self._layout_lti = default_layout_lti

        self._template_globals = {}

        self._default_renderer = self.get_custom_renderer(default_template_dir)
        self._default_renderer_lti = self.get_custom_renderer(default_template_dir, layout = self._layout_lti)
        self._default_renderer_nolayout = self.get_custom_renderer(default_template_dir, layout=False)

        self.add_to_template_globals("include", self._default_renderer_nolayout)
        self.add_to_template_globals("template_helper", self)
        self.add_to_template_globals("plugin_manager", plugin_manager)
        self.add_to_template_globals("use_minified", use_minified)
        self.add_to_template_globals("is_lti", self.is_lti)
        self.add_to_template_globals("json", self._json_safe_dump)
def __init__ ( self , plugin_manager , user_manager , default_template_dir , default_layout , default_layout_lti , use_minified = True ) : self . _base_helpers = { "header_hook" : ( lambda ** kwargs : self . _generic_hook ( 'header_html' , ** kwargs ) ) , "main_menu" : ( lambda ** kwargs : self . _generic_hook ( 'main_menu' , ** kwargs ) ) , "course_menu" : ( lambda ** kwargs : self . _generic_hook ( 'course_menu' , ** kwargs ) ) , "task_menu" : ( lambda ** kwargs : self . _generic_hook ( 'task_menu' , ** kwargs ) ) , "welcome_text" : ( lambda ** kwargs : self . _generic_hook ( 'welcome_text' , ** kwargs ) ) , "javascript_header" : ( lambda ** _ : self . _javascript_helper ( "header" ) ) , "javascript_footer" : ( lambda ** _ : self . _javascript_helper ( "footer" ) ) , "css" : ( lambda ** _ : self . _css_helper ( ) ) } self . _plugin_manager = plugin_manager self . _template_dir = default_template_dir self . _user_manager = user_manager self . _layout = default_layout self . _layout_lti = default_layout_lti self . _template_globals = { } self . _default_renderer = self . get_custom_renderer ( default_template_dir ) self . _default_renderer_lti = self . get_custom_renderer ( default_template_dir , layout = self . _layout_lti ) self . _default_renderer_nolayout = self . get_custom_renderer ( default_template_dir , layout = False ) self . add_to_template_globals ( "include" , self . _default_renderer_nolayout ) self . add_to_template_globals ( "template_helper" , self ) self . add_to_template_globals ( "plugin_manager" , plugin_manager ) self . add_to_template_globals ( "use_minified" , use_minified ) self . add_to_template_globals ( "is_lti" , self . is_lti ) self . add_to_template_globals ( "json" , self . _json_safe_dump )
Init the Template Helper
        :param plugin_manager: an instance of a PluginManager
        :param user_manager: an instance of UserManager. Can be None; in this case, LTI layout detection will never be used.
        :param default_template_dir: the path to the template dir. If it is not absolute, it will be taken from the root of the inginious package.
        :param default_layout: the path to the layout. If it is not absolute, it will be taken from the root of the inginious package.
        :param default_layout_lti: same but for the lti layout
        :param use_minified: weither to use minified js/css or not. Use True in production, False in dev envs.