Skip to content

Commit

Permalink
get all templates at first
Browse files Browse the repository at this point in the history
  • Loading branch information
LinneyS committed Oct 12, 2021
1 parent 8d3726e commit 68c1c0c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lib/templatemanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,10 @@ public static function GetGlobalTemplateDir() {
public static function GetGlobalTemplates($mimetype = null) {
$templateDir = self::GetGlobalTemplateDir();

if (!empty($mimetype)) {
$templatesList = $templateDir->getDirectoryListing();
if (is_array($templatesList) && count($templatesList) > 0) {
$templatesList = $templateDir->searchByMime($mimetype);
}
} else {
$templatesList = $templateDir->getDirectoryListing();
$templatesList = $templateDir->getDirectoryListing();
if (!empty($mimetype)
&& is_array($templatesList) && count($templatesList) > 0) {
$templatesList = $templateDir->searchByMime($mimetype);
}

return $templatesList;
Expand Down

0 comments on commit 68c1c0c

Please sign in to comment.