$jsfiles[] = PATH_ADMIN_JS_FS . '/ext/GMapPanel.js'; $jsfiles[] = PATH_ADMIN_JS_FS . '/ext/Connection.js'; //set specific source debug files here //$jsfiles [] = PATH_MAIN_FS.'/ext/source/data/Connection.js'; $jsfiles[] = PATH_ADMIN_JS_FS . '/ext/conf.js'; break; case 'fr': //Ext french locales $jsfiles[] = PATH_MAIN_FS . '/ext/src/locale/ext-lang-fr.js'; break; case 'en': //Ext english locales (nothing for now) break; default: $replace = array('..' => '', '\\' => '', '/' => ''); $docrootPath = realpath($_SERVER["DOCUMENT_ROOT"] . $file); $realrootPath = realpath(PATH_REALROOT_FS . '/' . $file); $dirnamePath = realpath(dirname(__FILE__) . '/' . $file); if ($file == str_replace(array_keys($replace), $replace, $file) && file_exists($dirnamePath) && is_file($dirnamePath)) { $jsfiles[] = $dirnamePath; } elseif (pathinfo($file, PATHINFO_EXTENSION) == 'js' && substr($file, 0, 1) == '/' && file_exists($docrootPath) && is_file($docrootPath) && (strpos(pathinfo($docrootPath, PATHINFO_DIRNAME), realpath(PATH_JS_FS)) === 0 || strpos(pathinfo($docrootPath, PATHINFO_DIRNAME), realpath(PATH_ADMIN_JS_FS)) === 0)) { $jsfiles[] = $docrootPath; } elseif (pathinfo($file, PATHINFO_EXTENSION) == 'js' && substr($file, 0, 1) != '/' && file_exists($realrootPath) && is_file($realrootPath) && (strpos(pathinfo($realrootPath, PATHINFO_DIRNAME), realpath(PATH_JS_FS)) === 0 || strpos(pathinfo($realrootPath, PATHINFO_DIRNAME), realpath(PATH_ADMIN_JS_FS)) === 0)) { $jsfiles[] = $realrootPath; } break; } } } CMS_file::sendFiles($jsfiles, 'text/javascript');
break; case 'edit': //Automne edition CSS file $cssfiles[] = PATH_ADMIN_CSS_FS . '/edit.css'; break; case 'debug': //Blackbird CSS file $cssfiles[] = PATH_MAIN_FS . '/blackbirdjs/blackbird.css'; break; case 'codemirror': //CodeMirror CSS file $cssfiles[] = PATH_MAIN_FS . '/codemirror/codemirror.css'; break; default: $replace = array('..' => '', '\\' => '', '/' => ''); $docrootPath = realpath($_SERVER["DOCUMENT_ROOT"] . $file); $realrootPath = realpath(PATH_REALROOT_FS . '/' . $file); $dirnamePath = realpath(dirname(__FILE__) . '/' . $file); if ($file == str_replace(array_keys($replace), $replace, $file) && file_exists($dirnamePath) && is_file($dirnamePath)) { $cssfiles[] = $dirnamePath; } elseif (in_array(pathinfo($file, PATHINFO_EXTENSION), array('css', 'less')) && substr($file, 0, 1) == '/' && file_exists($docrootPath) && is_file($docrootPath) && (strpos(pathinfo($docrootPath, PATHINFO_DIRNAME), realpath(PATH_CSS_FS)) === 0 || strpos(pathinfo($docrootPath, PATHINFO_DIRNAME), realpath(PATH_ADMIN_CSS_FS)) === 0)) { $cssfiles[] = $docrootPath; } elseif (in_array(pathinfo($file, PATHINFO_EXTENSION), array('css', 'less')) && substr($file, 0, 1) != '/' && file_exists($realrootPath) && is_file($realrootPath) && (strpos(pathinfo($realrootPath, PATHINFO_DIRNAME), realpath(PATH_CSS_FS)) === 0 || strpos(pathinfo($realrootPath, PATHINFO_DIRNAME), realpath(PATH_ADMIN_CSS_FS)) === 0)) { $cssfiles[] = $realrootPath; } break; } } } CMS_file::sendFiles($cssfiles, 'text/css');