1 <?php
defined('IN_CMS') or die('No direct access allowed.');
5 public static function list_all() {
8 foreach(glob(PATH
. 'themes/*') as $folder) {
9 $theme = basename($folder);
11 if($about = static::parse($theme)) {
12 $themes[$theme] = $about;
19 public static function parse($theme) {
20 $file = PATH
. 'themes/' . $theme . '/about.txt';
22 if(file_exists($file) === false) {
26 // read file into a array
27 $contents = explode("\n", trim(file_get_contents($file)));
30 foreach(array('name', 'description', 'author', 'site', 'license') as $index => $key) {
34 // find line if exists
35 if(!isset($contents[$index])) {
39 $line = $contents[$index];
41 // skip if not separated by a colon character
42 if(strpos($line, ":") === false) {
46 $parts = explode(":", $line);
48 // remove the key part
51 // in case there was a colon in our value part glue it back together
52 $value = implode('', $parts);
54 $about[$key] = trim($value);