Updating Cached Front-Facing Content After Gallery Edits: Difference between revisions

From Littledamien Wiki
Jump to navigation Jump to search
Line 15: Line 15:
Adding a new image to the gallery.
Adding a new image to the gallery.


# Click "add image" button.
* Click "add image" button.
## JavaScript handler invokes the shared AJAX script, which returns the markup for the form as JSON.
** JavaScript handler invokes the shared AJAX script, which returns the markup for the form as JSON.
## Modal dialog opened with littled formDialog.js library.
** Modal dialog opened with littled formDialog.js library.
# Form filled out and submitted.
* Form filled out and submitted.
## Shared AJAX handler saves image edits.
** Shared AJAX handler saves image edits.<br />`/_ajax/images/edit_image.php`
### `/_ajax/images/edit_image.php`
*** `EditImagePage::commit_edit()`<br />(`EditImagePage instanceof ajax_page_class`)
### `GalleryUploadClass` instance of `image_upload_class`
**** `cache_class::refresh_content_after_edit()`
### `GalleryUploadClass::save()`
***** `$content instanceof image_link_class` &rarr; `cache_class::refresh_content_after_image_edit()`  
### `parent::save()`
*** `GalleryUploadClass::save()` &rarr; `image_link_class::save()` &rarr; `image_link_class::upload()` <br />`GalleryUploadClass` &rarr; `image_upload_class` &rarr; `image_link_class`<br />None of these classes have an `update_cache()` routine.
 


[[Category:Albums CMS]]
[[Category:Albums CMS]]
[[Category:CMS Documentation]]
[[Category:CMS Documentation]]
[[Category:JQuery/AJAX]]
[[Category:JQuery/AJAX]]

Revision as of 21:10, 16 September 2013

Overview

Documentation of the process of refreshing cached front-facing content after editing gallery images in the Albums CMS.

Use cases

  • Add a new image to the gallery
  • Edit an existing image in the gallery
  • Delete an existing image in the gallery
  • Click "update cache" button for the gallery
  • Update the Album's cache

Process

Adding a new image to the gallery.

  • Click "add image" button.
    • JavaScript handler invokes the shared AJAX script, which returns the markup for the form as JSON.
    • Modal dialog opened with littled formDialog.js library.
  • Form filled out and submitted.
    • Shared AJAX handler saves image edits.
      /_ajax/images/edit_image.php
      • EditImagePage::commit_edit()
        (EditImagePage instanceof ajax_page_class)
        • cache_class::refresh_content_after_edit()
          • $content instanceof image_link_classcache_class::refresh_content_after_image_edit()
      • GalleryUploadClass::save()image_link_class::save()image_link_class::upload()
        GalleryUploadClassimage_upload_classimage_link_class
        None of these classes have an update_cache() routine.