diff options
Diffstat (limited to 'app')
-rwxr-xr-x | app/app.php | 14 | ||||
-rw-r--r-- | app/helpers.php | 33 |
2 files changed, 33 insertions, 14 deletions
diff --git a/app/app.php b/app/app.php index 5cda95c..a6232cf 100755 --- a/app/app.php +++ b/app/app.php @@ -28,17 +28,3 @@ if (is_installed()) { $l10n = new Simplel10n($conf['locale']); -// this is an helper function. We will usually use that function and not Simplel10n::getString() -function _g($str, $comment='') { - return Simplel10n::getString($str); -} - -function custom_path($file = '') -{ - return __DIR__.'/../custom' . (!empty($file) ? '/'.$file : ''); -} - -function is_installed() -{ - return file_exists(custom_path('config.yml')) && file_exists(custom_path('people.opml')); -} diff --git a/app/helpers.php b/app/helpers.php new file mode 100644 index 0000000..6ec55c1 --- /dev/null +++ b/app/helpers.php @@ -0,0 +1,33 @@ +<?php + +/** + * Path to the _custom_ directory. + * + * @param string $file Append this filename to the returned path. + * @return string + */ +function custom_path($file = '') +{ + return __DIR__.'/../custom' . (!empty($file) ? '/'.$file : ''); +} + +/** + * Is moonmoon installed? + * + * @return bool + */ +function is_installed() +{ + return file_exists(custom_path('config.yml')) && file_exists(custom_path('people.opml')); +} + +/** + * Shortcut to Simplel10n::getString(). + * + * @param string $str + * @param string $comment + * @return string + */ +function _g($str, $comment='') { + return Simplel10n::getString($str, $comment); +}
\ No newline at end of file |