A repository about the Personal Dossiers Project in ISN. It is about the development of a "collecting mechanism" of dossiers-items already hosted in ISN's digital library and transformation of this collection into user-defined educational modules.
0
stars
0
forks
source link
Send and store the new positions to the server. #94
It is executed when we lock the edit dossier button. Right after the setOrder(ordered_list)
It sends an ajax POST request to the server. The url will look like this: htp://yellowjacket.ethz.ch/tools/service/dossier.php/1/x, where x will be a positive integer. It doesn't matter the exact value of it. We just need a value greater than zero in order to run into the update_item function of the handle_POST in the backend. However the dossier id will be send to the server via the url. The most important job will be done afterwards by the sorted_list array. The latter will be sent in the body of the request as data. This list contains the id's of the dossier items as well as their position.
Backend: update_item();
It gets the dossier_id from the url, which is striped in the constructor
It gets the ordered_list from the POST. The indices in this list show the position of the dossier_item whose id is the value of this position.
We iterate over the sorted list array and for each item we update the dossier_items table.
FrontEnd: arrangeItem();
Backend: update_item();