Mercurial > hg > mgallery
comparison mgtool.php @ 11:0b097770061d
Improve content hiding functionality.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 11 Aug 2015 12:24:54 +0300 |
parents | d63d2f0307b0 |
children | 805f93962cf9 |
comparison
equal
deleted
inserted
replaced
10:d63d2f0307b0 | 11:0b097770061d |
---|---|
236 { | 236 { |
237 $str = trim(fgets($fp)); | 237 $str = trim(fgets($fp)); |
238 // Ignore comments and empty lines | 238 // Ignore comments and empty lines |
239 if ($str != "#" && $str != "") | 239 if ($str != "#" && $str != "") |
240 { | 240 { |
241 if (preg_match("/^(#?)\s*(\S+?)\s+(.+)$/", $str, $m)) | 241 if (preg_match("/^([#%]?)\s*(\S+?)\s+(.+)$/", $str, $m)) |
242 $captions[$m[2]] = array("caption" => $m[3], "hide" => ($m[1] == "#"), "used" => FALSE); | 242 $captions[$m[2]] = array("caption" => $m[3], "hide" => ($m[1] == "#"), "hide_contents" => ($m[1] == "%"), "used" => FALSE); |
243 else | 243 else |
244 if (preg_match("/^(#?)\s*(\S+?)$/", $str, $m)) | 244 if (preg_match("/^([#%]?)\s*(\S+?)$/", $str, $m)) |
245 $captions[$m[2]] = array("hide" => ($m[1] == "#"), "used" => FALSE); | 245 $captions[$m[2]] = array("hide" => ($m[1] == "#"), "hide_contents" => ($m[1] == "%"), "used" => FALSE); |
246 } | 246 } |
247 } | 247 } |
248 | 248 |
249 fclose($fp); | 249 fclose($fp); |
250 return $captions; | 250 return $captions; |
498 $tmp = mgGetAlbumData($basepath, $efilename); | 498 $tmp = mgGetAlbumData($basepath, $efilename); |
499 mgCopyEntryData($edata, $tmp, MG_STR, "caption", "caption"); | 499 mgCopyEntryData($edata, $tmp, MG_STR, "caption", "caption"); |
500 mgCopyEntryData($edata, $tmp, MG_STR, "caption", "fallback_caption"); | 500 mgCopyEntryData($edata, $tmp, MG_STR, "caption", "fallback_caption"); |
501 mgCopyEntryData($edata, $tmp, MG_STR, "caption", "title"); | 501 mgCopyEntryData($edata, $tmp, MG_STR, "caption", "title"); |
502 mgCopyEntryData($edata, $tmp, MG_BOOL, "hide", "hide", FALSE); | 502 mgCopyEntryData($edata, $tmp, MG_BOOL, "hide", "hide", FALSE); |
503 mgCopyEntryData($edata, $tmp, MG_BOOL, "hide_contents", "hide_contents", FALSE); | |
503 } | 504 } |
504 } | 505 } |
505 | 506 |
506 echo "\r".$path." ..... DONE\n"; | 507 echo "\r".$path." ..... DONE\n"; |
507 | 508 |