📄 removeform.pm
字号:
# $Id: RemoveForm.pm,v 1.8 2005/07/20 18:35:10 martin Exp $## Copyright 2005 Nature Publishing Group# This program is free software; you can redistribute it and/or# modify it under the terms of the GNU General Public License# as published by the Free Software Foundation; either version 2# of the License, or (at your option) any later version.## The Bibliotech::Component::Remove class provides a remove form.package Bibliotech::Component::RemoveForm;use strict;use base 'Bibliotech::Component';use Bibliotech::Const;sub last_updated_basis { ('DBI', 'LOGIN');}sub html_content { my ($self, $class, $verbose, $main) = @_; my $cgi = $self->bibliotech->cgi; my $user = $self->getlogin or return $self->saylogin; my $validationmsg; if ($cgi->param('button') eq 'Remove' and my $uri = $cgi->param('uri')) { eval { $self->bibliotech->remove(user => $user, uri => $uri); }; if ($@) { $validationmsg = $@; } else { my $continue = $cgi->param('continue') || 'library'; die "Location: $uri\n" if $continue eq 'return'; return ('', 'window.close()') if $continue eq 'close'; if ($continue eq 'library') { my $username = $user->username; die 'Location: '.$self->bibliotech->location."recent/user/$username\n"; } return Bibliotech::Page::HTML_Content->simple($cgi->p('Your bookmark has been removed.'). $cgi->p({class => 'closebutton'}, $cgi->button(-value => 'Close', -class => 'buttonctl', -onclick => 'window.close()'))); } } my $uri = $cgi->param('uri'); if ($uri and Bibliotech::Bookmark::is_hash_format($uri)) { my ($bookmark) = Bibliotech::Bookmark->search(hash => $uri) or die "Hash not found as a known URI.\n"; $cgi->param('uri', $uri = $bookmark->url); } my $bookmark; ($bookmark) = Bibliotech::Bookmark->search(url => $uri) if $uri; $bookmark->adding(1) if $bookmark; # temp column, suppresses remove link in html_output my $o = $cgi->start_form(-method => 'POST', -action => $self->bibliotech->location.'remove', -name => 'remove'); $o .= $cgi->div({class => 'errormsg'}, $validationmsg) if $validationmsg; $o .= $cgi->start_table; $o .= $cgi->Tr($cgi->td({class => 'preremove', valign => 'top'}, ['Identified:', $cgi->div({class => 'identifed'}, scalar $bookmark->html_content($self->bibliotech, 'preremove', 1, 1))])) if $bookmark; $o .= $cgi->Tr([$cgi->td({valign => 'top', nowrap => undef}, [URI_TERM_PROMPT.':', $cgi->textfield(-id => 'urlbox', -class => 'textctl', -name => 'uri', -size => 60).' '. $cgi->submit(-id => 'updatebutton', -class => 'buttonctl', -name => 'button', -value => 'Update')]), $cgi->td(['', $cgi->div({class => 'warnremove'}, 'You are permanently removing your posting of a '.URI_TERM.'.'). $cgi->div({class => 'aboutremove'}, 'Any customized title, description, or comments will be lost.', 'If the '.URI_TERM.' has also been posted by others it will remain in our database;', 'otherwise it will be dropped.'). $cgi->submit(-id => 'removebutton', -class => 'buttonctl', -name => 'button', -value => 'Remove')]) ]); $o .= $cgi->end_table; $o .= $cgi->end_form; my $javascript_first_empty = $self->firstempty($cgi, 'remove', qw/uri/); return new Bibliotech::Page::HTML_Content({html_parts => {main => $o}, javascript_onload => ($main ? $javascript_first_empty : undef)});}1;__END__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -