add.php 971 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Add a new field to the set of custom profile fields
  4. */
  5. $label_text = elgg_echo('profile:label');
  6. $type_text = elgg_echo('profile:type');
  7. $label_control = elgg_view('input/text', array('name' => 'label'));
  8. $type_control = elgg_view('input/select', array('name' => 'type', 'options_values' => array(
  9. 'text' => elgg_echo('profile:field:text'),
  10. 'longtext' => elgg_echo('profile:field:longtext'),
  11. 'tags' => elgg_echo('profile:field:tags'),
  12. 'url' => elgg_echo('profile:field:url'),
  13. 'email' => elgg_echo('profile:field:email'),
  14. 'location' => elgg_echo('profile:field:location'),
  15. 'date' => elgg_echo('profile:field:date'),
  16. )));
  17. $submit_control = elgg_view('input/submit', array('name' => elgg_echo('add'), 'value' => elgg_echo('add')));
  18. $formbody = <<< END
  19. <div>$label_text: $label_control</div>
  20. <div class="elgg-foot">$type_text: $type_control
  21. $submit_control</div>
  22. END;
  23. echo elgg_autop(elgg_echo('profile:explainchangefields'));
  24. echo $formbody;