Déplacement pour eggification.
[Plinn.git] / Products / Plinn / skins / control / getOrSetSessionVar.py
diff --git a/Products/Plinn/skins/control/getOrSetSessionVar.py b/Products/Plinn/skins/control/getOrSetSessionVar.py
new file mode 100644 (file)
index 0000000..5964c04
--- /dev/null
@@ -0,0 +1,11 @@
+##parameters=key, value=None, default=None
+sd = context.session_data_manager.getSessionData(create = 1)
+if value is None :
+       sVar = sd.get(key, None)
+       if sVar is None and default is not None :
+               sVar = default
+else :
+       sVar = value
+
+sd[key] = sVar
+return sVar