mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
#9817 fixed create/delete profile in user editor
This commit is contained in:
parent
a54599caba
commit
c19b13fd3b
@ -181,7 +181,7 @@ function profile_delete_profile_and_clean_users($id_profile)
|
|||||||
* @param int User id
|
* @param int User id
|
||||||
* @param bool Show the tags select or not
|
* @param bool Show the tags select or not
|
||||||
*/
|
*/
|
||||||
function profile_print_profile_table($id, $json_profile=false, $return=false)
|
function profile_print_profile_table($id, $json_profile=false, $return=false, $create_user=false)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
@ -296,12 +296,26 @@ function profile_print_profile_table($id, $json_profile=false, $return=false)
|
|||||||
|
|
||||||
$data['hierarchy'] = $profile['no_hierarchy'] ? __('Yes') : __('No');
|
$data['hierarchy'] = $profile['no_hierarchy'] ? __('Yes') : __('No');
|
||||||
|
|
||||||
$data['actions'] = '<form method="post" onsubmit="if (!confirm (\''.__('Are you sure?').'\')) return false">';
|
if ($create_user) {
|
||||||
$data['actions'] .= html_print_input_image('del', 'images/cross.png', 1, ['class' => 'invert_filter'], true);
|
$data['actions'] .= html_print_input_image(
|
||||||
$data['actions'] .= html_print_input_hidden('delete_profile', 1, true);
|
'del',
|
||||||
$data['actions'] .= html_print_input_hidden('id_user_profile', $profile['id_up'], true);
|
'images/cross.png',
|
||||||
$data['actions'] .= html_print_input_hidden('id_user', $id, true);
|
1,
|
||||||
$data['actions'] .= '</form>';
|
'',
|
||||||
|
true,
|
||||||
|
[
|
||||||
|
'onclick' => 'delete_profile(event, this)',
|
||||||
|
'class' => 'invert_filter',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$data['actions'] = '<form method="post" onsubmit="if (!confirm (\''.__('Are you sure?').'\')) return false">';
|
||||||
|
$data['actions'] .= html_print_input_image('del', 'images/cross.png', 1, ['class' => 'invert_filter'], true);
|
||||||
|
$data['actions'] .= html_print_input_hidden('delete_profile', 1, true);
|
||||||
|
$data['actions'] .= html_print_input_hidden('id_user_profile', $profile['id_up'], true);
|
||||||
|
$data['actions'] .= html_print_input_hidden('id_user', $id, true);
|
||||||
|
$data['actions'] .= '</form>';
|
||||||
|
}
|
||||||
|
|
||||||
array_push($table->data, $data);
|
array_push($table->data, $data);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user