Beispiel #1
0
function getItemLinkById($itemId)
{
    global $wpdb;
    $query = "SELECT files.file_path FROM files INNER JOIN file_connector ON files.id=file_connector.file_id WHERE file_connector.item_id=" . $itemId;
    $fileInfo = $wpdb->get_row($query);
    $fullPath = getItemPath($fileInfo->file_path);
    return $fullPath;
}
         $response = deleteChannel($email, $password, $dbName, $appId);
     } else {
         $response = deleteApplication($email, $password, $dbName, $appId);
     }
     if (isOK($response)) {
         printResult($response, "DELETING APPLICATION FROM CVS FAILED", " Application {$appId} has been deleted from the database {$dbName}." . PHP_EOL . " ---- DELETING APPLICATION FROM CVS SUCCESSFULLY COMPLETED ----");
     } else {
         echo $response->getMessage();
     }
     break;
 case "addItem":
     echo "Adding item..." . PHP_EOL;
     $email = getEMail();
     $password = getPassword();
     $dbName = getDbName();
     $filePath = getItemPath();
     $identifier = getIdentifier();
     $metadata = getMetadata();
     $msg = validateItemPath($filePath);
     if (isset($msg)) {
         echo $msg;
         break;
     }
     $fileName = basename($filePath);
     $parentFolder = dirname($filePath);
     $oldFileName = $fileName;
     $msg = replaceWhitespaces($fileName, $parentFolder);
     if (isset($msg)) {
         break;
     } else {
         $filePath = substr_replace($filePath, $fileName, strlen($filePath) - strlen($oldFileName));