diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-03-11 02:14:46 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-03-11 02:14:46 +0000 |
commit | 7c388ceeb1233d2dec6c69299fdbf060ba6a0c09 (patch) | |
tree | df1b051d2c916c70a22db7a8a2c943de403a16ec | |
parent | 9703ce7500e4519d3db4f8af758fda258a0ac6a3 (diff) |
foo
-rwxr-xr-x | ikiwiki | 19 |
1 files changed, 8 insertions, 11 deletions
@@ -597,7 +597,6 @@ sub cgi () { } my @page_locs; - my $default_loc=""; my ($from)=$q->param('from')=~/$wiki_file_regexp/; if (! defined $from || ! length $from || $from ne $q->param('from') || @@ -605,14 +604,14 @@ sub cgi () { @page_locs=$page; } else { - @page_locs="$from/$page"; - $from=dirname($from); - $default_loc="$from/$page"; - while (length $from) { - push @page_locs, "$from/$page"; - $from=dirname($from); + my $dir=$from."/"; + $dir=~s/[^/]+\/$//; + push @page_locs, $dir.$page; + push @page_locs, "$from/$page"; + while (length $dir) { + $dir=~s/[^/]+\/$//; + push @page_locs, $dir.$page; } - push @page_locs, $page; } $q->param("do", "save"); @@ -622,9 +621,7 @@ sub cgi () { $q->start_form(-action => $action), $q->hidden('do'), "Select page location:", - $q->popup_menu(-name => 'page', - -values => \@page_locs, - -default => $default_loc), + $q->popup_menu('page', \@page_locs), $q->textarea(-name => 'content', -default => "", -rows => 20, |