diff options
author | Mark Wells <mark@freeside.biz> | 2013-12-10 20:08:43 -0800 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2013-12-10 20:08:43 -0800 |
commit | a4c1077430ac3b053c30084dcf76c54be45dca08 (patch) | |
tree | 2f225a7519cc9f0f83b4b7b99986b99cdb37f2e3 /httemplate/edit/elements/edit.html | |
parent | c27f80ec10180391d00286bf50dfbf09a96c1b00 (diff) |
Designate forbidden address ranges, #25530
Diffstat (limited to 'httemplate/edit/elements/edit.html')
-rw-r--r-- | httemplate/edit/elements/edit.html | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index 9e27f2a4c..16d0817eb 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -108,6 +108,9 @@ Example: # overrides default popurl(1)."process/$table.html" 'post_url' => popurl(1).'process/something', + # optional link to delete this object; primary key will be appended + 'delete_url' => $p.'misc/delete-something.html?', + #we're in a popup (no title/menu/searchboxes) 'popup' => 1, @@ -211,6 +214,7 @@ Example: % ); % } + <% include('/elements/header'. ( $opt{popup} ? '-popup' : '' ). '.html', $title, include( '/elements/menubar.html', @menubar ), @@ -773,6 +777,23 @@ Example: : "Add ". ($opt{'name'} || $opt{'name_singular'}) %>" > +% if ( $opt{'delete_url'} and $object->get($pkey) ) { +% my $delete_msg = 'Delete this '. +% ($opt{'name_singular'} || $opt{'name'}); +% my $delete_url = $opt{'delete_url'}; +% $delete_url .= '?' unless $delete_url =~ /\?/; +% $delete_url .= $object->get($pkey); + <SCRIPT TYPE="text/javascript"> + function confirm_delete() { + if(confirm(<% $delete_msg . '?' |js_string %>)) { + window.location.href = <% $delete_url |js_string %>; + } + } + </SCRIPT> + <INPUT TYPE = "button" + VALUE = "<% $delete_msg |h %>" + onclick = "confirm_delete()"> +% } % } </FORM> |