web/request.py
changeset 7277 acd7f0e9f276
parent 7273 a949fc438029
child 7278 1144a2d90314
equal deleted inserted replaced
7276:f9a68136eb87 7277:acd7f0e9f276
    90             self.datadir_url = vreg.config.https_datadir_url
    90             self.datadir_url = vreg.config.https_datadir_url
    91         else:
    91         else:
    92             self.uiprops = vreg.config.uiprops
    92             self.uiprops = vreg.config.uiprops
    93             self.datadir_url = vreg.config.datadir_url
    93             self.datadir_url = vreg.config.datadir_url
    94         # raw html headers that can be added from any view
    94         # raw html headers that can be added from any view
    95         self.html_headers = HTMLHead()
    95         self.html_headers = HTMLHead(self.datadir_url)
    96         # form parameters
    96         # form parameters
    97         self.setup_params(form)
    97         self.setup_params(form)
    98         # dictionnary that may be used to store request data that has to be
    98         # dictionnary that may be used to store request data that has to be
    99         # shared among various components used to publish the request (views,
    99         # shared among various components used to publish the request (views,
   100         # controller, application...)
   100         # controller, application...)
   256 
   256 
   257     def reset_headers(self):
   257     def reset_headers(self):
   258         """used by AutomaticWebTest to clear html headers between tests on
   258         """used by AutomaticWebTest to clear html headers between tests on
   259         the same resultset
   259         the same resultset
   260         """
   260         """
   261         self.html_headers = HTMLHead()
   261         self.html_headers = HTMLHead(self.datadir_url)
   262         return self
   262         return self
   263 
   263 
   264     # web state helpers #######################################################
   264     # web state helpers #######################################################
   265 
   265 
   266     @property
   266     @property
   415 
   415 
   416     # web edition helpers #####################################################
   416     # web edition helpers #####################################################
   417 
   417 
   418     @cached # so it's writed only once
   418     @cached # so it's writed only once
   419     def fckeditor_config(self):
   419     def fckeditor_config(self):
   420         self.add_js('fckeditor/fckeditor.js')
   420         fckeditor_url = self.build_url('fckeditor/fckeditor.js')
       
   421         self.add_js(fckeditor_url, localfile=False)
   421         self.html_headers.define_var('fcklang', self.lang)
   422         self.html_headers.define_var('fcklang', self.lang)
   422         self.html_headers.define_var('fckconfigpath',
   423         self.html_headers.define_var('fckconfigpath',
   423                                      self.data_url('cubicweb.fckcwconfig.js'))
   424                                      self.data_url('cubicweb.fckcwconfig.js'))
   424     def use_fckeditor(self):
   425     def use_fckeditor(self):
   425         return self.vreg.config.fckeditor_installed() and self.property_value('ui.fckeditor')
   426         return self.vreg.config.fckeditor_installed() and self.property_value('ui.fckeditor')