1 | <?php |
||
12 | class util |
||
13 | { |
||
14 | /** @var \phpbb\path_helper */ |
||
15 | protected $path_helper; |
||
16 | |||
17 | /** @var \phpbb\template\template */ |
||
18 | protected $template; |
||
19 | |||
20 | /** @var \phpbb\user */ |
||
21 | protected $user; |
||
22 | |||
23 | /** string */ |
||
24 | protected $web_path; |
||
25 | |||
26 | /** array */ |
||
27 | protected $assets; |
||
28 | |||
29 | /** |
||
30 | * Constructor |
||
31 | * |
||
32 | * @param \phpbb\path_helper $path_helper Path helper object |
||
33 | * @param \phpbb\template\template $template Template object |
||
34 | * @param \phpbb\user $user User object |
||
35 | */ |
||
36 | 101 | public function __construct(\phpbb\path_helper $path_helper, \phpbb\template\template $template, \phpbb\user $user) |
|
44 | |||
45 | /** |
||
46 | * include css/javascript |
||
47 | * @param array $assets array of form array('js' => array('test.js', 'test2.js'), 'css' => array()) |
||
48 | * @return void |
||
49 | */ |
||
50 | 2 | public function add_assets(array $assets) |
|
63 | |||
64 | /** |
||
65 | * Pass assets to template |
||
66 | */ |
||
67 | 2 | public function set_assets() |
|
79 | |||
80 | /** |
||
81 | * Add a secret token to the form (requires the S_FORM_TOKEN template variable) |
||
82 | * @param string $form_name The name of the form; has to match the name used in check_form_key, otherwise no restrictions apply |
||
83 | */ |
||
84 | 1 | public function get_form_key($form_name) |
|
90 | |||
91 | /** |
||
92 | * @return string |
||
93 | */ |
||
94 | 15 | public function get_default_avatar() |
|
98 | |||
99 | /** |
||
100 | * Returns a corrected theme path depending on whether or not we are accessing a controller |
||
101 | * @return string |
||
102 | */ |
||
103 | 15 | public function get_theme_path() |
|
108 | |||
109 | /** |
||
110 | * Returns a corrected root path depending on whether or not we are accessing a controller |
||
111 | * @return string |
||
112 | */ |
||
113 | 15 | public function get_web_path() |
|
121 | |||
122 | /** |
||
123 | * @param int $a |
||
124 | * @param int $b |
||
125 | * @return int |
||
126 | */ |
||
127 | 1 | protected function sort_assets($a, $b) |
|
136 | |||
137 | /** |
||
138 | * @return void |
||
139 | */ |
||
140 | 101 | protected function reset() |
|
147 | } |
||
148 |