Example #1
0
 /**
  * display the field for interaction
  *
  * @param 	int	$id_user	if alredy exists a entry for the user load as default value
  *
  * @return string 	of label xhtml code
  *
  * @access public
  */
 function play($id_user, $do_not_show_label = false, $value = NULL)
 {
     require_once _base_ . '/lib/lib.form.php';
     if (isset($_POST['field_' . $this->getFieldType()]) && isset($_POST['field_' . $this->getFieldType()][$this->id_common])) {
         $user_entry = $_POST['field_' . $this->getFieldType()][$this->id_common];
     } else {
         list($user_entry) = sql_fetch_row(sql_query("\n                    SELECT user_entry\n                    FROM " . $this->_getUserEntryTable() . "\n                    WHERE id_user = '******' AND\n                            id_common = '" . (int) $this->id_common . "' AND\n                            id_common_son = '0'"));
     }
     $re_field = sql_query("\n            SELECT translation\n            FROM " . $this->_getMainTable() . "\n            WHERE lang_code = '" . getLanguage() . "' AND id_common = '" . (int) $this->id_common . "' AND type_field = '" . $this->getFieldType() . "'");
     list($translation) = sql_fetch_row($re_field);
     if ($value !== NULL) {
         $user_entry = "" . $value;
     }
     return Form::getTextLabel($translation);
 }