Make WordPress Core

Opened 20 years ago

Closed 19 years ago

#2539 closed defect (bug) (wontfix)

Better maintainability of client-server administration code.

Reported by: mdawaffe Owned by:
Priority: low Milestone:
Component: General Version: 2.0.1
Severity: normal Keywords: AJAX
Cc: Focuses:

Description

Much of the server-DB interaction code for administration is in one place (admin-db.php). It'd be nice if all the client-server interaction code were in one place as well (admin-delta.php?).

Example: you can delete a comment both by going through list-manipulation.php and edit-comments.php. With one file, we could see if we were

  1. doing AJAX and just die() some strings like we do now in list-manipulation.php, or
  1. rockin it old school and redirect to the right template.

Easier to keep all our ducks in a row (cf. #2538).

(Is this a dupe? I seem to remember seeing some conversation about related issues, but can't find anything here or on the lists.)

Change History (5)

#1 @ryan
20 years ago

In trunk, I've been trying to separate the template stuff from the interaction stuff from the db stuff. post.php, for example, is pretty much just an interaction layer between the templates and the DB functions. Same with comment.php, page.ph, and link.php. categories.php needs to have the interaction bits moved into category.php. Some of these still handle displaying the edit form, but the form is included from another file so there are no template bits directly mixed in with the interaction code.

#2 @mdawaffe
20 years ago

We could define a DOING_AJAX constant in list-manipulation.php and then have all the cases in that file point to where they are handled in the regular, non-AJAX files ('delete-post' going to post.php with $action = 'delete' ). These non-AJAX sections would then have to be tweaked to change their behaviour based on DOING_AJAX. That keeps the JS simple.

Alternatively, we could get rid of list-manipulation.php altogether and make the JS beefy enough to direct the AJAX calls to the right file. I'd like to keep the JS as small as possible, though. Plus, it'll be tricky to detect if we're doing an AJAX call.

Thoughts? PS: No need to take care of this right away.

#3 @matt
20 years ago

  • Milestone 2.12.2

#4 @foolswisdom
19 years ago

  • Milestone 2.22.4

#5 @Nazgul
19 years ago

  • Milestone 2.4
  • Resolutionwontfix
  • Status newclosed

No traction for nearly a year, so closing as wontfix.

Feel free to reopen if you have patches/suggestions/...

Note: See TracTickets for help on using tickets.