page: replace global variables by $Page object
[minimedit.git] / edit / foto / cover / index.php
index 2558e102fb358644e588741df851fa0b08e81d20..06acc1d22c0e586b6510b42e203c161942b1db47 100644 (file)
@@ -5,13 +5,13 @@ if (!$User->admin('foto')) {
        exit;
 }
 
-$rootdir = 'foto' . $Args;
+$rootdir = 'foto' . $Page->path;
 $target = "$rootdir/index.jpg";
 
 if (is_link($target) or file_exists($target)) {
        if (!unlink($target)) {
                http_response_code(500);
-               print "Kon bestaande cover niet weghalen voor $Args\n";
+               print "Kon bestaande cover niet weghalen voor {$Page->path}\n";
                exit;
        }
 }
@@ -21,7 +21,7 @@ if (isset($_GET['img'])) {
        $img .= ltrim($_GET['img'], '/');
        if (!symlink($img, $target)) {
                http_response_code(500);
-               print "Fout bij instellen van cover voor $Args\n";
+               print "Fout bij instellen van cover voor {$Page->path}\n";
                exit;
        }
 }