Пример #1
0
$_pages[AT_PA_BASENAME . 'albums.php?id=' . $aid]['children'] = array(AT_PA_BASENAME . 'edit_photos.php');
$_pages[AT_PA_BASENAME . 'edit_photos.php']['parent'] = AT_PA_BASENAME . 'albums.php?id=' . $aid;
if ($isadmin) {
    $_pages[AT_PA_BASENAME . 'albums.php?id=' . $aid]['parent'] = AT_PA_BASENAME . 'index_admin.php';
}
//handle organize
if (isset($_GET['org'])) {
    $_custom_head .= '<script type="text/javascript" src="' . AT_PA_BASENAME . 'include/imageReorderer.js"></script>';
    //$_custom_css = $_base_path . AT_PA_BASENAME . 'module.css'; // use a custom stylesheet
    //reset pages/submenu
    $_pages[AT_PA_BASENAME . 'edit_photos.php']['title'] = _AT('pa_organize_photos');
    if (isset($_POST['submit'])) {
        foreach ($photos as $index => $photo_array) {
            $ordering = $_POST['image_' . $photo_array['id']];
            if (isset($ordering)) {
                $result = $pa->editPhotoOrder($photo_array['id'], $ordering);
                if (!$result) {
                    $msg->addError('PA_EDIT_PHOTO_FAILED');
                }
            }
        }
        exit;
    }
    include AT_INCLUDE_PATH . 'header.inc.php';
    $savant->assign('album_info', $album_info);
    $savant->assign('photos', $photos);
    $savant->display('photos/pa_organize_photos.tmpl.php');
    include AT_INCLUDE_PATH . 'footer.inc.php';
    exit;
}
//printer header iff this is not a POST request