Skip to content

Commit

Permalink
MINOR Documentation (from r105011)
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112431 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
chillu committed Oct 15, 2010
1 parent 72abcd0 commit 8d27740
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions core/ManifestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 8d27740

Please sign in to comment.