Skip to content

Instantly share code, notes, and snippets.

@brandonkelly
Created June 28, 2011 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandonkelly/1051722 to your computer and use it in GitHub Desktop.
Save brandonkelly/1051722 to your computer and use it in GitHub Desktop.
Assets.Sheet usage
// -------------------------------------------
// 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();
// -------------------------------------------
// 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