Current Path : /data/web/virtuals/51568/virtual/www/subdom/agenda.old/php/ |
Current File : /data/web/virtuals/51568/virtual/www/subdom/agenda.old/php/funkce.php |
<?php function load_php($class_name) { $path_to_file = $class_name . '.php'; if (file_exists('php/'.$path_to_file)) { require 'php/'.$path_to_file; } elseif (file_exists($path_to_file)) { require $path_to_file; } } function load_doucovani($class_name) { $path_to_file = 'php/doucovani' . $class_name . '.php'; if (file_exists($path_to_file)) { require $path_to_file; } } function load_zapisy($class_name) { $path_to_file = 'php/zapisy' . $class_name . '.php'; if (file_exists($path_to_file)) { require $path_to_file; } } function load_akce($class_name) { $path_to_file = 'php/akce' . $class_name . '.php'; if (file_exists($path_to_file)) { require $path_to_file; } } function load_jak($class_name) { $path_to_file = 'php/jak' . $class_name . '.php'; if (file_exists($path_to_file)) { require $path_to_file; } } function load_cestaky($class_name) { $path_to_file = 'php/cestaky' . $class_name . '.php'; if (file_exists($path_to_file)) { require $path_to_file; } } function load_exkurze($class_name) { $path_to_file = 'php/exkurze' . $class_name . '.php'; if (file_exists($path_to_file)) { require $path_to_file; } } function load_trihod($class_name) { $path_to_file = 'php/trihod' . $class_name . '.php'; if (file_exists($path_to_file)) { require $path_to_file; } } spl_autoload_register('load_php'); spl_autoload_register('load_akce'); spl_autoload_register('load_doucovani'); spl_autoload_register('load_zapisy'); spl_autoload_register('load_jak'); spl_autoload_register('load_cestaky'); spl_autoload_register('load_trihod'); //spl_autoload_register('load_exkurze'); function includeJS($class_name, $dir=''){ if ($dir){ $jsFile = 'php/'.$dir.'/'.$class_name . '.js'; $jsFileMin = 'php/'.$dir.'/'.$class_name . '.min.js'; } else { $jsFile = 'php/'.$class_name . '.js'; $jsFileMin = 'php/'.$class_name . '.min.js'; } if (file_exists($jsFile)) { $jsFileAge = filemtime($jsFile); } else { $jsFileAge = false;} if (file_exists($jsFileMin)) { $jsFileAgeMin = filemtime($jsFileMin); } else { $jsFileAgeMin = false;} if ($jsFileAge && $jsFileAgeMin) { if ($jsFileAgeMin >= $jsFileAge){ $js = file_get_contents($jsFileMin); } else { $js = file_get_contents($jsFile); } } elseif ($jsFileAgeMin) { $js = file_get_contents($jsFileMin); } elseif ($jsFileAge) { $js = file_get_contents($jsFile); } else { $js = false; } if ($js){ $js = <<<JS <script> {$js} </script> JS; echo $js; } } ?>