aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/ApplicationUtils.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2017-01-03 11:42:21 +0100
committerArthurHoaro <arthur@hoa.ro>2017-01-05 16:16:23 +0100
commita0df06517bada0f811b464017ce385290e02c2bf (patch)
tree6bc3e99a9e9b93eb3e0f531f67a607dec748f407 /application/ApplicationUtils.php
parentadc4aee80f7cd3242f65f0b316af2b560a64712c (diff)
downloadShaarli-a0df06517bada0f811b464017ce385290e02c2bf.tar.gz
Shaarli-a0df06517bada0f811b464017ce385290e02c2bf.tar.zst
Shaarli-a0df06517bada0f811b464017ce385290e02c2bf.zip
Minor improvements regarding #705 (coding style, unit tests, etc.)
Diffstat (limited to 'application/ApplicationUtils.php')
-rw-r--r--application/ApplicationUtils.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/application/ApplicationUtils.php b/application/ApplicationUtils.php
index a0f482b0..cc009a1d 100644
--- a/application/ApplicationUtils.php
+++ b/application/ApplicationUtils.php
@@ -195,4 +195,24 @@ class ApplicationUtils
195 195
196 return $errors; 196 return $errors;
197 } 197 }
198
199 /**
200 * Get a list of available themes.
201 *
202 * It will return the name of any directory present in the template folder.
203 *
204 * @param string $tplDir Templates main directory.
205 *
206 * @return array List of theme names.
207 */
208 public static function getThemes($tplDir)
209 {
210 $allTheme = glob($tplDir.'/*', GLOB_ONLYDIR);
211 $themes = [];
212 foreach ($allTheme as $value) {
213 $themes[] = str_replace($tplDir.'/', '', $value);
214 }
215
216 return $themes;
217 }
198} 218}