notifications_set_user_label_status( $source, $user, $label, $value ), ] ); return; } echo '
'.__('Enable').'
'.__('Also receive an email').'
'; $sources = notifications_get_all_sources(); $disabled_flag = false; foreach ($sources as $source) { echo '
'; $table_content = [ $source['description'], notifications_print_user_switch($source, $id, 'enabled'), notifications_print_user_switch($source, $id, 'also_mail'), ]; $notifications_enabled = notifications_print_user_switch($source, $id, 'enabled'); $notifications_also_mail = notifications_print_user_switch($source, $id, 'also_mail'); if ($notifications_enabled['disabled'] == 1 || $notifications_also_mail['disabled'] == 1) { $disabled_flag = true; } echo '
'.$source['description'].'
'; echo '
'.$notifications_enabled['switch'].'
'; echo '
'.$notifications_also_mail['switch'].'
'; echo '
'; } if ((bool) $disabled_flag === true) { ui_print_warning_message( __('Controls have been disabled by the system administrator') ); } echo '
'; // Print id user to handle it on js. html_print_input_hidden('id_user', $id); ?>