]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
hide deprecated values if empty after save
[ikiwiki.git] / IkiWiki.pm
index a138ac8bf487f5fda1eb421a30c4dbcea2e104f6..bfa85343d26e173d6648fc9da2314a8202903629 100644 (file)
@@ -115,7 +115,7 @@ sub getsetup () { #{{{
                                openid signinedit lockedit conditional
                                recentchanges parentlinks}],
                description => "plugins to enable by default",
-               safe => 1,
+               safe => 0,
                rebuild => 1,
        },
        add_plugins => {
@@ -412,16 +412,6 @@ sub checkconfig () { #{{{
        
        $config{wikistatedir}="$config{srcdir}/.ikiwiki"
                unless exists $config{wikistatedir};
-       
-       if ($config{rcs}) {
-               eval qq{use IkiWiki::Rcs::$config{rcs}};
-               if ($@) {
-                       error("Failed to load RCS module IkiWiki::Rcs::$config{rcs}: $@");
-               }
-       }
-       else {
-               require IkiWiki::Rcs::Stub;
-       }
 
        if (defined $config{umask}) {
                umask(possibly_foolish_untaint($config{umask}));
@@ -436,14 +426,14 @@ sub listplugins () { #{{{
        my %ret;
 
        foreach my $dir (@INC, $config{libdir}) {
-               next unless defined $dir;
+               next unless defined $dir && length $dir;
                foreach my $file (glob("$dir/IkiWiki/Plugin/*.pm")) {
                        my ($plugin)=$file=~/.*\/(.*)\.pm$/;
                        $ret{$plugin}=1;
                }
        }
        foreach my $dir ($config{libdir}, "$installdir/lib/ikiwiki") {
-               next unless defined $dir;
+               next unless defined $dir && length $dir;
                foreach my $file (glob("$dir/plugins/*")) {
                        $ret{basename($file)}=1 if -x $file;
                }
@@ -453,11 +443,21 @@ sub listplugins () { #{{{
 } #}}}
 
 sub loadplugins () { #{{{
-       if (defined $config{libdir}) {
+       if (defined $config{libdir} && length $config{libdir}) {
                unshift @INC, possibly_foolish_untaint($config{libdir});
        }
 
        loadplugin($_) foreach @{$config{default_plugins}}, @{$config{add_plugins}};
+       
+       if ($config{rcs}) {
+               if (exists $IkiWiki::hooks{rcs}) {
+                       error(gettext("cannot use multiple rcs plugins"));
+               }
+               loadplugin($config{rcs});
+       }
+       if (! exists $IkiWiki::hooks{rcs}) {
+               loadplugin("norcs");
+       }
 
        run_hooks(getopt => sub { shift->() });
        if (grep /^-/, @ARGV) {
@@ -1068,13 +1068,10 @@ sub preprocess ($$$;$$) { #{{{
                        if ($preprocessing{$page}++ > 3) {
                                # Avoid loops of preprocessed pages preprocessing
                                # other pages that preprocess them, etc.
-                               #translators: The first parameter is a
-                               #translators: preprocessor directive name,
-                               #translators: the second a page name, the
-                               #translators: third a number.
-                               return "[[".sprintf(gettext("%s preprocessing loop detected on %s at depth %i"),
-                                       $command, $page, $preprocessing{$page}).
-                               "]]";
+                               return "[[!$command <span class=\"error\">".
+                                       sprintf(gettext("preprocessing loop detected on %s at depth %i"),
+                                               $page, $preprocessing{$page}).
+                                       "</span>]]";
                        }
                        my $ret;
                        if (! $scan) {
@@ -1431,6 +1428,46 @@ sub run_hooks ($$) { # {{{
        return 1;
 } #}}}
 
+sub rcs_update () { #{{{
+       $hooks{rcs}{rcs_update}{call}->(@_);
+} #}}}
+
+sub rcs_prepedit ($) { #{{{
+       $hooks{rcs}{rcs_prepedit}{call}->(@_);
+} #}}}
+
+sub rcs_commit ($$$;$$) { #{{{
+       $hooks{rcs}{rcs_commit}{call}->(@_);
+} #}}}
+
+sub rcs_commit_staged ($$$) { #{{{
+       $hooks{rcs}{rcs_commit_staged}{call}->(@_);
+} #}}}
+
+sub rcs_add ($) { #{{{
+       $hooks{rcs}{rcs_add}{call}->(@_);
+} #}}}
+
+sub rcs_remove ($) { #{{{
+       $hooks{rcs}{rcs_remove}{call}->(@_);
+} #}}}
+
+sub rcs_rename ($$) { #{{{
+       $hooks{rcs}{rcs_rename}{call}->(@_);
+} #}}}
+
+sub rcs_recentchanges ($) { #{{{
+       $hooks{rcs}{rcs_recentchanges}{call}->(@_);
+} #}}}
+
+sub rcs_diff ($) { #{{{
+       $hooks{rcs}{rcs_diff}{call}->(@_);
+} #}}}
+
+sub rcs_getctime ($) { #{{{
+       $hooks{rcs}{rcs_getctime}{call}->(@_);
+} #}}}
+
 sub globlist_to_pagespec ($) { #{{{
        my @globlist=split(' ', shift);