Add output_conditional()

This commit is contained in:
Skylar Ittner 2018-05-04 16:54:00 -06:00
parent 661b71c69f
commit 7249f736ee

View File

@ -271,6 +271,19 @@ function get_navigation($currentpage = null, $classPrefix = "", $liclass = "", $
}
}
/**
* Replace "[[VAR]]" with the contents of $var and echo $content,
* but only if $var isn't empty.
* @param string $content
* @param string $var
*/
function output_conditional($content, $var) {
if ($var == "") {
return;
}
echo str_replace("[[VAR]]", $var, $content);
}
function return_site_ver() {
// Stub for GetSimple
return "SiteWriter";