Guest User

Untitled

a guest
Dec 14th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. JLoader::import('components.com_fields.libraries.fieldsplugin',JPATH_ADMINISTRATOR);
  2.  
  3. class PlgFieldsCustomrepeat extends FieldsPlugin {
  4.  
  5. public function onCustomFieldsPrepareDom($field, DOMElement $parent, JForm $form) {
  6.  
  7. $fieldNode = parent::onCustomFieldsPrepareDom($field, $parent, $form);
  8.  
  9. if (!$fieldNode) {
  10. return $fieldNode;
  11. }
  12.  
  13. $fieldNode->setAttribute('type', 'subform');
  14. $fieldNode->setAttribute('formsource', $field->fieldparams->get('formsource', 0));
  15. $fieldNode->setAttribute('layout', $field->fieldparams->get('layoutformat'));
  16. $fieldNode->setAttribute('multiple', true);
  17. $fieldNode->setAttribute('groupByFieldset', $field->fieldparams->get('fieldsetgroup', 0) ? 'true' : 'false');
  18. $fieldNode->setAttribute('min', $field->fieldparams->get('min', 0));
  19. $fieldNode->setAttribute('max', $field->fieldparams->get('max', 1000));
  20. $fieldNode->setAttribute('default', $field->fieldparams->get('defaultset', 0));
  21.  
  22. return $fieldNode;
  23.  
  24. }
  25.  
  26.  
  27. }
Add Comment
Please, Sign In to add comment