コード例 #1
0
ファイル: sharing.php プロジェクト: blablubli/owncloudapps
    if ($image->valid()) {
        $image->centerCrop();
        $image->resize(200);
        $image->fixOrientation();
        OCP\Response::enableCaching(3600 * 24);
        // 24 hour
        $image->show();
    }
}
function handleGetPhoto($token, $photo)
{
    $owner = OC_Gallery_Sharing::getTokenOwner($token);
    $view = OCP\Files::getStorage('files');
    $file = $view->fopen(urldecode($photo), 'r');
    header('Content-Type: ' . OC_Image::getMimeTypeForFile($file));
    OCP\Response::sendFile($file);
}
switch ($operation) {
    case 'get_gallery':
        handleGetGallery($token, isset($_GET['path']) ? $_GET['path'] : false);
        break;
    case 'get_thumbnail':
        handleGetThumbnail($token, urldecode($_GET['img']));
        break;
    case 'get_album_thumbnail':
        handleGetAlbumThumbnail($token, urldecode($_GET['albumname']));
        break;
    case 'get_photo':
        handleGetPhoto($token, urldecode($_GET['photo']));
        break;
}
コード例 #2
0
ファイル: galleryOp.php プロジェクト: blablubli/owncloudapps
    }
}
if ($_GET['operation']) {
    switch ($_GET['operation']) {
        case 'rename':
            handleRename($_GET['oldname'], $_GET['newname']);
            OCP\JSON::success(array('newname' => $_GET['newname']));
            break;
        case 'remove':
            handleRemove($_GET['name']);
            OCP\JSON::success();
            break;
        case 'get_covers':
            handleGetThumbnails(urldecode($_GET['albumname']));
            break;
        case 'scan':
            handleGalleryScanning();
            break;
        case 'store_settings':
            handleStoreSettings($_GET['root'], $_GET['order']);
            break;
        case 'get_gallery':
            handleGetGallery($_GET['path']);
            break;
        case 'share':
            handleShare($_GET['path'], $_GET['share'] == 'true' ? true : false, $_GET['recursive']);
            break;
        default:
            OCP\JSON::error(array('cause' => 'Unknown operation'));
    }
}