Add edit and delete icons to the Story Topic. Update tests. Adjust both
sets of templates. Use the correct privileges for displaying the icons. Help and i18n.
This commit is contained in:
parent
6844ef4559
commit
8f09dc062d
9 changed files with 58 additions and 12 deletions
|
|
@ -553,10 +553,10 @@ sub viewTemplateVariables {
|
|||
title => $story->getTitle,
|
||||
creationDate => $creationDate,
|
||||
};
|
||||
if ($userUiLevel >= $uiLevels->{delete}) {
|
||||
if ($story->canEdit && $userUiLevel >= $uiLevels->{delete} && !$exporting) {
|
||||
$storyVars->{deleteIcon} = $icon->delete('func=delete', $story->get('url'), $i18n->get(43));
|
||||
}
|
||||
if ($userUiLevel >= $uiLevels->{edit}) {
|
||||
if ($story->canEdit && $userUiLevel >= $uiLevels->{edit} && !$exporting) {
|
||||
$storyVars->{editIcon} = $icon->edit('func=edit', $story->get('url'));
|
||||
}
|
||||
push @{$datePointer->{story_loop}}, $storyVars;
|
||||
|
|
|
|||
|
|
@ -174,17 +174,30 @@ sub viewTemplateVariables {
|
|||
});
|
||||
my $storyIds = $p->getPageData();
|
||||
$var->{story_loop} = [];
|
||||
|
||||
my $icon = $session->icon;
|
||||
my $userUiLevel = $session->user->profileField("uiLevel");
|
||||
my $uiLevels = $session->config->get('assetToolbarUiLevel');
|
||||
my $i18n = WebGUI::International->new($session);
|
||||
|
||||
##Only build objects for the assets that we need
|
||||
STORY: foreach my $storyId (@{ $storyIds }) {
|
||||
my $story = WebGUI::Asset->new($session, $storyId->{assetId}, $storyId->{className}, $storyId->{revisionDate});
|
||||
next STORY unless $story;
|
||||
push @{$var->{story_loop}}, {
|
||||
my $storyVars = {
|
||||
url => ( $exporting
|
||||
? $story->getUrl
|
||||
: $session->url->append($self->getUrl, 'func=viewStory;assetId='.$storyId->{assetId}) ),
|
||||
title => $story->getTitle,
|
||||
creationDate => $story->get('creationDate'),
|
||||
};
|
||||
if ($story->canEdit && $userUiLevel >= $uiLevels->{delete} && !$exporting) {
|
||||
$storyVars->{deleteIcon} = $icon->delete('func=delete', $story->get('url'), $i18n->get(43));
|
||||
}
|
||||
if ($story->canEdit && $userUiLevel >= $uiLevels->{edit} && !$exporting) {
|
||||
$storyVars->{editIcon} = $icon->edit('func=edit', $story->get('url'));
|
||||
}
|
||||
push @{$var->{story_loop}}, $storyVars;
|
||||
}
|
||||
|
||||
if ($self->{_standAlone}) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue