(no commit message)
[ikiwiki.git] / doc / todo / Allow_disabling_edit_and_preferences_links.mdwn
1 This patch allows disabling the edit and preferences link in the config file.  It is backwards compatible (so peoples edit and preferences links won't suddenly vanish).
2
3 To disable edit or prefs respectively, add the following to the config file:
4
5 <pre>
6   'edit' => 0,
7   'prefs' => 0, 
8 </pre>
9
10 Patch:
11 <pre>
12 --- /usr/share/perl5/IkiWiki/Render.pm.orig     2008-12-23 16:49:00.000000000 +1300
13 +++ /usr/share/perl5/IkiWiki/Render.pm  2008-12-23 16:55:40.000000000 +1300
14 @@ -80,8 +80,10 @@
15         my $actions=0;
16  
17         if (length $config{cgiurl}) {
18 -               $template->param(editurl => cgiurl(do => "edit", page => $page));
19 -               $template->param(prefsurl => cgiurl(do => "prefs"));
20 +               $template->param(editurl => cgiurl(do => "edit", page => $page))
21 +                       if ! defined $config{edit} || (defined $config{edit} && $config{edit} == 1);
22 +               $template->param(prefsurl => cgiurl(do => "prefs"))
23 +                       if ! defined $config{prefs} || (defined $config{prefs} && $config{prefs} == 1);
24                 $actions++;
25         }
26
27 </pre>