Exemple #1
0
            $objAlbumMember->save();
            $objAlbumGroup->save();
            $objAlbum->set('albumpolicy_guest_id', $objAlbumGuest->get('id'));
            $objAlbum->set('albumpolicy_member_id', $objAlbumMember->get('id'));
            $objAlbum->set('albumpolicy_group_id', $objAlbumGroup->get('id'));
            $objAlbum->remove('simple_permissions');
        }
        $objAlbum->save();
        header('Location: index.php?action=albums&' . $objAlbum->getIDPair());
    } else {
        $strSubAction = 'edit';
    }
}
if ($strSubAction == 'delete') {
    $objAlbum->getFromRequest();
    $objAlbum->load();
    if (!$objAlbum->canEdit($objUser)) {
        throw new exception('exception_accessdenied');
    }
    $objAlbum->delete();
    $objAlbum->save();
    header('Location: index.php?action=albums');
}
if ($strSubAction == 'move') {
    if (!$objAlbum->canEdit($objUser)) {
        throw new Exception('exception_accessdenied');
    }
    /* Set the breadcrumbs and title. */
    $objBreadcrumbs->add('Albums', 'index.php?action=albums');
    $objAlbum->addBreadcrumbs($objBreadcrumbs, false);
    $objBreadcrumbs->add('Move', 'index.php?action=albums&subaction=move');