Ajax in Sidebar Plug-in Admin Interface

I would like to do drag and drop ordering of information in the admin
section of a plug-in. I tried to define the update method in the
plugin controller, but ajax was unable to call it. Anybody have any
ideas on how I can get this to work. Here is a link to some code.

http://rafb.net/paste/results/I5f5nJ15.html

Right now I’m just trying to get the standard scriptaculous example to
work. I’m not even trying to save the data yet into the config var.

Thanks,
Chris

“Chris Saylor” [email protected] writes:

I would like to do drag and drop ordering of information in the admin
section of a plug-in. I tried to define the update method in the
plugin controller, but ajax was unable to call it. Anybody have any
ideas on how I can get this to work. Here is a link to some code.

http://rafb.net/paste/results/I5f5nJ15.html

Right now I’m just trying to get the standard scriptaculous example to
work. I’m not even trying to save the data yet into the config var.

Does scriptaculous let you do nested drag and drop?

The drag and drop portion is working fine. It just doesn’t communicate
back to the method I have defined in my plugin controller.

What I’m actually trying to do is create a page menu plugin. The drag
and drop is for sorting the pages in the menu. I’m actually thinking
the sorting functionality would be better put in the show pages admin
screen, and the order field stored in the content table. What do you
think?

Thanks,
Chris

+1 It would be great if sidebars could have more than just the “content
page”. I tried it by updating the DIV via Javascript, but when you
access
the sidebars outside of the controller loaded context things get icky.
Probably why they are so hard to test.
I think if Piers refactored sidebar code comes to be then doing this
will be
a lot easier.

“Chris Saylor” [email protected] writes:

The drag and drop portion is working fine. It just doesn’t communicate
back to the method I have defined in my plugin controller.

And it won’t do; it’s a function of how sidebars work; the only
actions they can respond to are configure and content, and those are
pretty constrained.

What I’m actually trying to do is create a page menu plugin. The drag
and drop is for sorting the pages in the menu. I’m actually thinking
the sorting functionality would be better put in the show pages admin
screen, and the order field stored in the content table. What do you
think?

Umm… I’ve always just used a static sidebar for my links to
pages. If belongs anywhere, it belongs in a plugin rather than
complicating the admin interface any further. But, right now, you
can’t do what you want.

When the trac’s up, we need to add an “allow sidebar plugins to respond
to more actions than just ‘content’ and ‘configure’” ticket with a
quick discussion of what you’re trying to do. Probably marked as for
4.x/5.0 I’m afraid.