1 | <?php |
||
13 | abstract class helper |
||
14 | { |
||
15 | /** @var \phpbb\extension\manager */ |
||
16 | private $extension_manager; |
||
17 | |||
18 | /** @var \phpbb\path_helper */ |
||
19 | private $path_helper; |
||
20 | |||
21 | /** @var string */ |
||
22 | public $categories_table; |
||
23 | |||
24 | /** @var string */ |
||
25 | public $comments_table; |
||
26 | |||
27 | /** @var string */ |
||
28 | public $links_table; |
||
29 | |||
30 | /** @var string */ |
||
31 | public $votes_table; |
||
32 | |||
33 | /** @var string */ |
||
34 | public $watch_table; |
||
35 | |||
36 | /** @var string */ |
||
37 | private $ext_name = 'ernadoo/phpbbdirectory'; |
||
38 | |||
39 | /** |
||
40 | * Set the extension manager |
||
41 | * |
||
42 | * @param \phpbb\extension\manager $phpbb_extension_manager |
||
43 | * @return null |
||
44 | */ |
||
45 | public function set_extension_manager(\phpbb\extension\manager $phpbb_extension_manager) |
||
49 | |||
50 | /** |
||
51 | * Set the path helper |
||
52 | * |
||
53 | * @param \phpbb\path_helper $path_helper |
||
54 | * @return null |
||
55 | */ |
||
56 | public function set_path_helper(\phpbb\path_helper $path_helper) |
||
60 | |||
61 | /** |
||
62 | * Set the tables names |
||
63 | * |
||
64 | * @param string $categories_table |
||
65 | * @param string $comments_table |
||
66 | * @param string $links_table |
||
67 | * @param string $votes_table |
||
68 | * @param string $watch_table |
||
69 | * @return null |
||
70 | */ |
||
71 | public function set_tables($categories_table, $comments_table, $links_table, $votes_table, $watch_table) |
||
79 | /** |
||
80 | * Return ext name |
||
81 | * |
||
82 | * @param bool $web_root_path Whether the path should be relative to web root |
||
83 | * @return string Path to an extension |
||
84 | */ |
||
85 | public function get_ext_name($web_root_path = false) |
||
89 | |||
90 | /** |
||
91 | * Return path to resource image |
||
92 | * |
||
93 | * @param string $type is ressource type (flags|icons) |
||
94 | * @param string $image is the resource to display |
||
95 | * @return string The relative path to ressource |
||
96 | */ |
||
97 | public function get_img_path($type, $image = '') |
||
101 | |||
102 | /** |
||
103 | * Return path to banner |
||
104 | * |
||
105 | * @param string $banner is the physical name |
||
106 | * @return string The relative path to banner |
||
107 | */ |
||
108 | public function get_banner_path($banner = '') |
||
112 | |||
113 | /** |
||
114 | * Return array entries that match the pattern |
||
115 | * |
||
116 | * @link http://php.net/manual/fr/function.preg-grep.php#95787 |
||
117 | * |
||
118 | * @param string $pattern The pattern to search for |
||
119 | * @param array $input The input array |
||
120 | * @return array $vals Returns an array indexed using the keys from the input array |
||
121 | */ |
||
122 | public function preg_grep_keys($pattern, $input) |
||
132 | } |
||
133 |