/**
  * Get quiz grade string name
  *
  * @param string $value grade value
  *
  * @return array Form
  */
 protected function get_quiz_grade_string_name($value)
 {
     $snh = new GFML_String_Name_Helper();
     return $snh->sanitize_string('quiz-grade-value_' . $value);
 }
 /**
  * Translate validation messages.
  *
  * @param string $result
  * @param        $value
  * @param array  $form
  * @param array  $field
  *
  * @return String
  */
 function gform_field_validation($result, $value, $form, $field)
 {
     if (!$result['is_valid']) {
         $snh = new GFML_String_Name_Helper();
         $snh->field = $field;
         $st_context = $this->get_st_context($form['id']);
         $result['message'] = icl_t($st_context, $snh->get_field_validation_message(), $result['message']);
     }
     return $result;
 }
Example #3
0
 protected function register_strings_pagination($form_package)
 {
     // Paging Page Names - $form["pagination"]["pages"][i]
     if (!empty($form['pagination']) && isset($form['pagination']['pages']) && is_array($form['pagination']['pages'])) {
         $snh = new GFML_String_Name_Helper();
         foreach ($form['pagination']['pages'] as $key => $page_title) {
             $snh->page_index = $key;
             $this->register_gf_string($page_title, $snh->get_form_pagination_page_title(), $form_package, "page-" . (intval($key) + 1) . '-title');
         }
         $value = !empty($form['pagination']['progressbar_completion_text']) ? $form['pagination']['progressbar_completion_text'] : null;
         if ($value !== null) {
             $this->register_gf_string($value, $snh->get_form_pagination_completion_text(), $form_package, "progressbar_completion_text");
         }
         $value = !empty($form['lastPageButton']['text']) ? $form['lastPageButton']['text'] : null;
         if ($value !== null) {
             $this->register_gf_string($value, $snh->get_form_pagination_last_page_button_text(), $form_package, "lastPageButton");
         }
     }
 }