From ed6eb9fe09fa69eb6df8131dae4328696063fd8b Mon Sep 17 00:00:00 2001 From: Oros Date: Wed, 6 Feb 2013 22:42:45 +0100 Subject: [PATCH] Ajout d'un export json pour la liste des medias modified: autoblog-0.3.php modified: config.php --- _experimental/autoblog-0.3.php | 16 +++++++++++++++- _experimental/config.php | 4 ++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/_experimental/autoblog-0.3.php b/_experimental/autoblog-0.3.php index 666e72d..827c2e2 100755 --- a/_experimental/autoblog-0.3.php +++ b/_experimental/autoblog-0.3.php @@ -590,6 +590,19 @@ if (isset($_GET['feed'])) // FEED exit; } +if (isset($_GET['media'])) // MEDIA +{ + header('Content-Type: application/json'); + if(is_dir(MEDIA_DIR)) + { + $files = scandir(MEDIA_DIR); + unset($files[0]); // . + unset($files[1]); // .. + echo json_encode(array("url"=> LOCAL_URL.substr(MEDIA_DIR, strlen(ROOT_DIR)+1).'/', "files" => $files)); + } + exit; +} + if (isset($_GET['update'])) { $_SERVER['QUERY_STRING'] = ''; @@ -791,7 +804,8 @@ echo ' '; if ($vvb->mustUpdate()) diff --git a/_experimental/config.php b/_experimental/config.php index 1c3ec6a..de7d943 100755 --- a/_experimental/config.php +++ b/_experimental/config.php @@ -40,6 +40,10 @@ function __($str) case 'configuration': case 'articles': return $str; + case 'Media export': + return 'Export fichiers media'; + default: + return $str; } }