hasError && $contentManager->displayType == EContentDisplayType::DISPLAY) { // Loading the definition and checking paths referenced in it. $toolInfo = ToolsContent::loadItemIndexFile($contentManager, $config_dir_tools); if(!is_null($toolInfo)) { $toolInfo->validateFiles($contentManager); } // If we still don't have errors, we load the lang file. if(!$contentManager->hasError && !is_null($toolInfo->langFile)) { // FIXME: Refactor the 'langs.php' to include this bit. $toolLangJson = file_get_contents($toolInfo->langFile); $toolLangData = json_decode($toolLangJson, true); unset($toolLangJson); if(array_key_exists($default_language, $toolLangData)) { $lang_data[$default_language] = array_merge($lang_data[$default_language], $toolLangData[$default_language]); } if($default_language != $user_language && array_key_exists($user_language, $toolLangData)) { $lang_data[$user_language] = array_merge($lang_data[$user_language], $toolLangData[$user_language]); } unset($toolLangData); } } $content_error_message = localize($contentManager->errorMessageKey); // Checking if an error occurred while loading data and/or parsing the URL. $content_error_code = 200; if($contentManager->hasError) { // TODO: Add condition for the lack of data for an item. - What ? if(is_null($contentManager->rootIndexEntries)) { // Failed to get a display type or to extract types. header("HTTP/1.1 400 Bad Request"); $content_error_code = 400; } else { //Other error. (No article, ...) header("HTTP/1.1 500 Internal Server Error"); $content_error_code = 500; } } ?> displayType == EContentDisplayType::SEARCH) { $tool_head_title = localize('tools.head.description'); $tool_head_description = localize('tools.head.description'); $tool_head_og_title = localize('tools.og.title'); $tool_head_og_description = localize('tools.og.description'); $tool_head_og_image_url = $host_uri . "/resources/NibblePoker/images/logos/v2_opengraph.png"; $tool_head_og_image_type = "image/png"; $tool_head_og_type = "website"; } elseif($contentManager->displayType == EContentDisplayType::DISPLAY) { $tool_head_title = "???"; $tool_head_description = "???"; $tool_head_og_title = "???"; $tool_head_og_description = "???"; $tool_head_og_image_url = "???"; $tool_head_og_image_type = "???"; $tool_head_og_type = "???"; //$tool_head_title = $toolInfo->openGraphData->title; //$tool_head_description = $toolInfo->openGraphData->description; //$tool_head_og_title = $toolInfo->openGraphData->title; //$tool_head_og_description = $toolInfo->openGraphData->description; //$tool_head_og_image_url = $host_uri . $toolInfo->openGraphData->image; //$tool_head_og_image_type = $toolInfo->openGraphData->image_type; //$tool_head_og_type = $toolInfo->openGraphData->type; } ?> <?php echo($tool_head_title); ?> hasError && $contentManager->displayType == EContentDisplayType::DISPLAY) { foreach($toolInfo->styleFilesPaths as $styleFilePath) { echo(''); } } ?>

displayType == EContentDisplayType::SEARCH) { printMainHeader(localize("content.error.heading.main.search"), "fad fa-exclamation-triangle"); } elseif($contentManager->displayType == EContentDisplayType::DISPLAY) { printMainHeader(localize("content.error.heading.main.content"), "fad fa-exclamation-triangle"); } else { printMainHeader(localize("content.error.heading.main.fallback"), "fad fa-exclamation-triangle"); } echo('

' . $content_error_message . '

'); goto content_printing_end; } if($contentManager->displayType == EContentDisplayType::SEARCH) { // We are handling a content search with at least one result. // Making the header with the amount of results. printMainHeader( count($contentManager->rootIndexEntries) > 1 ? localize("content.search.heading.main.multiple") : localize("content.search.heading.main.single"), "fad fa-file-search", count($contentManager->rootIndexEntries) . " " . ( count($contentManager->rootIndexEntries) > 1 ? localize("content.search.count.multiple") : localize("content.search.count.single"))); // Printing the entry for each piece of relevant content. $doPrintRuler = false; foreach($contentManager->rootIndexEntries as $current_content) { /** @var ContentIndexEntry $current_content */ if($current_content->priority == -1) { continue; } if($doPrintRuler) { echo('
'); } else { $doPrintRuler = true; } echo('
'); echo('id).'">'); echo('
'); echo(''); echo('

' . $current_content->title[$user_language] . '

'); echo('

' . $current_content->preamble[$user_language] . '

'); echo('
'); echo('
'); echo('

'); foreach($current_content->tags as $current_content_tag) { echo('#' . $current_content_tag . ''); } echo('

'); echo('
'); } // TODO: Print the tags used in the search and others that may be available. } elseif($contentManager->displayType == EContentDisplayType::DISPLAY) { // Printing the main heading (Lifted from composer.php in the templates section) echo(getMainHeader( localize($toolInfo->titleKey), $toolInfo->icon, is_null($toolInfo->subTitleKey) ? null : localize($toolInfo->subTitleKey), null, false, null, 3, false, true )); // Printing the content echo('
'); // mt-l include($toolInfo->domFile); echo('
'); } // Label used when there is an error to skip the content printing parts. content_printing_end: ?>
hasError && $contentManager->displayType == EContentDisplayType::DISPLAY) { foreach($toolInfo->codeFilesPaths as $codeFilePath) { echo(''); } foreach($toolInfo->moduleFilesPaths as $moduleFilePath) { echo(''); } } ?> "); } ?>