PageRenderTime 41ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/administrator/components/com_fabrik/helpers/element.php

https://github.com/dimoss/fabrik21
PHP | 46 lines | 40 code | 5 blank | 1 comment | 8 complexity | 04ee209e628a566a58999d731f516d76 MD5 | raw file
  1. <?php
  2. // Check to ensure this file is within the rest of the framework
  3. defined('JPATH_BASE') or die();
  4. class ElementHelper{
  5. function getId($element, $control_name, $name )
  6. {
  7. if (method_exists($element, 'getId')) {
  8. $id = $element->getId($control_name, $name);
  9. } else {
  10. $id = "$control_name.$name";
  11. }
  12. return $id;
  13. }
  14. function getFullName($element, $control_name, $name) {
  15. if (method_exists($element, 'getFullName')) {
  16. $fullName = $element->getFullName($control_name, $name);
  17. } else {
  18. $fullName = $control_name."[".$name."]";
  19. }
  20. return $fullName;
  21. }
  22. function getRepeatCounter( $element )
  23. {
  24. if (method_exists($element, 'getRepeatCounter')) {
  25. $c = $this->getRepeatCounter();
  26. } else {
  27. $c = 0;
  28. }
  29. return $c;
  30. }
  31. function getRepeat( $element )
  32. {
  33. if (method_exists($element, 'getRepeat')) {
  34. $c = $this->getRepeat();
  35. } else {
  36. $c = 0;
  37. }
  38. return $c;
  39. }
  40. }
  41. ?>