protected function register_strings_field_choice($form_package, $form, $form_field, $choice, $register_with_type) { $snh = new GFML_String_Name_Helper(); $snh->field = $form_field; $snh->field_choice = $choice; $string_name = $snh->get_field_multi_input_choice_text(); $string_title = $this->build_string_title($form_field, $form_field['label'], $choice['value']); $this->register_gf_string($choice['text'], $string_name, $form_package, $string_title); return $string_name; }
private function handle_multi_input($field, $st_context) { $snh = new GFML_String_Name_Helper(); $snh->field = $field; foreach ($field->choices as $index => $choice) { $snh->field_choice = $choice; $string_name = $snh->get_field_multi_input_choice_text(); $field->choices[$index]['text'] = icl_t($st_context, $string_name, $choice['text']); if (isset($choice['price'])) { $field->choices[$index]['price'] = icl_t($st_context, $snh->get_field_multi_input_choice_price(), $choice['price']); } } return $field; }
protected function register_strings_field_choice($form_package, $form_field, $choice_index, $choice) { $snh = new GFML_String_Name_Helper(); $snh->field = $form_field; $snh->field_choice = $choice; $snh->field_choice_index = $choice_index; $string_name = $snh->get_field_multi_input_choice_text(); $string_title = $this->build_string_title($form_field, $choice_index . ': ' . $form_field['label'], 'label'); $this->register_gf_string($choice['text'], $string_name, $form_package, $string_title); if (isset($choice['value'])) { $string_name = $snh->get_field_multi_input_choice_value(); $string_title = $this->build_string_title($form_field, $choice_index . ': ' . $form_field['label'], 'value'); $this->register_gf_string($choice['value'], $string_name, $form_package, $string_title); } return $string_name; }