コード例 #1
0
ファイル: ActionManager.php プロジェクト: at69/beta-eggstar
function handleActions($request)
{
    if (is_array($request) && isset($request['action'])) {
        switch ($request['action']) {
            case 'createNewFolder':
                return createNewFolder($request['idUser'], $request['path'], $request['folderName'], $request['inheritRightsFromParent']);
                break;
            case 'rename':
                return renameHandler($request['idElement'], $request['idUser'], $request['name'], $request['options']);
                break;
            case 'move':
                return moveHandler($request['idElement'], $request['idUser'], $request['path'], $request['options']);
                break;
            case 'disable':
                return disableHandler($request['idElement'], $request['idUser'], $request['returnImpactedElements']);
                break;
            case 'copy':
                return copyHandler($request['idElement'], $request['idUser'], $request['path'], $request['options']);
                break;
            case 'uplodad':
                break;
            case 'download':
                break;
            case 'shareWithUser':
                return shareWithUser($request['idElement'], $request['idUser'], $request['email'], $request['code']);
                break;
            case 'anonymousShare':
                break;
        }
    } else {
        return array('error' => 'Action parameter required, none found');
    }
}
コード例 #2
0
ファイル: moveElement.php プロジェクト: at69/beta-nestbox
<?php

$projectRoot = $_SERVER['DOCUMENT_ROOT'] . '/Nestbox';
require_once $projectRoot . '/required.php';
/**
 * Created by PhpStorm.
 * User: Harry
 * Date: 12/06/14
 * Time: 19:42
 */
/* Si l'utilisateur décide de couper un fichier ou un dossier */
if (isset($_POST['destination'])) {
    if (isset($_POST['keepRights']) && $_POST['keepRights'] != "undefined") {
        $keepRights = true;
    } else {
        $keepRights = false;
    }
    if (isset($_POST['keepDownloadLink']) && $_POST['keepDownloadLink'] != "undefined") {
        $keepDownloadLink = true;
    } else {
        $keepDownloadLink = false;
    }
    $options = array('returnImpactedElements' => true, 'returnMovedElements' => true, 'keepRights' => $keepRights, 'keepDownloadLinks' => $keepDownloadLink);
    $moveResult = moveHandler($_POST['idElement'], $userId, $_POST['destination'], $options);
    if (is_array($moveResult) && array_key_exists('error', $moveResult)) {
        echo $moveResult['error'];
    } else {
        echo 'The element has been successfully moved to ' . $_POST['destination'];
    }
}