updated-section-work 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. section_template
  2. id
  3. internal_name
  4. title
  5. is_canvas // remember: canvas_key == internal_name
  6. DIRECTORY:
  7. /{$section->internal_name}
  8. default.php
  9. summary.php
  10. processor.php
  11. form.php
  12. actions.php
  13. *WILDCARD* there may be /template from (C) to enable smart-update of text into the free text field.
  14. ----------------------------------------------------------------
  15. @foreach($sections as $section)
  16. {{$section->title}} [edit/view toggle] MAYBE:: [templates] OPTIONAL:: [actions...]
  17. --------------------------------------------------------------------------
  18. VIEW-MODE:
  19. {{$section->summary_html}} - DONE
  20. --------------------------------------------------------------------------
  21. EDIT-MODE: // if [name=data], just listen for changes to [name=data] and auto-save / replace summary_html.
  22. @if($section->section_template->canvas_key) // PAST_MEDICAL_HISTORY
  23. @include(/vijay-folder/{{$section->section_template->canvas_key}}.php) // expected: <input type="hidden" name="data">
  24. @elseif(file_exists('form.php') // PHYSICAL_ACTIVITY - DONE
  25. @include('form.php') // may contain <input type="hidden" name="data">
  26. @else // CC
  27. <input type="hidden" name="data"> // always - DONE
  28. <rich-editor onChange... update data as {value: ...}> - DONE
  29. $section->content_data['value']
  30. </rich-editor>
  31. --------------------------------------------------------------------------
  32. @endforeach
  33. ====================================================================================================
  34. WHEN update on section... DONE
  35. // take the $data - DONE
  36. // check if processor.php. - DONE
  37. // if not,
  38. // assume it's mud - the new contentData as is replaces. !!! NOT $request->all(), $request->get('data') - DONE
  39. // save it
  40. // generate summary_html...
  41. // run summary.php if there, ob_start/flush... etc. - DONE
  42. // else, use data->value as the summary_html. - DONE
  43. =====================================================================================================