Created
June 28, 2011 17:56
-
-
Save brandonkelly/1051722 to your computer and use it in GitHub Desktop.
Assets.Sheet usage
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
// ------------------------------------------- | |
// Include the Sheet resources in PHP | |
// ------------------------------------------- | |
if (! class_exists('Assets_helper')) | |
{ | |
require PATH_THIRD.'assets/helper.php'; | |
} | |
$assets_helper = new Assets_helper; | |
$assets_helper->include_sheet_resources(); |
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
// ------------------------------------------- | |
// Open the sheet in JS | |
// ------------------------------------------- | |
var sheet = new Assets.Sheet({ | |
// optional settings (these are the default values): | |
multiSelect: false, | |
filedirs: 'all', // or array of filedir IDs | |
kinds: 'any', // or array of file kinds ("image", "flash", etc) | |
// onSelect callback (required): | |
onSelect: function(files) { | |
// files is an array of file paths and URLs, e.g.: | |
// [ | |
// { path: "{filedir_1}filename1.jpg", url: "/images/uploads/filename1.jpg" } | |
// { path: "{filedir_1}filename2.jpg", url: "/images/uploads/filename2.jpg" } | |
// ] | |
} | |
}); | |
sheet.show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment