";
return $template;
}
public static function get_button_selector($name, $what, $caller, $args_others=''){
global $msg, $charset;
global $base_path;
$selection_attributes = static::get_selection_attributes();
if(is_array($selection_attributes) && count($selection_attributes)) {
foreach ($selection_attributes as $attribute) {
$args_others .= "&".$attribute['name']."=".$attribute['value'];
}
}
$template = "
";
return $template;
}
public static function get_button_add($onclick_event=''){
$template = "
";
return $template;
}
public static function get_event_add_completion_field($name, $id, $completion){
$template = "
";
return $template;
}
public static function get_button_add_completion_field($name, $id, $completion){
$template = "
";
return $template;
}
public static function get_button_clear_values($name, $id) {
$template = "
";
return $template;
}
public static function get_input_hidden($name, $value) {
$template = "";
return $template;
}
public static function get_display_elements_completion_field($elements, $caller, $element_name, $element_id, $completion) {
global $msg;
$display = '';
$display .= templates::get_event_add_completion_field($element_name, $element_id, $completion);
$display .= templates::get_button_selector($caller.'_'.$element_name.'_selector', $completion, $caller, '¶m1='.$element_id.'¶m2='.$element_name);
$display .= templates::get_button_add_completion_field($element_name, $element_id, $completion);
if(count($elements)) {
foreach ($elements as $i => $element) {
$display .= "";
$display .= templates::get_input_completion($element_name, $element_id, $i, $element['id'], $element['name'], $completion);
$display .= "
";
}
$display .= templates::get_input_hidden('max_'.$element_name, count($elements));
} else {
$display .= "";
$display .= templates::get_input_completion($element_name, $element_id, 0, '', '', $completion);
$display .= "
";
$display .= templates::get_input_hidden('max_'.$element_name, 1);
}
$display.= "";
// Ré-initialisation des propriétés statiques
templates::reset_completion_attributes();
templates::reset_selection_attributes();
return $display;
}
public static function get_values_completion_field_from_form($element_name) {
$values = array();
global ${$element_name};
$values_from_form = ${$element_name};
foreach ($values_from_form as $value_from_form) {
if($value_from_form['id']) {
$values[] = $value_from_form['id'];
}
}
return $values;
}
public static function get_string_completion_attributes() {
$string_attributes = '';
if(!empty(static::$completion_attributes)) {
foreach (static::$completion_attributes as $attribute) {
$string_attributes .= " ".$attribute['name']."='".$attribute['value']."'";
}
}
return $string_attributes;
}
public static function init_completion_attributes($completion_attributes=array()) {
static::$completion_attributes = $completion_attributes;
}
public static function get_completion_attributes() {
if(!isset(static::$completion_attributes)) {
static::$completion_attributes = array();
}
return static::$completion_attributes;
}
public static function reset_completion_attributes() {
static::$completion_attributes = array();
}
public static function init_selection_attributes($selection_attributes=array()) {
static::$selection_attributes = $selection_attributes;
}
public static function get_selection_attributes() {
if(!isset(static::$selection_attributes)) {
static::$selection_attributes = array();
}
return static::$selection_attributes;
}
public static function reset_selection_attributes() {
static::$selection_attributes = array();
}
}