Skip to content

Commit

Permalink
Merge pull request #38 from born05/master
Browse files Browse the repository at this point in the history
Added support for asset fieldLayouts.
  • Loading branch information
Bob Olde Hampsink committed Mar 31, 2016
2 parents 496ee6f + a06fe19 commit 833749d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Services/AssetSources.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ private function populateAssetSource($assetHandle, array $assetSourceDefinition)
'settings' => $assetSourceDefinition['settings'],
]);

$fieldLayout = Craft::app()->schematic_fields->getFieldLayout($assetSourceDefinition['fieldLayout']);
$assetSource->setFieldLayout($fieldLayout);

return $assetSource;
}

Expand Down Expand Up @@ -127,6 +130,7 @@ private function getAssetSourceDefinition(AssetSourceModel $assetSource)
'name' => $assetSource->name,
'sortOrder' => $assetSource->sortOrder,
'settings' => $assetSource->settings,
'fieldLayout' => Craft::app()->schematic_fields->getFieldLayoutDefinition($assetSource->getFieldLayout()),
];
}
}

0 comments on commit 833749d

Please sign in to comment.