X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=Rakka%2FSystemConfig.hs;h=11fe124a155a62c4bcb4f8b4b28601f3804aca59;hb=354a3b69406608a2570060bdbdbc65e83260c8ff;hp=eb526fbc45939a6863d2fc139fd2a45876f8138c;hpb=0447be1b59496ca4266226ed52d264009cf41899;p=Rakka.git diff --git a/Rakka/SystemConfig.hs b/Rakka/SystemConfig.hs index eb526fb..11fe124 100644 --- a/Rakka/SystemConfig.hs +++ b/Rakka/SystemConfig.hs @@ -12,6 +12,7 @@ module Rakka.SystemConfig , DefaultPage(..) , StyleSheet(..) , Languages(..) + , GlobalLock(..) , serializeStringPairs , deserializeStringPairs @@ -209,3 +210,15 @@ instance SysConfValue Languages where , ("pt", "Português") , ("sv", "Svenska" ) ] + + +newtype GlobalLock = GlobalLock Bool deriving (Show, Typeable) +instance SysConfValue GlobalLock where + confPath _ = "globalLock" + serialize (GlobalLock isLocked) + | isLocked = "*" + | otherwise = "" + deserialize "*" = Just (GlobalLock True) + deserialize "" = Just (GlobalLock False) + deserialize _ = Nothing + defaultValue _ = GlobalLock False