Skip to content
This repository has been archived by the owner on Apr 25, 2019. It is now read-only.

Commit

Permalink
Fixed issue #206 (#212)
Browse files Browse the repository at this point in the history
Fixed ordering of base pattern to bubble to top.
  • Loading branch information
Triickii authored and gazjoy committed Mar 9, 2017
1 parent daeaa10 commit 9ebc53d
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions inc/lib/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ public static function getContent($requestPath, $options)
$html .= self::loadReadme($patternSectionPath);
}

$patternSectionFiles = self::arrangeSections($patternSectionFiles);

foreach ($patternSectionFiles as $patternSectionFile) {
//we are in the pattern > section > files
if (substr($patternSectionFile, 0, 1) == '.') continue;
if ($patternSectionFile == 'readme.php') continue;

$patternSectionFilePath = $patternPath . $patternSection . '/' . $patternSectionFile;
$html .= self::sectionContent($patternSectionFile, $patternSectionFilePath, $i);
Expand Down Expand Up @@ -169,4 +169,24 @@ public static function loadReadme($file) {
return $html;
}

public static function arrangeSections($sectionArray) {
$i = 1;
$sections = array();
foreach($sectionArray as $key => $section) {
if (substr($section, 0, 1) == '.') continue;
if ($section == 'readme.php') continue;

if($section == 'base.php') {
$sections[0] = $section;
}else{
$sections[$i] = $section;
$i++;
}
}

ksort($sections);

return $sections;
}

}

0 comments on commit 9ebc53d

Please sign in to comment.