Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. change the "c:OnAfterRebuildThemes" event to unserialize values of "$files" array (all at once) before using them later - 0.3h
  2. create the "CategoriesEventHandler::sortByDependencies(array $files)" method, that will: - 0.5h
    1. accept $files associative array, that is built in "c:OnAfterRebuildThemes" event, where:
      1. key is relative path to a template in theme
      2. value is array, that was parsed from template meta comment
    2. for each array entry (the template file) build a sorting key like this:
      1. take array from "section" key of template info (if missing use empty array)
      2. append value of "name" key to that array (if missing use '_Auto: ' . $template)
      3. combine using a separator (e.g. "||")
    3. sort array using sort key built above (will ensure, that parent templates will be listed prior to child templates)
    4. return sorted "$files" array
  3. in the "c:OnAfterRebuildThemes" event call the "CategoriesEventHandler::sortByDependencies" method on the "$files" array prior to creating categories from it - 0.2h

Quote: 1h*1.4=1.5h

Related Tasks