205 'default': 25, |
205 'default': 25, |
206 'help': 'Font size to use for captcha image generation (you must \ |
206 'help': 'Font size to use for captcha image generation (you must \ |
207 have the python imaging library installed to use captcha)', |
207 have the python imaging library installed to use captcha)', |
208 'group': 'web', 'level': 3, |
208 'group': 'web', 'level': 3, |
209 }), |
209 }), |
|
210 |
|
211 ('use-old-css', |
|
212 {'type' : 'yn', |
|
213 'default': True, |
|
214 'help': 'use cubicweb.old.css instead of 3.9 cubicweb.css', |
|
215 'group': 'web', 'level': 2, |
|
216 }), |
|
217 |
210 |
218 |
211 )) |
219 )) |
212 |
220 |
213 def fckeditor_installed(self): |
221 def fckeditor_installed(self): |
214 return exists(self.uiprops['FCKEDITOR_PATH']) |
222 return exists(self.uiprops['FCKEDITOR_PATH']) |
336 libuiprops = join(self.shared_dir(), 'data', 'uiprops.py') |
344 libuiprops = join(self.shared_dir(), 'data', 'uiprops.py') |
337 uiprops.load(libuiprops) |
345 uiprops.load(libuiprops) |
338 for path in reversed([self.apphome] + self.cubes_path()): |
346 for path in reversed([self.apphome] + self.cubes_path()): |
339 self._load_ui_properties_file(uiprops, path) |
347 self._load_ui_properties_file(uiprops, path) |
340 self._load_ui_properties_file(uiprops, self.apphome) |
348 self._load_ui_properties_file(uiprops, self.apphome) |
|
349 # XXX pre 3.9 css compat |
|
350 if self['use-old-css']: |
|
351 datadir_url = uiprops.context['datadir_url'] |
|
352 if (datadir_url+'/cubicweb.css') in uiprops['STYLESHEETS']: |
|
353 idx = uiprops['STYLESHEETS'].index(datadir_url+'/cubicweb.css') |
|
354 uiprops['STYLESHEETS'][idx] = datadir_url+'/cubicweb.old.css' |
|
355 if datadir_url+'/cubicweb.reset.css' in uiprops['STYLESHEETS']: |
|
356 uiprops['STYLESHEETS'].remove(datadir_url+'/cubicweb.reset.css') |
341 |
357 |
342 def _load_ui_properties_file(self, uiprops, path): |
358 def _load_ui_properties_file(self, uiprops, path): |
343 resourcesfile = join(path, 'data', 'external_resources') |
359 resourcesfile = join(path, 'data', 'external_resources') |
344 if exists(resourcesfile): |
360 if exists(resourcesfile): |
345 warn('[3.9] %s file is deprecated, use an uiprops.py file' |
361 warn('[3.9] %s file is deprecated, use an uiprops.py file' |