Skip to content

Commit

Permalink
Merge pull request #94 from haariga/dev/subFolder
Browse files Browse the repository at this point in the history
Add SubFolder Settings
  • Loading branch information
davidhellmann authored Jul 16, 2019
2 parents 2c63aeb + 115bc2f commit 5cd681e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name" : "haariga/craft-gonzo",
"description": "Component Library from your templates Folder",
"type" : "craft-plugin",
"version" : "1.0.0-beta.1",
"version" : "1.0.0-beta.2",
"keywords" : [
"craft",
"cms",
Expand Down
5 changes: 5 additions & 0 deletions src/controllers/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ public function init()
*/
public function dirtree($dir, $regex = '', $ignoreEmpty = false, $depth = 0)
{
// Powered by Internetzstube
if (CraftGonzo::getInstance()->getSettings()->subFolder) {
$dir .= DIRECTORY_SEPARATOR . CraftGonzo::getInstance()->getSettings()->subFolder;
}

// https://stackoverflow.com/questions/18251505/file-structure-to-multidimensional-array
$origin = new \IteratorIterator(new \DirectoryIterator($dir));
$dirs = [];
Expand Down
1 change: 1 addition & 0 deletions src/models/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Settings extends Model
public $patternLibFolder = 'patternlib';
public $optionsKey = 'opt';
public $compFolders = [];
public $subFolder = '';
public $navigation = [
0 => [
'name' => 'home',
Expand Down

0 comments on commit 5cd681e

Please sign in to comment.