diff options
author | Yorhel <git@yorhel.nl> | 2008-11-21 13:42:10 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2008-11-21 13:42:10 +0100 |
commit | 9bfabe3e12f754d5d8cf409ffa63706083ebe941 (patch) | |
tree | 099bdfee322d7ecb4c9ea85d6edc8f4d46a63128 /lib/VNDB/Util/CommonHTML.pm | |
parent | c3c186d61c316a8aa53f4ebb24e3f049f67984dd (diff) |
Added htmlHiddenMessage() to hide deleted items
Diffstat (limited to 'lib/VNDB/Util/CommonHTML.pm')
-rw-r--r-- | lib/VNDB/Util/CommonHTML.pm | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/VNDB/Util/CommonHTML.pm b/lib/VNDB/Util/CommonHTML.pm index bf83ff61..04f2d9fa 100644 --- a/lib/VNDB/Util/CommonHTML.pm +++ b/lib/VNDB/Util/CommonHTML.pm @@ -8,7 +8,7 @@ use Exporter 'import'; use Algorithm::Diff 'sdiff'; use VNDB::Func; -our @EXPORT = qw|htmlMainTabs htmlDenied htmlBrowse htmlBrowseNavigate htmlRevision|; +our @EXPORT = qw|htmlMainTabs htmlDenied htmlHiddenMessage htmlBrowse htmlBrowseNavigate htmlRevision|; # generates the "main tabs". These are the commonly used tabs for @@ -102,6 +102,27 @@ sub htmlDenied { } +# Generates message saying that the current item has been deleted, +# Arguments: [pvr], obj +# Returns 1 if the use doesn't have access to the page, 0 otherwise +sub htmlHiddenMessage { + my($self, $type, $obj) = @_; + return 0 if !$obj->{hidden}; + div class => 'mainbox'; + h1 $obj->{title}||$obj->{name}; + div class => 'warning'; + h2 'Item deleted'; + p; + lit qq|This item has been deleted from the database, File a request on the| + .qq| <a href="/t/$type$obj->{id}">discussion board</a> to undelete this page.|; + end; + end; + end; + return $self->htmlFooter() || 1 if !$self->authCan('del'); + return 0; +} + + # generates a browse box, arguments: # items => arrayref with the list items # options => hashref containing at least the keys s (sort key), o (order) and p (page) |