From 7151777d9b95a57611637f702eb90b26d3e07b6b Mon Sep 17 00:00:00 2001 From: Uriel Date: Sun, 8 Feb 2009 00:22:46 +0000 Subject: [PATCH] Add conf_enable_app to add items to $enabled_apps, used from conf_enable_xxx functions so one doesn't need to both add stuff to $eanbled_apps and then call conf_enable_xxx, and to avoid enabling the same app twice. New conf_enable_wiki function to follow the interface of other apps. --- apps/blagh/app.rc | 1 + apps/bridge/app.rc | 1 + apps/dirdir/app.rc | 9 ++++++++- bin/wercconf.rc | 7 +++++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/apps/blagh/app.rc b/apps/blagh/app.rc index 035a7db..7321c15 100644 --- a/apps/blagh/app.rc +++ b/apps/blagh/app.rc @@ -3,6 +3,7 @@ fn conf_enable_blog { blagh_dirs=$* if(~ $#blagh_dirs 0) blagh_dirs=( . ) + conf_enable_app blagh } fn blagh_init { diff --git a/apps/bridge/app.rc b/apps/bridge/app.rc index b196d99..2d41821 100644 --- a/apps/bridge/app.rc +++ b/apps/bridge/app.rc @@ -7,6 +7,7 @@ fn conf_enable_comments { } enable_comments=yes groups_allowed_comments=$* + conf_enable_app bridge } fn bridge_init { diff --git a/apps/dirdir/app.rc b/apps/dirdir/app.rc index 2a6df1f..c7416e1 100644 --- a/apps/dirdir/app.rc +++ b/apps/dirdir/app.rc @@ -1,5 +1,12 @@ +fn conf_enable_wiki { + enable_wiki=yes + wiki_editors_group=$* + conf_enable_app dirdir +} + + fn dirdir_init { - if(! ~ $#enable_wiki 0 && check_user $wiki_editors_group admin) { + if(! ~ $#enable_wiki 0 && check_user $wiki_editors_group) { if(test -f $local_path.md) ll_add handlers_bar_left dirdir_controls diff --git a/bin/wercconf.rc b/bin/wercconf.rc index 2855b9c..083db4f 100644 --- a/bin/wercconf.rc +++ b/bin/wercconf.rc @@ -10,3 +10,10 @@ fn conf_hide_paths { for(i in $*) dirfilter=$dirfilter^'/'^`{echo $i|sed 's!/!\\/!g'}^'/d; ' } + +# Usually will be called from within conf_enable_foo +fn conf_enable_app { + # Note: maybe we should add test -d apps/$1/? + if(! ~ $1 $enabled_apps) + enabled_apps=( $enabled_apps $1 ) +}