# HG changeset patch # User Matti Hamalainen # Date 1439285094 -10800 # Node ID 0b097770061d6ac8a08c78cb6f9ad0d000992921 # Parent d63d2f0307b0061b51fbe0c5332b25874953dcf2 Improve content hiding functionality. diff -r d63d2f0307b0 -r 0b097770061d mgtool.php --- a/mgtool.php Sat Jun 13 15:21:47 2015 +0300 +++ b/mgtool.php Tue Aug 11 12:24:54 2015 +0300 @@ -238,11 +238,11 @@ // Ignore comments and empty lines if ($str != "#" && $str != "") { - if (preg_match("/^(#?)\s*(\S+?)\s+(.+)$/", $str, $m)) - $captions[$m[2]] = array("caption" => $m[3], "hide" => ($m[1] == "#"), "used" => FALSE); + if (preg_match("/^([#%]?)\s*(\S+?)\s+(.+)$/", $str, $m)) + $captions[$m[2]] = array("caption" => $m[3], "hide" => ($m[1] == "#"), "hide_contents" => ($m[1] == "%"), "used" => FALSE); else - if (preg_match("/^(#?)\s*(\S+?)$/", $str, $m)) - $captions[$m[2]] = array("hide" => ($m[1] == "#"), "used" => FALSE); + if (preg_match("/^([#%]?)\s*(\S+?)$/", $str, $m)) + $captions[$m[2]] = array("hide" => ($m[1] == "#"), "hide_contents" => ($m[1] == "%"), "used" => FALSE); } } @@ -500,6 +500,7 @@ mgCopyEntryData($edata, $tmp, MG_STR, "caption", "fallback_caption"); mgCopyEntryData($edata, $tmp, MG_STR, "caption", "title"); mgCopyEntryData($edata, $tmp, MG_BOOL, "hide", "hide", FALSE); + mgCopyEntryData($edata, $tmp, MG_BOOL, "hide_contents", "hide_contents", FALSE); } }