mirror of
https://github.com/flextype/flextype.git
synced 2025-08-18 10:51:21 +02:00
Themes: New public method getTemplatesBlueprints() - added
This commit is contained in:
@@ -142,6 +142,33 @@ class Themes
|
||||
return $templates;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get templates blueprints for current theme
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public static function getTemplatesBlueprints() : array
|
||||
{
|
||||
$blueprints = [];
|
||||
|
||||
// Get blueprints files
|
||||
$_blueprints = Filesystem::getFilesList(PATH['themes'] . '/' . Registry::get('system.theme') . '/blueprints/', '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('.php', '', substr($blueprint, Themes::_strrevpos($blueprint, '/blueprints/')+strlen('/blueprints/')));
|
||||
$blueprints[$blueprint_name] = $blueprint_name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// return blueprints
|
||||
return $blueprints;
|
||||
}
|
||||
|
||||
/**
|
||||
* _strrevpos
|
||||
*/
|
||||
|
Reference in New Issue
Block a user