Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Documentation (from r105011)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112431 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit 8d27740cf91392fd01fb44ebd06bc27c9c9e9055 1 parent 72abcd0
@chillu chillu authored
Showing with 18 additions and 2 deletions.
  1. +18 −2 core/ManifestBuilder.php
View
20 core/ManifestBuilder.php
@@ -216,6 +216,8 @@ static function get_manifest_info($baseDir, $excludedFolders = array()) {
// have an _manifest_exclude file
$topLevel = scandir($baseDir);
foreach($topLevel as $filename) {
+
+ // Skip certain directories
if($filename[0] == '.') continue;
if($filename == 'themes') continue;
if($filename == 'assets') continue;
@@ -314,18 +316,32 @@ private static function get_all_php_files($folder, $excludedFolders, &$allPhpFil
/**
- * Generates the template manifest - a list of all the .SS files in the
- * application
+ * Generates the template manifest - a list of all the .ss files in the
+ * application.
+ *
+ * See {@link SSViewer} for an overview on the array structure this class creates.
+ *
+ * @param String $baseDir
+ * @param String $folder
*/
private static function getTemplateManifest($baseDir, $folder, $excludedFolders, &$templateManifest, &$cssManifest, $themeName = null) {
$items = scandir("$baseDir/$folder");
if($items) foreach($items as $item) {
+ // Skip hidden files/folders
if(substr($item,0,1) == '.') continue;
+
+ // Parse *.ss files
if(substr($item,-3) == '.ss') {
+ // Remove extension from template name
$templateName = substr($item, 0, -3);
+
+ // The "type" is effectively a subfolder underneath $folder,
+ // mostly "Includes" or "Layout".
$templateType = substr($folder,strrpos($folder,'/')+1);
+ // The parent folder counts as type "main"
if($templateType == "templates") $templateType = "main";
+ // Write either to theme or to non-themed array
if($themeName) {
$templateManifest[$templateName]['themes'][$themeName][$templateType] = "$baseDir/$folder/$item";
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.