Skip to content
Browse files

Allow any subfolder structure within /templates/partials

  • Loading branch information...
1 parent 779c506 commit 920fe2e3dc25daf2bbe756acd151c5387ce3af7a @kolber committed
View
3 app/asset-types/asset-factory.inc.php
@@ -7,7 +7,8 @@
static function &create($file_path) {
# if the file path isn't passed through as a string, return an empty data array
- if(!is_string($file_path)) return array();
+ $data = array();
+ if(!is_string($file_path)) return $data;
# split by file extension
preg_match('/\.([\w\d]+?)$/u', $file_path, $split_path);
View
3 app/parsers/template-parser.inc.php
@@ -4,7 +4,8 @@
static function get_partial_template($name) {
# return contents of partial file, or return 'not found' error (as text)
- return (file_exists('./templates/partials/'.$name.'.html')) ? file_get_contents('./templates/partials/'.$name.'.html') : '\'/templates/partials/'.$name.'.html\' not found';
+ $partial = Helpers::rglob('./templates/partials/*'.$name.'.html');
+ return isset($partial[0]) ? file_get_contents($partial[0]) : 'Partial \''.$name.'.html\' not found';
}
static function parse($data, $template) {
View
0 templates/partials/html.html → templates/partials/assets/html.html
File renamed without changes.
View
0 templates/partials/images.html → templates/partials/assets/images.html
File renamed without changes.
View
0 templates/partials/media.html → templates/partials/assets/media.html
File renamed without changes.
View
0 templates/partials/pdfs.html → templates/partials/assets/pdfs.html
File renamed without changes.
View
0 templates/partials/swf.html → templates/partials/assets/swf.html
File renamed without changes.
View
0 templates/partials/video.html → templates/partials/assets/video.html
File renamed without changes.
View
0 templates/partials/category_lists.html → ...s/partials/navigation/category_lists.html
File renamed without changes.
View
0 templates/partials/children.html → templates/partials/navigation/children.html
File renamed without changes.
View
0 templates/partials/navigation.html → ...lates/partials/navigation/navigation.html
File renamed without changes.

0 comments on commit 920fe2e

Please sign in to comment.
Something went wrong with that request. Please try again.