diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-10-21 17:57:19 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-10-21 17:57:19 -0400 |
commit | e75818572fff5256d16221a2b065b214d8cb9f5d (patch) | |
tree | 30e45561111b4dcc48f4726bfaef0ca99f5d47d2 /IkiWiki/Plugin/relativedate.pm | |
parent | 92a43d5d384ba4e504c5255989a869ced424219c (diff) | |
download | ikiwiki-e75818572fff5256d16221a2b065b214d8cb9f5d.tar ikiwiki-e75818572fff5256d16221a2b065b214d8cb9f5d.tar.gz |
function injection overhaul
Add an inject function, that can be used by plugins that want to replace
one of ikiwiki's functions with their own version. (This is a scary thing
that grubs through the symbol table, and replaces all exported occurances
of a function with the injected version.)
external: RPC functions can be injected to replace exported functions.
Removed the stupid displaytime hook, and use injection instead.
Diffstat (limited to 'IkiWiki/Plugin/relativedate.pm')
-rw-r--r-- | IkiWiki/Plugin/relativedate.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/relativedate.pm b/IkiWiki/Plugin/relativedate.pm index f4dba61a4..dc8f7d538 100644 --- a/IkiWiki/Plugin/relativedate.pm +++ b/IkiWiki/Plugin/relativedate.pm @@ -12,7 +12,7 @@ sub import { #{{{ add_underlay("javascript"); hook(type => "getsetup", id => "relativedate", call => \&getsetup); hook(type => "format", id => "relativedate", call => \&format); - hook(type => "displaytime", id => "relativedate", call => \&display); + inject(name => "IkiWiki::displaytime", call => \&mydisplaytime); } # }}} sub getsetup () { #{{{ @@ -43,7 +43,7 @@ sub include_javascript ($;$) { #{{{ '" type="text/javascript" charset="utf-8"></script>'; } #}}} -sub display ($;$) { #{{{ +sub mydisplaytime ($;$) { #{{{ my $time=shift; my $format=shift; |