14 if (!defined(
'IN_PEEL')) {
38 if (isset($this->error[$name])) {
39 return ' class="form_item_error"';
49 function text($name = null)
51 if (!empty($name) && isset($this->error[$name])) {
52 $output = ((!empty($this->error[$name])) ? $this->error[$name] :
$GLOBALS[
'STR_EMPTY_FIELD']);
55 foreach($this->error as $this_name => $this_value) {
56 if (!empty($this->error[$this_name])) {
57 $output .= $this->error[$this_name];
65 return $GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' =>
$output))->fetch();
78 function add($name, $text = null)
80 $this->error[$name] = ($text ? $text :
'');
91 return isset($this->error[$name]);
101 return count($this->error);
113 function valide_form(&
$frm, $error_field_messages_array = array(), $field_minimal_lengths_array = array(), $field_validation_function_names_array = array())
115 if(!empty($error_field_messages_array)) {
116 foreach($error_field_messages_array as $this_field => $this_message) {
117 if ((empty(
$frm[$this_field]) || (is_array(
$frm[$this_field]) &&
count(
$frm[$this_field]) == 0)) || (!empty($field_minimal_lengths_array[$this_field]) &&
String::strlen(
$frm[$this_field])<$field_minimal_lengths_array[$this_field]) || (!empty($field_validation_function_names_array[$this_field]) && $field_validation_function_names_array[$this_field](
$frm[$this_field]) ===
false)) {
119 $this_text =
$GLOBALS[$this_message];
121 $this_text = $this_message;
123 $this->
add($this_field, $this_text);
if(!empty($GLOBALS['site_parameters']['order_specific_field_titles'])) if(check_if_module_active('socolissimo')&&!empty($_REQUEST)&&!empty($_REQUEST['PUDOFOID'])&&!empty($_REQUEST['CEEMAIL'])&&!empty($_REQUEST['SIGNATURE'])&&!empty($_REQUEST['ORDERID'])) elseif(!empty($_POST)) elseif(check_if_module_active('socolissimo')&&!empty($_SESSION['session_commande']['is_socolissimo_order'])) foreach(array('bill'=> 1, 'ship'=> 2) as $address_type=> $session_commande_address_id) $frm['societe1']
static strlen($string)
Returns the length of the given string.
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
$GLOBALS['page_columns_count']
static substr($string, $start, $length=null)
Returns the portion of string specified by the start and length parameters.