-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathParser.php
More file actions
33 lines (29 loc) · 1.01 KB
/
Copy pathParser.php
File metadata and controls
33 lines (29 loc) · 1.01 KB
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
<?php
/**
* Copyright (C) 2015-2019 FeatherBB
* Parser (C) 2011 Jeff Roberson (jmrware.com)
* based on code by (C) 2008-2015 FluxBB
* and Rickard Andersson (C) 2002-2008 PunBB
* License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
*/
namespace FeatherBB\Model\Admin;
use FeatherBB\Core\Interfaces\ForumEnv;
use FeatherBB\Core\Interfaces\Hooks;
class Parser
{
// Helper public function returns array of smiley image files
// stored in the style/img/smilies directory.
public function getSmileyFiles()
{
$imgfiles = [];
$filelist = scandir(ForumEnv::get('FEATHER_ROOT').'style/img/smilies');
$filelist = Hooks::fire('model.admin.parser.get_smiley_files.filelist', $filelist);
foreach ($filelist as $file) {
if (preg_match('/\.(?:png|gif|jpe?g)$/', $file)) {
$imgfiles[] = $file;
}
}
$imgfiles = Hooks::fire('model.admin.parser.get_smiley_files.imgfiles', $imgfiles);
return $imgfiles;
}
}