format
This commit is contained in:
parent
46f75f7b34
commit
7e017ded3b
3 changed files with 11 additions and 11 deletions
|
@ -118,5 +118,5 @@ abstract class Permissions
|
|||
public const BULK_IMPORT = "bulk_import";
|
||||
public const BULK_EXPORT = "bulk_export";
|
||||
public const BULK_DOWNLOAD = "bulk_download";
|
||||
public const BULK_PARENT_CHILD = "bulk_parent_child";
|
||||
public const BULK_PARENT_CHILD = "bulk_parent_child";
|
||||
}
|
||||
|
|
|
@ -223,7 +223,7 @@ new UserClass("admin", "base", [
|
|||
Permissions::BULK_IMPORT =>true,
|
||||
Permissions::BULK_EXPORT =>true,
|
||||
Permissions::BULK_DOWNLOAD => true,
|
||||
Permissions::BULK_PARENT_CHILD => true,
|
||||
Permissions::BULK_PARENT_CHILD => true,
|
||||
|
||||
Permissions::SET_PRIVATE_IMAGE => true,
|
||||
Permissions::SET_OTHERS_PRIVATE_IMAGES => true,
|
||||
|
|
|
@ -27,15 +27,15 @@ class BulkParentChild extends Extension
|
|||
public function onBulkAction(BulkActionEvent $event)
|
||||
{
|
||||
global $user, $page, $config;
|
||||
if ($user->can(Permissions::BULK_PARENT_CHILD)&&
|
||||
if ($user->can(Permissions::BULK_PARENT_CHILD)&&
|
||||
($event->action == BulkParentChild::PARENT_CHILD_ACTION_NAME)) {
|
||||
$prev_id = null;
|
||||
foreach ($event->items as $image) {
|
||||
if ($prev_id != null) {
|
||||
send_event(new ImageRelationshipSetEvent($image->id, $prev_id));
|
||||
}
|
||||
$prev_id = $image->id;
|
||||
}
|
||||
}
|
||||
$prev_id = null;
|
||||
foreach ($event->items as $image) {
|
||||
if ($prev_id != null) {
|
||||
send_event(new ImageRelationshipSetEvent($image->id, $prev_id));
|
||||
}
|
||||
$prev_id = $image->id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue