Added a javascript confirmation popup for delete icon
This commit is contained in:
parent
c3a9a97f9f
commit
cd4bf169fa
3 changed files with 6 additions and 33 deletions
|
|
@ -88,7 +88,7 @@ sub _fieldAdminIcons {
|
||||||
my $fid = $_[1];
|
my $fid = $_[1];
|
||||||
my $tid = $_[2];
|
my $tid = $_[2];
|
||||||
my $output;
|
my $output;
|
||||||
$output = deleteIcon('func=deleteField&wid='.$_[0]->get("wobjectId").'&fid='.$fid.'&tid='.$tid) unless ($_[3]);
|
$output = deleteIcon('func=deleteFieldConfirm&wid='.$_[0]->get("wobjectId").'&fid='.$fid.'&tid='.$tid,'',WebGUI::International::get(19,$_[0]->get("namespace"))) unless ($_[3]);
|
||||||
$output .= editIcon('func=editField&wid='.$_[0]->get("wobjectId").'&fid='.$fid.'&tid='.$tid)
|
$output .= editIcon('func=editField&wid='.$_[0]->get("wobjectId").'&fid='.$fid.'&tid='.$tid)
|
||||||
.moveUpIcon('func=moveFieldUp&wid='.$_[0]->get("wobjectId").'&fid='.$fid.'&tid='.$tid)
|
.moveUpIcon('func=moveFieldUp&wid='.$_[0]->get("wobjectId").'&fid='.$fid.'&tid='.$tid)
|
||||||
.moveDownIcon('func=moveFieldDown&wid='.$_[0]->get("wobjectId").'&fid='.$fid.'&tid='.$tid);
|
.moveDownIcon('func=moveFieldDown&wid='.$_[0]->get("wobjectId").'&fid='.$fid.'&tid='.$tid);
|
||||||
|
|
@ -98,7 +98,7 @@ sub _fieldAdminIcons {
|
||||||
sub _tabAdminIcons {
|
sub _tabAdminIcons {
|
||||||
my $tid = $_[1];
|
my $tid = $_[1];
|
||||||
my $output;
|
my $output;
|
||||||
$output = deleteIcon('func=deleteTab&wid='.$_[0]->get("wobjectId").'&tid='.$tid) unless ($_[2]);
|
$output = deleteIcon('func=deleteTabConfirm&wid='.$_[0]->get("wobjectId").'&tid='.$tid,'',WebGUI::International::get(100,$_[0]->get("namespace"))) unless ($_[2]);
|
||||||
$output .= editIcon('func=editTab&wid='.$_[0]->get("wobjectId").'&tid='.$tid)
|
$output .= editIcon('func=editTab&wid='.$_[0]->get("wobjectId").'&tid='.$tid)
|
||||||
.moveLeftIcon('func=moveTabLeft&wid='.$_[0]->get("wobjectId").'&tid='.$tid)
|
.moveLeftIcon('func=moveTabLeft&wid='.$_[0]->get("wobjectId").'&tid='.$tid)
|
||||||
.moveRightIcon('func=moveTabRight&wid='.$_[0]->get("wobjectId").'&tid='.$tid);
|
.moveRightIcon('func=moveTabRight&wid='.$_[0]->get("wobjectId").'&tid='.$tid);
|
||||||
|
|
@ -487,13 +487,6 @@ sub www_deleteEntry {
|
||||||
return $_[0]->www_view();
|
return $_[0]->www_view();
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
sub www_deleteField {
|
|
||||||
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
|
||||||
return $_[0]->confirm(WebGUI::International::get(19,$_[0]->get("namespace")),
|
|
||||||
WebGUI::URL::page('func=deleteFieldConfirm&wid='.$_[0]->get("wobjectId").'&fid='.$session{form}{fid}));
|
|
||||||
}
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_deleteFieldConfirm {
|
sub www_deleteFieldConfirm {
|
||||||
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
||||||
|
|
@ -502,13 +495,6 @@ sub www_deleteFieldConfirm {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
sub www_deleteTab {
|
|
||||||
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
|
||||||
return $_[0]->confirm(WebGUI::International::get(100,$_[0]->get("namespace")),
|
|
||||||
WebGUI::URL::page('func=deleteTabConfirm&wid='.$_[0]->get("wobjectId").'&tid='.$session{form}{tid}));
|
|
||||||
}
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_deleteTabConfirm {
|
sub www_deleteTabConfirm {
|
||||||
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
||||||
|
|
|
||||||
|
|
@ -141,13 +141,6 @@ sub www_deleteFile {
|
||||||
return $_[0]->www_editDownload();
|
return $_[0]->www_editDownload();
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
sub www_deleteDownload {
|
|
||||||
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
|
||||||
return $_[0]->confirm(WebGUI::International::get(12,$_[0]->get("namespace")),
|
|
||||||
WebGUI::URL::page('func=deleteDownloadConfirm&wid='.$session{form}{wid}.'&did='.$session{form}{did}));
|
|
||||||
}
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_deleteDownloadConfirm {
|
sub www_deleteDownloadConfirm {
|
||||||
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
||||||
|
|
@ -370,8 +363,8 @@ sub www_view {
|
||||||
$file3 = WebGUI::Attachment->new($file->{alternateVersion2},$_[0]->get("wobjectId"),$file->{FileManager_fileId});
|
$file3 = WebGUI::Attachment->new($file->{alternateVersion2},$_[0]->get("wobjectId"),$file->{FileManager_fileId});
|
||||||
push (@fileloop,{
|
push (@fileloop,{
|
||||||
"file.canView"=>(WebGUI::Grouping::isInGroup($file->{groupToView}) || $canEditWobject),
|
"file.canView"=>(WebGUI::Grouping::isInGroup($file->{groupToView}) || $canEditWobject),
|
||||||
"file.controls"=>deleteIcon('func=deleteDownload&wid='.$_[0]->get("wobjectId")
|
"file.controls"=>deleteIcon('func=deleteDownloadConfirm&wid='.$_[0]->get("wobjectId")
|
||||||
.'&did='.$file->{FileManager_fileId}).editIcon('func=editDownload&wid='.$_[0]->get("wobjectId")
|
.'&did='.$file->{FileManager_fileId},'',WebGUI::International::get(12,$_[0]->get("namespace"))).editIcon('func=editDownload&wid='.$_[0]->get("wobjectId")
|
||||||
.'&did='.$file->{FileManager_fileId}).moveUpIcon('func=moveDownloadUp&wid='
|
.'&did='.$file->{FileManager_fileId}).moveUpIcon('func=moveDownloadUp&wid='
|
||||||
.$_[0]->get("wobjectId")
|
.$_[0]->get("wobjectId")
|
||||||
.'&did='.$file->{FileManager_fileId}).moveDownIcon('func=moveDownloadDown&wid='
|
.'&did='.$file->{FileManager_fileId}).moveDownIcon('func=moveDownloadDown&wid='
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,8 @@ our @ISA = qw(WebGUI::Wobject);
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub _formatControls {
|
sub _formatControls {
|
||||||
my $controls = deleteIcon("func=deleteForum&wid=".$_[0]->get("wobjectId")."&forumId=".$_[1])
|
my $controls = deleteIcon("func=deleteForumConfirm&wid=".$_[0]->get("wobjectId")."&forumId=".$_[1],'',
|
||||||
|
WebGUI::International::get(76,$_[0]->get("namespace")))
|
||||||
.editIcon("func=editForum&wid=".$_[0]->get("wobjectId")."&forumId=".$_[1])
|
.editIcon("func=editForum&wid=".$_[0]->get("wobjectId")."&forumId=".$_[1])
|
||||||
.moveUpIcon("func=moveForumUp&wid=".$_[0]->get("wobjectId")."&forumId=".$_[1])
|
.moveUpIcon("func=moveForumUp&wid=".$_[0]->get("wobjectId")."&forumId=".$_[1])
|
||||||
.moveDownIcon("func=moveForumDown&wid=".$_[0]->get("wobjectId")."&forumId=".$_[1]);
|
.moveDownIcon("func=moveForumDown&wid=".$_[0]->get("wobjectId")."&forumId=".$_[1]);
|
||||||
|
|
@ -138,13 +139,6 @@ sub purge {
|
||||||
$_[0]->SUPER::purge();
|
$_[0]->SUPER::purge();
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
sub www_deleteForum {
|
|
||||||
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
|
||||||
return $_[0]->confirm(WebGUI::International::get(76,$_[0]->get("namespace")),
|
|
||||||
WebGUI::URL::page('func=deleteForumConfirm&wid='.$_[0]->get("wobjectId").'&forumId='.$session{form}{forumId}));
|
|
||||||
}
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_deleteForumConfirm {
|
sub www_deleteForumConfirm {
|
||||||
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue