Ejemplo n.º 1
0
	$_pages[AT_PA_BASENAME.'albums.php?id='.$aid]['parent']   = AT_PA_BASENAME.'index_admin.php';

}
*/
//handle Edit.
if (isset($_POST['submit'])) {
    //update photo description
    foreach ($photos as $index => $photo_array) {
        $alt_text = $_POST['alt_text_' . $photo_array['id']];
        $description = $_POST['description_' . $photo_array['id']];
        $deletion = $_POST['delete_' . $photo_array['id']];
        //don't have to update description if it's deleted
        if (isset($deletion)) {
            $pa->deletePhoto($photo_array['id']);
        } elseif (isset($description)) {
            $result = $pa->editPhoto($photo_array['id'], $description, $alt_text);
            if (!$result) {
                //TODO: sql error
                $msg->addError('PA_EDIT_PHOTO_FAILED');
            }
        }
    }
    //update photo album.
    if (isset($_POST['album_cover'])) {
        $result = $pa->editAlbumCover($_POST['album_cover']);
        if (!$result) {
            //albumcover error.
            $msg->addError('PA_EDIT_PHOTO_FAILED');
        }
    }
    //if no errors