Review main Abandoned

10750[FEATURE] Add Hook into t3lib_befunc::getPageForRootline

Kay Strobach CR 0 V 0 Easy +9 −0 updated 06/03/13, 20:49

Commit message

Adds a hook to allow dynamic modification of pageTS

Review

  • Code review CR 0
  • Verified V 0

Files 1

Review log 19

  1. Kay Strobach commented on patch set 1 03/04/13, 08:33

    Abandoned wrong fixes line!
  2. Kay Strobach commented on patch set 1 03/04/13, 08:33

    Restored
  3. Kay Strobach uploaded patch set 2 03/04/13, 08:33

  4. Kay Strobach uploaded patch set 3 03/04/13, 08:33

  5. Stefan Neufeind commented on patch set 4 03/04/13, 08:33

    Looks good to me, but someone else must approve @Kay: yes, that's what interfaces are used for :-) Somebody please decide if we go with or without using an interface. But despite that it looks fine imho.
  6. Xavier Perseguers commented on patch set 4 03/04/13, 08:33

    (1 inline comment) This patch should be rewritten for master (6.1) anyway

    class.t3lib_befunc.php:399

    &$row will cause a PHP warning
  7. Xavier Perseguers uploaded patch set 5 03/04/13, 08:33

  8. Georg Ringer commented on patch set 4 03/04/13, 08:33

    Verified; Looks good to me, but someone else must approve
  9. Kay Strobach commented on patch set 4 03/04/13, 08:33

    so what do you expect and interface for t3lib_befunc_HookName?
  10. Kay Strobach commented on patch set 4 03/04/13, 08:33

    mhmm, looking into [1] shows a very big drawback: if i want to use one hook, i need to implement many functions if the interface is used ... :( [1] http://git.typo3.org/TYPO3v4/Core.git?a=blob;f=t3lib/interfaces/interface.t3lib_browselinkshook.php;h=deb49ba9c0a5741a59a606297f3e4f2430ce8eba;hb=HEAD
  11. Kay Strobach uploaded patch set 4 03/04/13, 08:33

  12. Andy Grunwald commented on patch set 4 03/04/13, 08:33

    "Newer" hooks (like this) are implemented with an interface, isn`t it?
  13. Andy Grunwald commented on patch set 4 03/04/13, 08:33

  14. Mr. Jenkins commented on patch set 1 03/04/13, 08:33

  15. Mr. Jenkins commented on patch set 3 03/04/13, 08:33

  16. Mr. Jenkins commented on patch set 4 03/04/13, 08:33

  17. Mr. Jenkins commented on patch set 5 03/04/13, 08:33

  18. Wouter Wolters commented on patch set 4 03/04/13, 08:33

    Looks good to me, but someone else must approve
  19. Kay Strobach commented on patch set 5 03/04/13, 08:33

    Abandoned there is a better way in the core to inject pagers. I do currently use an xclass, which can be easily converted into a hook: class ux_t3lib_TSparser_TSconfig extends t3lib_TSparser_TSconfig{ /** * Parses the passed TS-Config using conditions and caching * * @param string $TStext: The TSConfig being parsed * @param string $type: The type of TSConfig (either "userTS" or "PAGES") * @param integer $id: The uid of the page being handled * @param array $rootLine: The rootline of the page being handled * @return array Array containing the parsed TSConfig and a flag wheter the content was retrieved from cache * @see t3lib_TSparser */ public function parseTSconfig($TStext, $type, $id = 0, array $rootLine = array()) { // @todo add caching here! /** * @var Tx_Themes_Domain_Repository_SkinRepository */ $skinRepository = t3lib_div::makeInstance('Tx_Themes_Domain_Repository_SkinRepository'); $skin = $skinRepository->findByPageOrRootline($id); if($skin !== NULL) { $buffer = $skin->getTSConfig() . "\n\n[GLOBAL]\n\n" . $TStext; return parent::parseTSconfig($buffer, $type, $id, $rootLine); } else { return parent::parseTSconfig($TStext, $type, $id, $rootLine); } } }