예제 #1
0
파일: albums.php 프로젝트: shifter/ospap2
}
if ($strSubAction == 'grouppictures') {
    $objTemplate->setText('PAGETITLE', "Pictures in " . $objGroup->get('name'));
    $objBreadcrumbs->add('Groups', 'index.php?action=groups');
    $objBreadcrumbs->add($objGroup->get('name'), 'index.php?action=groups&subaction=view&' . $objGroup->getIDPair());
    $objBreadcrumbs->add("Pictures", "index.php?action=albums&subaction=userpictures&" . $objMember->getIDPair());
    clsPicture::displayPictures(clsGroup::getPicturesByGroup($objUser, $objGroup));
}
if ($strSubAction == 'newpictures') {
    if ($objUser == null) {
        throw new Exception('exception_accessdenied');
    }
    $objTemplate->setText('PAGETITLE', "New Pictures");
    $objMiniMenu->add('Mark all as seen', "index.php?action=albums&subaction=seen");
    $objBreadcrumbs->add("New pictures", "index.php?action=albums&subaction=newpictures&" . $objMember->getIDPair());
    clsPicture::displayPictures(clsPicture::getNewPictures($objUser));
}
if ($strSubAction == 'save') {
    $blnGood = true;
    if (!$objUser) {
        throw new Exception('exception_notloggedin');
    }
    if (!$objAlbum->canEdit($objUser)) {
        throw new Exception('exception_accessdenied');
    }
    /* Get the user's submitted changes. */
    $objAlbum = new clsAlbum();
    $objAlbum->getFromRequest(array('id', 'album_id', 'group_id', 'name', 'caption', 'date', 'export_tag', 'max_height', 'max_width', 'mime', 'simple_permissions'));
    if ($objAlbum->get('max_width') > MAX_X || $objAlbum->get('max_width') <= 0 || !is_numeric($objAlbum->get('max_width'))) {
        $blnGood = false;
        $objTemplate->setText('ERROR', "Width must be a number between 1 and " . MAX_X . ".<br>");