1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-12 16:14:16 +02:00

Flextype Core: New Fieldsets API - improvements

This commit is contained in:
Awilum
2019-02-22 22:19:17 +03:00
parent 09fef788a1
commit be9603a83a

View File

@@ -160,33 +160,6 @@ class Themes
return $templates;
}
/**
* Get Fieldsets for current theme
*
* @access public
* @return array
*/
public static function getFieldsets() : array
{
$fieldsets = [];
// Get fieldsets files
$_fieldsets = Filesystem::listContents(PATH['themes'] . '/' . Registry::get('settings.theme') . '/fieldsets/');
// If there is any template file then go...
if (count($_fieldsets) > 0) {
foreach ($_fieldsets as $fieldset) {
if ($fieldset['type'] == 'file' && $fieldset['extension'] == 'yaml') {
$fieldset_content = YamlParser::decode(Filesystem::read($fieldset['path']));
$fieldsets[$fieldset['basename']] = $fieldset_content['title'];
}
}
}
// return fieldsets
return $fieldsets;
}
/**
* Get the Themes instance.
*