|
|
|
@ -21,17 +21,35 @@ class SettingsAPI
|
|
|
|
|
file_get_contents("../content/themes/" . $theme . "/theme.json"),
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
//if render flag is set and false, just render index page for one page sites
|
|
|
|
|
//otherwise, render all pages according to theme template files
|
|
|
|
|
$render = new Render();
|
|
|
|
|
if (isset($themeConfig["render"])) {
|
|
|
|
|
if (!$themeConfig["render"] || $themeConfig["render"] === "false") {
|
|
|
|
|
$render->renderIndex();
|
|
|
|
|
$result = [
|
|
|
|
|
"message" => "Index Rendered. HAND CLAPS",
|
|
|
|
|
"type" => "RENDER_SUCCESS",
|
|
|
|
|
];
|
|
|
|
|
//check to see if dynamic rendering is active
|
|
|
|
|
if (
|
|
|
|
|
isset($settings["global"]["dynamicRender"]) &&
|
|
|
|
|
$settings["global"]["dynamicRender"] === "true"
|
|
|
|
|
) {
|
|
|
|
|
$result = [
|
|
|
|
|
"message" => "Dynamic Render Active! You're good!",
|
|
|
|
|
"type" => "RENDER_SUCCESS",
|
|
|
|
|
];
|
|
|
|
|
} else {
|
|
|
|
|
$render = new Render();
|
|
|
|
|
if (isset($themeConfig["render"])) {
|
|
|
|
|
if (!$themeConfig["render"] || $themeConfig["render"] === "false") {
|
|
|
|
|
$render->renderIndex();
|
|
|
|
|
$result = [
|
|
|
|
|
"message" => "Index Rendered. HAND CLAPS",
|
|
|
|
|
"type" => "RENDER_SUCCESS",
|
|
|
|
|
];
|
|
|
|
|
} else {
|
|
|
|
|
$render->renderTags();
|
|
|
|
|
$render->renderArchive();
|
|
|
|
|
$render->renderPages();
|
|
|
|
|
$result = [
|
|
|
|
|
"message" => "Site Rendered. GOOD EFFORT",
|
|
|
|
|
"type" => "RENDER_SUCCESS",
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// just incase the render flag is missing
|
|
|
|
|
$render->renderTags();
|
|
|
|
|
$render->renderArchive();
|
|
|
|
|
$render->renderPages();
|
|
|
|
@ -40,17 +58,11 @@ class SettingsAPI
|
|
|
|
|
"type" => "RENDER_SUCCESS",
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// just incase the render flag is missing
|
|
|
|
|
$render->renderTags();
|
|
|
|
|
$render->renderArchive();
|
|
|
|
|
$render->renderPages();
|
|
|
|
|
$result = [
|
|
|
|
|
"message" => "Site Rendered. GOOD EFFORT",
|
|
|
|
|
"type" => "RENDER_SUCCESS",
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//if render flag is set and false, just render index page for one page sites
|
|
|
|
|
//otherwise, render all pages according to theme template files
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case "add-avatar":
|
|
|
|
|
$result = ImagesAPI::uploadImage($request, "avatar");
|
|
|
|
|