commit 11a55a987015fb870342b7bfbd23cdeec9363f03 parent a1562f1eeedb8005546fac95dc00ced7b4c1fb33 Author: uriel@engel.se.cat-v.org <unknown> Date: Sat, 14 Mar 2009 14:25:54 +0100 Clean up dirdir, less code, and less bugs! Diffstat:
M | apps/dirdir/app.rc | | | 29 | ++++++----------------------- |
1 file changed, 6 insertions(+), 23 deletions(-)
diff --git a/apps/dirdir/app.rc b/apps/dirdir/app.rc @@ -8,32 +8,15 @@ fn dirdir_init { if(! ~ $#enable_wiki 0 && check_user $wiki_editors_groups) { dirdir_file=$local_path.md dirdir_dir=$dirdir_file^'_werc/dirdir/' - - if(test -f $local_path.md) { - if(~ $#post_arg_dirdir_save 1 && ! ~ $"post_arg_edit_text '') - save_page + + if(~ 1 $#post_arg_dirdir_edit $#post_arg_dirdir_preview) + handler_body_main=(tpl_handler `{get_lib_file dirdir/edit.tpl apps/dirdir/edit.tpl}) - if not if(~ 1 $#post_arg_dirdir_edit $#post_arg_dirdir_preview) - handler_body_main=(tpl_handler \ - `{get_lib_file dirdir/edit.tpl apps/dirdir/edit.tpl}) - - if not if(! ~ $REQUEST_METHOD POST) - ll_add handlers_bar_left tpl_handler \ - apps/dirdir/sidebar_controls.tpl - } - - if not if(~ 1 $#post_arg_dirdir_edit) - handler_body_main=(tpl_handler \ - `{get_lib_file dirdir/edit.tpl apps/dirdir/edit.tpl}) - - if not if(~ 1 $#post_arg_dirdir_save) { - mkdir -p `{basename -d $local_path} + if not if(! ~ '' $"post_arg_dirdir_save $"post_arg_edit_text) save_page - } - if not if(~ $"handler_body_main '') - ll_add handlers_bar_left tpl_handler \ - apps/dirdir/sidebar_controls.tpl + if not if(~ $"handler_body_main '' || {~ $REQUEST_METHOD GET && test -f $local_path.md}) + ll_add handlers_bar_left tpl_handler apps/dirdir/sidebar_controls.tpl } }