Added a javascript confirmation popup for delete icon
This commit is contained in:
parent
4fa602e4a7
commit
39345e9c95
2 changed files with 7 additions and 49 deletions
|
|
@ -73,25 +73,6 @@ sub www_copyTemplate {
|
|||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteTemplate {
|
||||
my ($output);
|
||||
if ($session{form}{tid} =~ /^\d+$/ && $session{form}{tid} < 1000 && $session{form}{tid} > 0) {
|
||||
return _submenu(WebGUI::Privilege::vitalComponent());
|
||||
} elsif (WebGUI::Grouping::isInGroup(8)) {
|
||||
$output .= WebGUI::International::get(502).'<p>';
|
||||
$output .= '<div align="center"><a href="'.
|
||||
WebGUI::URL::page('op=deleteTemplateConfirm&tid='.$session{form}{tid}.'&namespace='
|
||||
.$session{form}{namespace})
|
||||
.'">'.WebGUI::International::get(44).'</a>';
|
||||
$output .= ' <a href="'.WebGUI::URL::page('op=listTemplates&namespace='
|
||||
.$session{form}{namespace}).'">'.WebGUI::International::get(45).'</a></div>';
|
||||
return _submenu($output,'42',"template delete");
|
||||
} else {
|
||||
return WebGUI::Privilege::adminOnly();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteTemplateConfirm {
|
||||
my ($a, $pageId);
|
||||
|
|
@ -186,7 +167,7 @@ sub www_listTemplates {
|
|||
$sth = WebGUI::SQL->read("select templateId,name,namespace from template where isEditable=1 $where order by namespace,name");
|
||||
while (@data = $sth->array) {
|
||||
$row[$i] = '<tr><td valign="top" class="tableData">'
|
||||
.deleteIcon('op=deleteTemplate&tid='.$data[0].'&namespace='.$data[2])
|
||||
.deleteIcon('op=deleteTemplateConfirm&tid='.$data[0].'&namespace='.$data[2],'',WebGUI::International::get(502))
|
||||
.editIcon('op=editTemplate&tid='.$data[0].'&namespace='.$data[2])
|
||||
.copyIcon('op=copyTemplate&tid='.$data[0].'&namespace='.$data[2])
|
||||
.'</td>';
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ use WebGUI::Session;
|
|||
use WebGUI::SQL;
|
||||
use WebGUI::URL;
|
||||
use WebGUI::Utility;
|
||||
use WebGUI::FormProcessor;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _getComponentTypes {
|
||||
|
|
@ -121,18 +122,6 @@ sub www_addThemeComponentSave {
|
|||
return www_editTheme();
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteTheme {
|
||||
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(9));
|
||||
my $output = WebGUI::International::get(907).'<p>';
|
||||
$output .= '<div align="center"><a href="'.
|
||||
WebGUI::URL::page('op=deleteThemeConfirm&themeId='.$session{form}{themeId})
|
||||
.'">'.WebGUI::International::get(44).'</a>';
|
||||
$output .= ' <a href="'.WebGUI::URL::page('op=listThemes').
|
||||
'">'.WebGUI::International::get(45).'</a></div>';
|
||||
return _submenu($output,'42',"theme delete");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteThemeConfirm {
|
||||
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(9));
|
||||
|
|
@ -157,18 +146,6 @@ sub www_deleteThemeConfirm {
|
|||
return www_listThemes();
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteThemeComponent {
|
||||
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(9));
|
||||
my $output = WebGUI::International::get(908).'<p>';
|
||||
$output .= '<div align="center"><a href="'.
|
||||
WebGUI::URL::page('op=deleteThemeComponentConfirm&themeId='.$session{form}{themeId})
|
||||
.'&themeComponentId='.$session{form}{themeComponentId}.'">'.WebGUI::International::get(44).'</a>';
|
||||
$output .= ' <a href="'.WebGUI::URL::page('op=listThemes').
|
||||
'">'.WebGUI::International::get(45).'</a></div>';
|
||||
return _submenu($output,'42');
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteThemeComponentConfirm {
|
||||
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(9));
|
||||
|
|
@ -215,8 +192,8 @@ sub www_editTheme {
|
|||
and themeComponent.themeId=".quote($session{form}{themeId})." order by name";
|
||||
my $sth = WebGUI::SQL->read($query);
|
||||
while (my $component = $sth->hashRef) {
|
||||
$output .= deleteIcon('op=deleteThemeComponent&themeId='.$session{form}{themeId}
|
||||
.'&themeComponentId='.$component->{componentId})
|
||||
$output .= deleteIcon('op=deleteThemeComponentConfirm&themeId='.$session{form}{themeId}
|
||||
.'&themeComponentId='.$component->{componentId},'',WebGUI::International::get(908))
|
||||
.' '.$component->{name}.' ('.$componentTypes->{$component->{componentType}}.')<br>';
|
||||
}
|
||||
$sth->finish;
|
||||
|
|
@ -226,8 +203,8 @@ sub www_editTheme {
|
|||
my ($templateId,$namespace) = split("_",$data->{id});
|
||||
my ($name) = WebGUI::SQL->quickArray("select name from template where
|
||||
templateId=".quote($templateId)." and namespace=".quote($namespace));
|
||||
$output .= deleteIcon('op=deleteThemeComponent&themeId='.$session{form}{themeId}
|
||||
.'&themeComponentId='.$data->{themeComponentId})
|
||||
$output .= deleteIcon('op=deleteThemeComponentConfirm&themeId='.$session{form}{themeId}
|
||||
.'&themeComponentId='.$data->{themeComponentId},'',WebGUI::International::get(908))
|
||||
.' '.$name.' ('.$componentTypes->{template}.'/'.$namespace.')<br>';
|
||||
}
|
||||
$sth->finish;
|
||||
|
|
@ -416,7 +393,7 @@ sub www_listThemes {
|
|||
my ($output,@data, @row, $i, $p);
|
||||
my $sth = WebGUI::SQL->read("select themeId,name,original from theme order by name");
|
||||
while (@data = $sth->array) {
|
||||
$row[$i] = '<tr><td valign="top" class="tableData">'.deleteIcon('op=deleteTheme&themeId='.$data[0]);
|
||||
$row[$i] = '<tr><td valign="top" class="tableData">'.deleteIcon('op=deleteThemeConfirm&themeId='.$data[0],'',WebGUI::International::get(907));
|
||||
if ($data[2]) {
|
||||
$row[$i] .= editIcon('op=editTheme&themeId='.$data[0]);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue