Hi,
I’ve written a javascript that uses scriptaculous to allow the order of images in a MaxiGallery to be set by dragging thumbnails in the manager.
More complete instructions on use are in the main javascript file, draggableReorder.js, but briefly:
1) put it in assets/snippets/maxigallery/js,
2) if you haven’t altered the templates/managepicturetpl.html and templates/manageoutertpl.html files, just back them up and copy the ones from the zip file into assets/snippets/maxigallery/templates
3) backup assets/snippets/maxigallery/maxigallery.php, then search for:
$mg->regScriptsAndCSS();
and just after the first occurance, insert:
$modx->regClientStartupScript($modx->config[’base_url’] . ’assets/snippets/maxigallery/js/draggableReorder.js’);
4) copy the included file draggabletpl.html into assets/snippets/maxigallery/templates
Now log in to your web site as a user who can manage your maxigallery. Click on Manage Pictures, and an extra button should show up "Drag to re-order". This should open a new window with draggable thumbnails to allow you to re-order your gallery. Drag them around, and hit save to save the new order.
This was written to use mootools or scriptaculous. This script and mootools won’t work with IE though (I’ve no idea why), so you’d probably better use scriptaculous unless you only use something other than IE to manage your gallery.
Al
LOL, I just scratched this feature off from my
todo list four days ago..
How would you feel about including this to the main snippet by default? It needs to be fixed for IE first, but I don’t think that’s a big issue. And what do other people think about it? Good or bad and why?
And, What do you think about doing it with MooTools?
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
Yea, MooTools would be better I think.. and btw, resources shouldn’t use the files under /manager folder..
Here’s an example on how to do a sortable list with MooTools (also see the
update), seems to be quite simple (demo
here)..
What do you think about making the management view itself to be a sortable one and not in a new window? Or do you think it’s more usable if the sorting happens on a new window?
About the zip thing, I have looked littlebit into that and it definitely needs changing, it’s a mess in maxigallery code anyways.. I’ve thought about starting to use
PclZip to manage zip files. It seems to be working fairly well for users in Scotty’s resource wizard module.. What do you think about it?
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
-
☆ A M B ☆
- 24,524 Posts
Is using this library liable to cause conflicts with systems that have it configured in the PHP?
I have this problem with a SOAP library I’m using; if my scripts load the third-party SOAP library and PHP is configured with SOAP, they conflict. So I have to have two version of the script, since most shared hosting installations don’t have SOAP included.
Actually, I suppose that’s the fault of the library developer; I would think that one should take great care not to conflict with any default library’s namespace.
Quote from: sottwell at Dec 31, 2006, 01:58 AM
Is using this library liable to cause conflicts with systems that have it configured in the PHP?
Not sure, but I think that it won’t collide with ZZIPlib.. The first versions of PclZip used to use ZZIPlib for extracting zips and their own code for creating a zip, but the later versions have functionality to do the extracting too.. so I guess they have taken the possible namespace etc conflicts into consideration while developing it..
Quote from: al_b at Dec 31, 2006, 04:21 AM
What do you think about making the management view itself to be a sortable one and not in a new window? Or do you think it’s more usable if the sorting happens on a new window?
I thought it was better in a new window. That way you just have to drag some thumbnails around and the extra form fields don’t need to be displayed. It’s more compact like that.
Yeah.. could be.. leave it like that..
Quote from: al_b at Dec 31, 2006, 04:21 AM
Thinking about zips... Perhaps there could be a way of including a certain file in the zip with renaming info in? When the zip is uploaded. titles and descriptions could be filled in automatically. I did this on one of my other sites, and it made it much easier - you do the work offline, then just upload it.
Sounds good to me..
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
I’ve uploaded a new version of this script 0.2a. It allows users to edit a template to use either mootools or scriptaculous. IE doesn’t do anything when it’s set up for mootools. I’ve no idea why. It seems straightforward to me, and as usual FF is fine. Better use scriptaculous for now...
Doze: feel free to include this in the distro.