diff --git a/admin.php b/admin.php index cf07b7f..0f52987 100644 --- a/admin.php +++ b/admin.php @@ -365,6 +365,20 @@ function resolve_input_dir_from_request($base, $id, $dir, $articleIndex = null){ } return resolve_input_dir($base, $dir, $articleIndex); } +function read_describe_prompt($dir){ + $file = rtrim((string)$dir, '/') . '/.mvlog-describe-prompt.txt'; + return is_file($file) ? trim((string)@file_get_contents($file)) : ''; +} +function write_describe_prompt($dir, $text){ + $file = rtrim((string)$dir, '/') . '/.mvlog-describe-prompt.txt'; + $text = trim((string)$text); + if ($text === '') { + if (is_file($file)) @unlink($file); + return; + } + file_put_contents($file, $text . PHP_EOL); + @chmod($file, 0664); +} function read_data($dir){ $data = ['title'=>'','teaser'=>'','quote_da'=>'','date'=>'','place'=>'','description'=>'','captions'=>[],'video_audio'=>[]]; $file = $dir . '/data.txt'; if (!is_file($file)) return $data; @@ -476,6 +490,7 @@ function infer_date_from_first_media($dir){ return ''; } function write_data($dir, $post){ + if (array_key_exists('describe_prompt', $post)) write_describe_prompt($dir, $post['describe_prompt']); $title = trim($post['title'] ?? ''); $teaser = trim($post['teaser'] ?? ''); $quote_da = trim($post['quote_da'] ?? ''); @@ -1543,7 +1558,7 @@ $runningJobs = active_worker_jobs($config);
=nl2br(h($meta['description']), false)?>
“=h(trim((string)$meta['quote_da'], "\"“”"))?>”
=h(implode(' · ', $detailParts))?>
=page_links('edit',$editPage,$editPages)?>in-dir/=h(basename($editDir))?>
in-dir/=h(basename($editDir))?>
in-dir/=h(basename($editDir))?>