taking a stab at your last post Damyon Wiese
- <div templateid="thread"></div>
- <div templateid="post"></div>
- <div templateid="username"></div>
- <div templateid="post_date_modified"></div>
- <div templateid="post_date_created"></div>
- <div templateid="forum_title"></div>
ajax needs a way to "identify" which template to call.
other words...
- loaded up in some course page with "editing turned on"
- drag and drop an activity/resource to re-order things
- ajax grabs ID number of activity and current sort order, and sends info off to server / moodle
- php at server does initial php / SQL updating.
- php at server then looks at rest of AJAX sent information for "templateid"
- template coding does it thing
- template creates a (xml/json) what ever case may be. and send it to client.
- AJAX at client side obtains a string of data (xml/json)
- AJAX updates client side DOM (elements) along with adding/deleting javascript if any was included via AJAX send/receive.
if AJAX was to update an entire thread, the ajax would need to send templateid="thread",
if AJAX was used to submit an image to server for uploading, then AJAX would need to know "<div templateid="image_area" or next <div></div> outside of that. example
- <div templateid="page">
- <div templateid="forum>
- <div templateid="thread">
- <div templateid="post>
- <div templateid="postnumber">
- <div templateid="editing_post">
- <div templateid="file_manager">
- <div templateid="atto/tinymce_editor">
- <div templateid="file_area>
- <div templateid="image_area>
- <div templateid="editing_post">
- <div templateid="postnumber">
- <div templateid="post>
- <div templateid="thread">
- <div templateid="forum>
if in original page load there was no <div template="file_area"> then template would need to look at <div templateid="editing_post"> if no editing post, then post number...etc... working back to root of tree.
it almost seems like you are trying to figure out how to "work backwards" for a generic "tree base menu" and finding what is needed.
if you treat ajax calls, and javascript that goes along with the <div> statements above. so it is all a common tree base structure. such as DOM in a browser... ((most likely having a tree setup for each thing)) client side only js = tree 1, <div> = tree 2, ajax = tree 3, you might be able to condense each tree better? and some sort of common "id" between all trees, to link each thing together?
or am i missing your concerns Damyon wiese?