Skip to content

Commit

Permalink
Fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
GauthLin committed Apr 16, 2015
1 parent 1ad19f2 commit 43e28a9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 26 deletions.
20 changes: 9 additions & 11 deletions Library/Installation/Plugin/DatabaseWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,21 +395,19 @@ private function updateIcons(array $resource, ResourceType $resourceType, Plugin
}

/**
* @param array $actions
* @param array $action
*/
public function persistResourceAction(array $actions)
public function persistResourceAction(array $action)
{
foreach ($actions as $action) {
$resourceAction = new MenuAction();
$resourceAction = new MenuAction();

$resourceAction->setName($action['name']);
$resourceAction->setAsync(1);
$resourceAction->setIsForm($action['is_form']);
$resourceAction->setIsCustom(1);
$resourceAction->setValue(1);
$resourceAction->setName($action['name']);
$resourceAction->setAsync(1);
$resourceAction->setIsForm($action['is_form']);
$resourceAction->setIsCustom(1);
$resourceAction->setValue(1);

$this->em->persist($resourceAction);
}
$this->em->persist($resourceAction);

$this->em->flush();
}
Expand Down
22 changes: 7 additions & 15 deletions Resources/public/js/resource/manager/views/resource/thumbnail.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,14 @@
var isCustom = event.currentTarget.getAttribute('data-is-custom') === 'yes';
var eventName = isCustom ? 'custom-action' : action;
var isForm = event.currentTarget.getAttribute('data-action-type') === 'display-form';
eventName = isCustom && isForm ? 'custom-action-form' : eventName;

if (isCustom && isForm) {
this.dispatcher.trigger('custom-action-form', {
action: action,
nodeId: nodeId,
view: this.parameters.viewName,
isCustomAction: true
});
} else {
this.dispatcher.trigger(eventName, {
action: action,
nodeId: nodeId,
view: this.parameters.viewName,
isCustomAction: false
});
}
this.dispatcher.trigger(eventName, {
action: action,
nodeId: nodeId,
view: this.parameters.viewName,
isCustomAction: isCustom
});
},
render: function (node, isSelectionAllowed) {
this.el.id = node.id;
Expand Down

0 comments on commit 43e28a9

Please sign in to comment.