From 507133b4dbaf35fb22e7be58df9934ca59d36154 Mon Sep 17 00:00:00 2001 From: Awilum Date: Sat, 22 Dec 2018 20:14:13 +0300 Subject: [PATCH] Infrastructure changes: change blueprints to fieldsets --- flextype/Themes.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/flextype/Themes.php b/flextype/Themes.php index ba218c87..f6b17194 100644 --- a/flextype/Themes.php +++ b/flextype/Themes.php @@ -142,31 +142,31 @@ class Themes } /** - * Get templates blueprints for current theme + * Get Fieldsets for current theme * * @access public * @return array */ - public static function getTemplatesBlueprints() : array + public static function getFieldsets() : array { - $blueprints = []; + $fieldsets = []; - // Get blueprints files - $_blueprints = Filesystem::getFilesList(PATH['themes'] . '/' . Registry::get('settings.theme') . '/blueprints/', 'yaml'); + // Get fieldsets files + $_fieldsets = Filesystem::getFilesList(PATH['themes'] . '/' . Registry::get('settings.theme') . '/fieldsets/', 'yaml'); // If there is any template file then go... - if (count($_blueprints) > 0) { - foreach ($_blueprints as $blueprint) { - if (!is_bool(Themes::_strrevpos($blueprint, '/blueprints/'))) { - $blueprint_name = str_replace('.yaml', '', substr($blueprint, Themes::_strrevpos($blueprint, '/blueprints/')+strlen('/blueprints/'))); - $blueprint = YamlParser::decode(Filesystem::getFileContent($blueprint)); - $blueprints[$blueprint_name] = $blueprint['title']; + if (count($_fieldsets) > 0) { + foreach ($_fieldsets as $fieldset) { + if (!is_bool(Themes::_strrevpos($fieldset, '/fieldsets/'))) { + $fieldset_name = str_replace('.yaml', '', substr($fieldset, Themes::_strrevpos($fieldset, '/fieldsets/')+strlen('/fieldsets/'))); + $fieldset = YamlParser::decode(Filesystem::getFileContent($fieldset)); + $fieldsets[$fieldset_name] = $fieldset['title']; } } } - // return blueprints - return $blueprints; + // return fieldsets + return $fieldsets; } /**