| | |
| | | if(!file_exists($lng_file)) $lng_file = "../$module/lib/lang/en_".$this->formDef["name"].".lng"; |
| | | include($lng_file); |
| | | } |
| | | |
| | | |
| | | if(is_array($wb_global)) { |
| | | $wb = array_merge($wb_global,$wb); |
| | | $wb = $app->functions->array_merge($wb_global,$wb); |
| | | } |
| | | if(isset($wb_global)) unset($wb_global); |
| | | |
| | |
| | | // If Datasource is set, get the data from there |
| | | if(isset($field['datasource']) && is_array($field['datasource'])) { |
| | | if(is_array($field["value"])) { |
| | | $field["value"] = array_merge($field["value"],$this->getDatasourceData($field, $record)); |
| | | //$field["value"] = array_merge($field["value"],$this->getDatasourceData($field, $record)); |
| | | $field["value"] = $app->functions->array_merge($field["value"],$this->getDatasourceData($field, $record)); |
| | | } else { |
| | | $field["value"] = $this->getDatasourceData($field, $record); |
| | | } |
| | |
| | | if(is_array($field['value'])) { |
| | | foreach($field['value'] as $k => $v) { |
| | | $selected = ($k == $val)?' SELECTED':''; |
| | | if(!empty($this->wordbook[$v])) |
| | | $v = $this->wordbook[$v]; |
| | | $out .= "<option value='$k'$selected>$v</option>\r\n"; |
| | | } |
| | | } |
| | |
| | | // If Datasource is set, get the data from there |
| | | if(@is_array($field['datasource'])) { |
| | | if(is_array($field["value"])) { |
| | | $field["value"] = array_merge($field["value"],$this->getDatasourceData($field, $record)); |
| | | $field["value"] = $app->functions->array_merge($field["value"],$this->getDatasourceData($field, $record)); |
| | | } else { |
| | | $field["value"] = $this->getDatasourceData($field, $record); |
| | | } |
| | |
| | | $out = ''; |
| | | foreach($field['value'] as $k => $v) { |
| | | $selected = ($k == $field["default"])?' SELECTED':''; |
| | | $out .= "<option value='$k'$selected>$v</option>\r\n"; |
| | | $out .= "<option value='$k'$selected>".$this->lng($v)."</option>\r\n"; |
| | | } |
| | | } |
| | | if(isset($out)) $new_record[$key] = $out; |
| | |
| | | } |
| | | break; |
| | | case 'ISEMAIL': |
| | | if(!preg_match("/^\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\w+\.[a-z]{2,10}$/i", $field_value)) { |
| | | if(!preg_match("/^\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\w+\.[a-zA-Z0-9\-]{2,30}$/i", $field_value)) { |
| | | $errmsg = $validator['errmsg']; |
| | | if(isset($this->wordbook[$errmsg])) { |
| | | $this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n"; |
| | |
| | | } |
| | | $salt.="$"; |
| | | // $salt = substr(md5(time()),0,2); |
| | | $record[$key] = crypt($record[$key],$salt); |
| | | $record[$key] = crypt(stripslashes($record[$key]),$salt); |
| | | $sql_insert_val .= "'".$app->db->quote($record[$key])."', "; |
| | | } elseif ($field['encryption'] == 'MYSQL') { |
| | | $sql_insert_val .= "PASSWORD('".$app->db->quote($record[$key])."'), "; |
| | | } elseif ($field['encryption'] == 'CLEARTEXT') { |
| | | $sql_insert_val .= "'".$app->db->quote($record[$key])."', "; |
| | | } else { |
| | | $record[$key] = md5($record[$key]); |
| | | $record[$key] = md5(stripslashes($record[$key])); |
| | | $sql_insert_val .= "'".$app->db->quote($record[$key])."', "; |
| | | } |
| | | |
| | |
| | | } |
| | | $salt.="$"; |
| | | // $salt = substr(md5(time()),0,2); |
| | | $record[$key] = crypt($record[$key],$salt); |
| | | $record[$key] = crypt(stripslashes($record[$key]),$salt); |
| | | $sql_update .= "`$key` = '".$app->db->quote($record[$key])."', "; |
| | | } elseif (isset($field['encryption']) && $field['encryption'] == 'MYSQL') { |
| | | $sql_update .= "`$key` = PASSWORD('".$app->db->quote($record[$key])."'), "; |
| | | } elseif (isset($field['encryption']) && $field['encryption'] == 'CLEARTEXT') { |
| | | $sql_update .= "`$key` = '".$app->db->quote($record[$key])."', "; |
| | | } else { |
| | | $record[$key] = md5($record[$key]); |
| | | $record[$key] = md5(stripslashes($record[$key])); |
| | | $sql_update .= "`$key` = '".$app->db->quote($record[$key])."', "; |
| | | } |
| | | |