router->directory.$this->router->class; $calledMethod = $this->router->method; // By default set the parameters to null $title = isset($title) ? $title : null; $customCSSs = isset($customCSSs) ? $customCSSs : null; $customJSs = isset($customJSs) ? $customJSs : null; $phrases = isset($phrases) ? $phrases : null; // By default set the parameters to false $jquery = isset($jquery) ? $jquery : false; $jqueryui = isset($jqueryui) ? $jqueryui : false; $ajaxlib = isset($ajaxlib) ? $ajaxlib : false; $bootstrap = isset($bootstrap) ? $bootstrap : false; $fontawesome = isset($fontawesome) ? $fontawesome : false; $tablesorter = isset($tablesorter) ? $tablesorter : false; $tinymce = isset($tinymce) ? $tinymce : false; $sbadmintemplate = isset($sbadmintemplate) ? $sbadmintemplate : false; $addons = isset($addons) ? $addons : false; $filterwidget = isset($filterwidget) ? $filterwidget : false; $navigationwidget = isset($navigationwidget) ? $navigationwidget : false; /** * Print the given title of the page * NOTE: this is a required field, must be specified otherwise an error is shown */ function _printTitle($title) { if ($title != null) { echo $title; } else { show_error('The title for this page is not set'); } } /** * 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 = ''; if (isset($CSSs)) { $tmpCSSs = is_array($CSSs) ? $CSSs : array($CSSs); for ($tmpCSSsCounter = 0; $tmpCSSsCounter < count($tmpCSSs); $tmpCSSsCounter++) { $toPrint = sprintf($cssLink, base_url($tmpCSSs[$tmpCSSsCounter])).PHP_EOL; if ($tmpCSSsCounter > 0) $toPrint = "\t\t".$toPrint; echo $toPrint; } } } /** * Generates global JS-Object to pass parms to other javascripts */ function _generateJSDataStorageObject($calledPath, $calledMethod) { $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 = ''; if (isset($JSs)) { $tmpJSs = is_array($JSs) ? $JSs : array($JSs); for ($tmpJSsCounter = 0; $tmpJSsCounter < count($tmpJSs); $tmpJSsCounter++) { $toPrint = sprintf($jsInclude, base_url($tmpJSs[$tmpJSsCounter])).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)); foreach ($aktive_addons as $addon) { $hookfile = DOC_ROOT.'addons/'.$addon.'/hooks.config.inc.php'; if (file_exists($hookfile)) { include($hookfile); if (key_exists($calledFrom, $js_hooks)) { foreach ($js_hooks[$calledFrom] as $js_file) _generateJSsInclude('addons/'.$addon.'/'.$js_file); } } } } ?>