extra_field.ajax.php 1.2 KB

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. $language_file = array('admin', 'registration', 'userInfo');
  4. require_once '../global.inc.php';
  5. $action = $_GET['a'];
  6. switch ($action) {
  7. case 'get_second_select_options':
  8. $type = isset($_REQUEST['type']) ? $_REQUEST['type'] : null;
  9. $field_id = isset($_REQUEST['field_id']) ? $_REQUEST['field_id'] : null;
  10. $option_value_id = isset($_REQUEST['option_value_id']) ? $_REQUEST['option_value_id'] : null;
  11. if (!empty($type) && !empty($field_id) && !empty($option_value_id)) {
  12. $field_options = new ExtraFieldOption($type);
  13. echo $field_options->get_second_select_field_options_by_field($field_id, $option_value_id, true);
  14. }
  15. break;
  16. case 'search_tags':
  17. $type = isset($_REQUEST['type']) ? $_REQUEST['type'] : null;
  18. $fieldId = isset($_REQUEST['field_id']) ? $_REQUEST['field_id'] : null;
  19. $tag = isset($_REQUEST['tag']) ? $_REQUEST['tag'] : null;
  20. $extraFieldOption = new ExtraFieldOption($type);
  21. echo $extraFieldOption->getSearchOptionsByField($tag, $fieldId, 10, 'json');
  22. break;
  23. default:
  24. exit;
  25. break;
  26. }
  27. exit;