summaryrefslogtreecommitdiff
path: root/app/Helper/App.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Helper/App.php')
-rw-r--r--app/Helper/App.php56
1 files changed, 56 insertions, 0 deletions
diff --git a/app/Helper/App.php b/app/Helper/App.php
new file mode 100644
index 00000000..8f591143
--- /dev/null
+++ b/app/Helper/App.php
@@ -0,0 +1,56 @@
+<?php
+
+namespace Helper;
+
+/**
+ * Application helpers
+ *
+ * @package helper
+ * @author Frederic Guillot
+ */
+class App extends \Core\Base
+{
+ /**
+ * Get javascript language code
+ *
+ * @access public
+ * @return string
+ */
+ public function jsLang()
+ {
+ return $this->config->getJsLanguageCode();
+ }
+
+ /**
+ * Get current timezone
+ *
+ * @access public
+ * @return string
+ */
+ public function getTimezone()
+ {
+ return $this->config->getCurrentTimezone();
+ }
+
+ /**
+ * Get session flash message
+ *
+ * @access public
+ * @return string
+ */
+ public function flashMessage()
+ {
+ $html = '';
+
+ if (isset($this->session['flash_message'])) {
+ $html = '<div class="alert alert-success alert-fade-out">'.$this->helper->e($this->session['flash_message']).'</div>';
+ unset($this->session['flash_message']);
+ }
+ else if (isset($this->session['flash_error_message'])) {
+ $html = '<div class="alert alert-error">'.$this->helper->e($this->session['flash_error_message']).'</div>';
+ unset($this->session['flash_error_message']);
+ }
+
+ return $html;
+ }
+}