Esempio n. 1
0
 * Actions
 */
if ($cancel) {
    if ($backtourl) {
        header("Location: " . $backtourl);
        exit;
    } else {
        header("Location: " . DOL_URL_ROOT . "/product/document.php?id=" . $id . '&file=' . urldecode($_POST["file"]));
        exit;
    }
}
if ($action == 'confirm_resize' && isset($_POST["file"]) != "" && isset($_POST["sizex"]) != "" && isset($_POST["sizey"]) != "") {
    $fullpath = $dir . "/" . $original_file;
    $result = dol_imageResizeOrCrop($fullpath, 0, $_POST['sizex'], $_POST['sizey']);
    if ($result == $fullpath) {
        $object->add_thumb($fullpath);
        if ($backtourl) {
            header("Location: " . $backtourl);
            exit;
        } else {
            header("Location: " . DOL_URL_ROOT . "/product/document.php?id=" . $id . '&file=' . urldecode($_POST["file"]));
            exit;
        }
    } else {
        setEventMessages($result, null, 'errors');
        $_GET['file'] = $_POST["file"];
        $action = '';
    }
}
// Crop d'une image
if ($action == 'confirm_crop') {