Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <?php
  2.  
  3. if (rex::isBackend()) {
  4. // Ausgabe im Backend ohne Wrapper
  5. echo 'item';
  6. return;
  7. }
  8.  
  9. // Aktueller Slice
  10. $slice = '<li>item</li>';
  11.  
  12. // Wrapper-Präfix und -Suffix
  13. $prefix = '<ol>';
  14. $suffix = '</ol>';
  15.  
  16. // Ab hier nichts verändern
  17. if (!function_exists('rex_module_content_REX_MODULE_ID')) {
  18. ob_start();
  19.  
  20. function rex_module_content_REX_MODULE_ID($prefix, $suffix, $slice)
  21. {
  22. static $content = '';
  23. static $last = '';
  24.  
  25. $out = ob_get_clean();
  26.  
  27. if ($last != $out) {
  28. echo $out;
  29. $content = '';
  30. }
  31.  
  32. ob_start();
  33.  
  34. $content .= $slice;
  35. $last = $prefix.$content.$suffix;
  36. echo $last;
  37. }
  38. }
  39.  
  40. rex_module_content_REX_MODULE_ID($prefix, $suffix, $slice);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement