public function about() { $list = ImageJson::readList(); $this->title = "About"; $this->OGMeta = ''; $this->tweetCards = '<meta name="twitter:card" content="summary" /> <meta name="twitter:site" content="https://dev-21007640.users.info.unicaen.fr/ExifGallery/index.php"/> <meta name="twitter:title" content="Exif Gallery World Map" /> <meta name="twitter:description" content="Technical informations about the project and collaborators" /> <meta name="twitter:image" content="https://dev-21007640.users.info.unicaen.fr/ExifGallery/' . json_decode($list[0], true)['url'] . '" />'; $this->output = file_get_contents(__DIR__ . '/templates/about.php'); $this->response->setPart('OGMeta', $this->OGMeta); $this->response->setPart('tweetCards', $this->tweetCards); $this->response->setPart('title', $this->title); $this->response->setPart('output', $this->output); }
public function delete() { $name = $this->request->getGetParam('name'); $images = ImageJson::readList(); foreach ($images as $key => $image) { $image = json_decode($image, true); if ($image["filename"] == $name) { unset($images[$key]); break; } } if (isset($images) && !empty($images)) { file_put_contents("images.json", json_encode(array_values($images))); } else { file_put_contents("images.json", null); } unlink($image["url"]); unlink("data/" . $name . ".json"); unlink("data/xmp/" . $name . ".xmp"); header("Location: index.php"); die; }