diff --git a/app/inc/init.php b/app/inc/init.php index 4c9eaf5..42c46c1 100644 --- a/app/inc/init.php +++ b/app/inc/init.php @@ -17,7 +17,6 @@ * Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft) */ use Framadate\FramaDB; -use Framadate\Utils; // Autoloading of dependencies with Composer require_once __DIR__ . '/../../vendor/autoload.php'; @@ -36,34 +35,8 @@ require_once __DIR__ . '/constants.php'; require_once __DIR__ . '/i18n.php'; // Smarty -require_once __DIR__ . '/../../vendor/smarty/smarty/libs/Smarty.class.php'; -$smarty = new \Smarty(); -$smarty->setTemplateDir(ROOT_DIR . '/tpl/'); -$smarty->setCompileDir(ROOT_DIR . '/tpl_c/'); -$smarty->setCacheDir(ROOT_DIR . '/cache/'); -$smarty->caching = false; - -$smarty->assign('APPLICATION_NAME', NOMAPPLICATION); -$smarty->assign('SERVER_URL', Utils::get_server_name()); -$smarty->assign('TITLE_IMAGE', IMAGE_TITRE); -$smarty->assign('use_nav_js', file_exists($_SERVER['DOCUMENT_ROOT'] . '/nav/nav.js')); -$smarty->assign('lang', $lang); -$smarty->assign('langs', $ALLOWED_LANGUAGES); -$smarty->assign('date_format', $date_format); - -function smarty_modifier_poll_url($poll_id, $admin = false) { - return Utils::getUrlSondage($poll_id, $admin); -} - -function smarty_modifier_markdown($md, $clear = false) { - return Utils::markdown($md, $clear); -} - -function smarty_modifier_resource($link) { - return Utils::get_server_name() . $link; -} - -// End- Smarty +require_once __DIR__ . '/smarty.php'; +// Connection to database $connect = new FramaDB(DB_CONNECTION_STRING, DB_USER, DB_PASSWORD); $err = 0; diff --git a/app/inc/smarty.php b/app/inc/smarty.php new file mode 100644 index 0000000..be96e88 --- /dev/null +++ b/app/inc/smarty.php @@ -0,0 +1,50 @@ +setTemplateDir(ROOT_DIR . '/tpl/'); +$smarty->setCompileDir(ROOT_DIR . '/tpl_c/'); +$smarty->setCacheDir(ROOT_DIR . '/cache/'); +$smarty->caching = false; + +$smarty->assign('APPLICATION_NAME', NOMAPPLICATION); +$smarty->assign('SERVER_URL', Utils::get_server_name()); +$smarty->assign('TITLE_IMAGE', IMAGE_TITRE); +$smarty->assign('use_nav_js', file_exists($_SERVER['DOCUMENT_ROOT'] . '/nav/nav.js')); +$smarty->assign('lang', $lang); +$smarty->assign('langs', $ALLOWED_LANGUAGES); +$smarty->assign('date_format', $date_format); + +function smarty_modifier_poll_url($poll_id, $admin = false) { + return Utils::getUrlSondage($poll_id, $admin); +} + +function smarty_modifier_markdown($md, $clear = false) { + return Utils::markdown($md, $clear); +} + +function smarty_modifier_resource($link) { + return Utils::get_server_name() . $link; +} + +function smarty_modifier_html($html) { + return htmlentities($html, ENT_HTML5 | ENT_QUOTES); +} diff --git a/locale/en_GB/LC_MESSAGES/Studs.po b/locale/en_GB/LC_MESSAGES/Studs.po index aaab4bf..f6f1e22 100644 --- a/locale/en_GB/LC_MESSAGES/Studs.po +++ b/locale/en_GB/LC_MESSAGES/Studs.po @@ -211,8 +211,8 @@ msgstr "Email" msgid "Edit the email adress" msgstr "Edit the email adress" -msgid "Save the email address " -msgstr "Save the email address " +msgid "Save the email address" +msgstr "Save the email address" msgid "Cancel the email address edit" msgstr "Cancel the email address edit" diff --git a/locale/fr_FR/LC_MESSAGES/Studs.po b/locale/fr_FR/LC_MESSAGES/Studs.po index 52e62c0..c06c789 100644 --- a/locale/fr_FR/LC_MESSAGES/Studs.po +++ b/locale/fr_FR/LC_MESSAGES/Studs.po @@ -211,7 +211,7 @@ msgstr "Courriel" msgid "Edit the email adress" msgstr "Modifier le courriel" -msgid "Save the email address " +msgid "Save the email address" msgstr "Enregistrer le courriel" msgid "Cancel the email address edit" diff --git a/tpl/admin/migration.tpl b/tpl/admin/migration.tpl index 6cd818c..150ecad 100644 --- a/tpl/admin/migration.tpl +++ b/tpl/admin/migration.tpl @@ -4,17 +4,17 @@
-
{_('Back to the homepage of')} {$APPLICATION_NAME}
+{_('Back to the homepage of')} {$APPLICATION_NAME|html}