0) { echo ''; } else { show_error('The provided refresh parameter has to be a number greater then 0'); } } } /** * Generates tags for the style sheets you want to include, the parameter could by a string or an array of strings */ function generateCSSsInclude($CSSs) { $cssLink = ''; $ci =& get_instance(); $cachetoken = '?'.$ci->config->item('fhcomplete_build_version'); if (isset($CSSs)) { $tmpCSSs = is_array($CSSs) ? $CSSs : array($CSSs); for ($tmpCSSsCounter = 0; $tmpCSSsCounter < count($tmpCSSs); $tmpCSSsCounter++) { $toPrint = sprintf($cssLink, base_url($tmpCSSs[$tmpCSSsCounter]).$cachetoken).PHP_EOL; if ($tmpCSSsCounter > 0) $toPrint = "\t\t".$toPrint; echo $toPrint; } } } /** * Generates global JS-Object to pass parms to other javascripts */ function generateJSDataStorageObject($indexPage, $calledPath, $calledMethod) { $ci =& get_instance(); $ci->load->config('theme'); $ci->load->model('system/Sprache_model','SpracheModel'); $server_language = getData($ci->SpracheModel->loadWhere(['content' => true])); $server_language = array_map(function($language){ return ['sprache'=>$language->sprache, 'LC_Time'=>$language->locale, 'bezeichnung'=>$language->bezeichnung[$language->index-1]]; }, $server_language); $user_language = getUserLanguage(); $ci->load->config('javascript'); $systemerror_mailto = $ci->config->item('systemerror_mailto'); $FHC_JS_DATA_STORAGE_OBJECT = array( 'app_root' => APP_ROOT, 'ci_router' => $indexPage, 'called_path' => $calledPath, 'called_method' => $calledMethod, 'server_languages' => $server_language, 'user_language' => $user_language, 'timezone' => date_default_timezone_get(), 'systemerror_mailto' => $systemerror_mailto, 'theme' => [ 'name'=>$ci->config->item('theme_name'), 'modes'=>$ci->config->item('theme_modes'), ] ); $toPrint = "\n"; $toPrint .= ''; $toPrint .= "\n\n"; echo $toPrint; } /** * Generates global JS-Object to pass phrases to other javascripts */ function generateJSPhrasesStorageObject($phrases) { $ci =& get_instance(); $ci->load->library('PhrasesLib', array($phrases), 'pj'); $toPrint = "\n"; $toPrint .= ''; $toPrint .= "\n\n"; echo $toPrint; } /** * Generates tags for the javascripts you want to include, the parameter could by a string or an array of strings */ function generateJSsInclude($JSs) { $jsInclude = ''; $ci =& get_instance(); $cachetoken = '?'.$ci->config->item('fhcomplete_build_version'); if (isset($JSs)) { $tmpJSs = is_array($JSs) ? $JSs : array($JSs); for ($tmpJSsCounter = 0; $tmpJSsCounter < count($tmpJSs); $tmpJSsCounter++) { $toPrint = sprintf($jsInclude, base_url($tmpJSs[$tmpJSsCounter].$cachetoken)).PHP_EOL; if ($tmpJSsCounter > 0) $toPrint = "\t\t".$toPrint; echo $toPrint; } } } /** * Generates tags for the javascript modules you want to include, the parameter could by a string or an array of strings */ function generateJSModulesInclude($JSModules) { $jsInclude = ''; $ci =& get_instance(); $cachetoken = '?'.$ci->config->item('fhcomplete_build_version'); if (isset($JSModules)) { $tmpJSs = is_array($JSModules) ? $JSModules : array($JSModules); for ($tmpJSsCounter = 0; $tmpJSsCounter < count($tmpJSs); $tmpJSsCounter++) { $toPrint = sprintf($jsInclude, base_url($tmpJSs[$tmpJSsCounter].$cachetoken)).PHP_EOL; if ($tmpJSsCounter > 0) $toPrint = "\t\t".$toPrint; echo $toPrint; } } } /** * Generates all the includes needed by the Addons */ function generateAddonsJSsInclude($calledFrom) { $aktive_addons = array_filter(explode(";", ACTIVE_ADDONS)); // For each active addon foreach ($aktive_addons as $addon) { // Build the path to the hook file $hookfile = DOC_ROOT.'addons/'.$addon.'/hooks.config.inc.php'; // If the hook file exists if (file_exists($hookfile)) { $js_hooks = array(); // default value include($hookfile); // include the hook file where the array js_hooks should be setup // If it contains the provided key calledFrom if (key_exists($calledFrom, $js_hooks)) { foreach ($js_hooks[$calledFrom] as $js_file) { generateJSsInclude('addons/'.$addon.'/'.$js_file); } } } } } /** * This function merely print some useful HTML to help some vacuous browsers to handle modern JS features */ function generateBackwardCompatibleJSMsIe($js) { echo "\n"; } /** * Constructs an accessibility skipLink https://www.w3schools.com/accessibility/accessibility_skip_links.php */ function generateSkipLink($skipID) { $toPrint = ''; echo $toPrint; }