Created
May 7, 2014 06:39
-
-
Save danlister/8ab9974ff8623c84e497 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using umbraco.cms.businesslogic.media | |
@{ | |
SaveMedias(Media.GetRootMedias()); | |
} | |
@functions | |
{ | |
public void SaveMedias(Media[] medias) | |
{ | |
if (medias == null || !medias.Any()) | |
return; | |
foreach (var media in medias) | |
{ | |
Response.Write("Saving " + media.Text + "/n"); | |
media.Save(); | |
SaveMedias(media.Children); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment