function &tag_to_search_init() { global $tag_to_search; $cache_key = 'tag_to_search_' . $this->form_id . '_' . $_SESSION['LANG']; $tag_to_search = JB_cache_get($cache_key); // tag_to_search_1_EN if (is_array($tag_to_search)) { return $tag_to_search; } $tag_to_search = array(); $sql = "SeLeCT *, t2.field_label AS NAME FROM `form_fields` AS t1, `form_field_translations` AS t2 where t1.field_id=t2.field_id AND t1.form_id='" . JB_escape_sql($this->form_id) . "' AND is_in_search ='Y' AND t2.lang='" . JB_escape_sql($_SESSION['LANG']) . "' ORDER BY search_sort_order "; $result = JB_mysql_query($sql) or die(mysql_error()); # do a query for each field while ($fields = mysql_fetch_array($result, MYSQL_ASSOC)) { $tag_to_search[$fields['template_tag']]['field_id'] = $fields['field_id']; $tag_to_search[$fields['template_tag']]['field_type'] = $fields['field_type']; $tag_to_search[$fields['template_tag']]['field_label'] = $fields['NAME']; $tag_to_search[$fields['template_tag']]['field_init'] = $fields['field_init']; $tag_to_search[$fields['template_tag']]['category_init_id'] = $fields['category_init_id']; $tag_to_search[$fields['template_tag']]['field_height'] = $fields['field_height']; $tag_to_search[$fields['template_tag']]['is_cat_multiple'] = $fields['is_cat_multiple']; $tag_to_search[$fields['template_tag']]['cat_multiple_rows'] = $fields['cat_multiple_rows']; $tag_to_search[$fields['template_tag']]['multiple_sel_all'] = $fields['multiple_sel_all']; if ($fields['field_type'] == 'SKILL_MATRIX') { // skill matrix exists in the form $tag_to_search['smx_exists'] = true; } } JBPLUG_do_callback('tag_to_search_init', $tag_to_search, $this->form_id); jb_cache_add($cache_key, $tag_to_search); return $tag_to_search; }
function JB_profile_tag_to_field_id_init() { global $label; global $profile_tag_to_field_id; if ($profile_tag_to_field_id = JB_cache_get('tag_to_field_id_3_' . $_SESSION['LANG'])) { return $profile_tag_to_field_id; } $fields = JB_schema_get_fields(3); // the template tag becomes the key foreach ($fields as $field) { $profile_tag_to_field_id[$field['template_tag']] = $field; } JBPLUG_do_callback('profile_tag_to_field_id_init', $profile_tag_to_field_id); JB_cache_set('tag_to_field_id_3_' . $_SESSION['LANG'], $profile_tag_to_field_id); return $profile_tag_to_field_id; }
function JB_resume_tag_to_field_id_init() { global $resume_tag_to_field_id; // deprecated since 3.6 if ($resume_tag_to_field_id = JB_cache_get('tag_to_field_id_2_' . $_SESSION['LANG'])) { return $resume_tag_to_field_id; } $fields = JB_schema_get_fields(2); // the template tag becomes the key foreach ($fields as $field) { $resume_tag_to_field_id[$field['template_tag']] = $field; } JBPLUG_do_callback('resume_tag_to_field_id_init', $resume_tag_to_field_id); JB_cache_set('tag_to_field_id_2_' . $_SESSION['LANG'], $resume_tag_to_field_id); return $resume_tag_to_field_id; }
function JB_tag_to_field_id_init_emp() { global $adv_tag_to_field_id; global $label; if ($adv_tag_to_field_id = JB_cache_get('tag_to_field_id_4_' . $_SESSION['LANG'])) { return $adv_tag_to_field_id; } $fields = JB_schema_get_fields(4); // the template tag becomes the key foreach ($fields as $field) { $adv_tag_to_field_id[$field['template_tag']] = $field; } JBPLUG_do_callback('tag_to_field_id_init_emp', $adv_tag_to_field_id); JB_cache_set('tag_to_field_id_4_' . $_SESSION['LANG'], $adv_tag_to_field_id); return $adv_tag_to_field_id; }
function JB_tag_to_field_id_init_candidate() { global $label; global $candidate_tag_to_field_id; if ($candidate_tag_to_field_id = JB_cache_get('tag_to_field_id_5_' . $_SESSION['LANG'])) { return $candidate_tag_to_field_id; } $fields = JB_schema_get_fields(5); // the template tag becomes the key foreach ($fields as $field) { $candidate_tag_to_field_id[$field['template_tag']] = $field; } JBPLUG_do_callback('tag_to_field_id_init_can', $candidate_tag_to_field_id); JB_cache_add('tag_to_field_id_5_' . $_SESSION['LANG'], $candidate_tag_to_field_id); return $candidate_tag_to_field_id; }
function JB_category_option_list($category_id, $selected, $Markup = null) { // &$Markup=null if ($Markup == null) { $Markup =& JB_get_DynamicFormMarkupObject(); $all_enabled = false; } elseif (get_class($Markup) == 'JBDynamicSearchForm') { $all_enabled = true; // when on the search form, all options can be selected } $cache_key = 'cat_options_fid_' . $Markup->form_id . '_cid_' . $category_id . '_class_' . get_class($Markup) . '_lang_' . $_SESSION['LANG']; if (!($options_arr = JB_cache_get($cache_key))) { JB_generate_category_option_list($category_id, $selected, $options_arr, $Markup); JB_cache_add($cache_key, $options_arr); } $is_array = is_array($selected); for ($i = 0; $i < sizeof($options_arr['name']); $i++) { $sel = ''; if ($is_array) { if (in_array($options_arr['value'][$i], $selected)) { $sel = ' selected '; } } elseif ($options_arr['value'][$i] == $selected) { $sel = ' selected '; } if ($all_enabled) { // allow selection of all categories - eg. search form $options_arr['a'][$i] = 'Y'; } $Markup->category_select_option($options_arr['value'][$i], $options_arr['name'][$i], $sel, $options_arr['a'][$i], $options_arr['depth'][$i]); } }