blob: 6e6028fcefc278db8ec823481dd43ac5c6637593 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
<?php
namespace Kanboard\Helper;
use Kanboard\Core\Base;
/**
* Application helpers
*
* @package helper
* @author Frederic Guillot
*/
class App extends Base
{
/**
* Get plugin name from route
*
* @access public
* @return string
*/
public function getPluginName()
{
return $this->router->getPlugin();
}
/**
* Get router controller
*
* @access public
* @return string
*/
public function getRouterController()
{
return $this->router->getController();
}
/**
* Get router action
*
* @access public
* @return string
*/
public function getRouterAction()
{
return $this->router->getAction();
}
/**
* 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()
{
$success_message = $this->flash->getMessage('success');
$failure_message = $this->flash->getMessage('failure');
if (! empty($success_message)) {
return '<div class="alert alert-success alert-fade-out">'.$this->helper->e($success_message).'</div>';
}
if (! empty($failure_message)) {
return '<div class="alert alert-error">'.$this->helper->e($failure_message).'</div>';
}
return '';
}
}
|