From: Dan Untenzu Date: Fri, 17 Mar 2017 15:52:28 +0000 (+0100) Subject: [FEATURE] Move fatal error method X-Git-Tag: 3.1.0~2 X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/commitdiff_plain/6f8b5fe4757b151a042ea83adbce2eb6c218d104?ds=sidebyside;hp=--cc [FEATURE] Move fatal error method Move fatal error method to functions lib to use it in other scripts than install.php as well. --- 6f8b5fe4757b151a042ea83adbce2eb6c218d104 diff --git a/install.php b/install.php index 9e05b8c..2739bc8 100644 --- a/install.php +++ b/install.php @@ -102,13 +102,6 @@ function jirafeau_add_ending_slash($path) return $path . ((substr($path, -1) == '/') ? '' : '/'); } -function jirafeau_fatal_error($errorText) -{ - echo '

Error

' . $errorText . '

'; - require(JIRAFEAU_ROOT . 'lib/template/footer.php'); - exit; -} - /** * Check installation **/ diff --git a/lib/functions.php b/lib/functions.php index 50ab345..d844e50 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -128,6 +128,13 @@ function jirafeau_get_datetimefield($timestamp) return $content; } +function jirafeau_fatal_error($errorText, $cfg = array()) +{ + echo '

Error

' . $errorText . '

'; + require(JIRAFEAU_ROOT . 'lib/template/footer.php'); + exit; +} + function jirafeau_clean_rm_link($link) { $p = s2p("$link"); diff --git a/lib/template/footer.php b/lib/template/footer.php index 9e39858..f33373f 100644 --- a/lib/template/footer.php +++ b/lib/template/footer.php @@ -9,7 +9,7 @@ ?> | '; echo '' . t('Terms of Service') . ''; }