From 5380b86d6f3f8269f3d96a5513130ebf3226e8ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 25 Jan 2016 19:05:08 +0100 Subject: [PATCH] misc: add a is_in_backoffice substitution variable (#9752) --- help/fr/misc-substvars.page | 4 ++++ wcs/qommon/publisher.py | 1 + 2 files changed, 5 insertions(+) diff --git a/help/fr/misc-substvars.page b/help/fr/misc-substvars.page index 0fc3e8d..7d4a153 100644 --- a/help/fr/misc-substvars.page +++ b/help/fr/misc-substvars.page @@ -70,6 +70,10 @@ champs, etc.

session_user_email

L'adresse électronique de l'utilisateur connecté

+ +

is_in_backoffice

+

Vrai si la requête en cours a lieu dans le backoffice

+

diff --git a/wcs/qommon/publisher.py b/wcs/qommon/publisher.py index 32150b3..9526dff 100644 --- a/wcs/qommon/publisher.py +++ b/wcs/qommon/publisher.py @@ -967,6 +967,7 @@ class QommonPublisher(Publisher): 'site_lang': (get_request() and hasattr(get_request(), 'language') and get_request().language) or 'en', 'today': strftime.strftime(misc.date_format(), time.localtime()), 'now': misc.localstrftime(time.localtime()), + 'is_in_backoffice': (self.get_request() and self.get_request().is_in_backoffice()), } if self.site_options is None: self.load_site_options() -- 2.7.0