mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
Fixed style
Former-commit-id: bd4c0370bb3c63eddb9a7b36b0e8f6938c48b4ae
This commit is contained in:
parent
80a5d0b0b9
commit
4b86683d23
@ -44,7 +44,7 @@ $users = get_parameter('users', '');
|
|||||||
$elements = get_parameter('elements', []);
|
$elements = get_parameter('elements', []);
|
||||||
$is_users = $users === 'users';
|
$is_users = $users === 'users';
|
||||||
if (get_parameter('get_selection_two_ways_form', 0)) {
|
if (get_parameter('get_selection_two_ways_form', 0)) {
|
||||||
$info_selec = ($is_users) ? notifications_get_user_source_not_configured($source) : notifications_get_group_source_not_configured($source);
|
$info_selec = ($is_users === true) ? notifications_get_user_source_not_configured($source) : notifications_get_group_source_not_configured($source);
|
||||||
|
|
||||||
echo notifications_print_two_ways_select(
|
echo notifications_print_two_ways_select(
|
||||||
$info_selec,
|
$info_selec,
|
||||||
@ -133,7 +133,10 @@ function add_source_dialog(users, source_id) {
|
|||||||
if (previous_dialog !== null) previous_dialog.remove();
|
if (previous_dialog !== null) previous_dialog.remove();
|
||||||
// Create or recreate the content.
|
// Create or recreate the content.
|
||||||
var not_dialog = document.createElement('div');
|
var not_dialog = document.createElement('div');
|
||||||
not_dialog.setAttribute('class', 'global_config_notifications_dialog_add_wrapper');
|
not_dialog.setAttribute(
|
||||||
|
'class',
|
||||||
|
'global_config_notifications_dialog_add_wrapper'
|
||||||
|
);
|
||||||
not_dialog.setAttribute('id', dialog_id);
|
not_dialog.setAttribute('id', dialog_id);
|
||||||
document.body.appendChild(not_dialog);
|
document.body.appendChild(not_dialog);
|
||||||
$("#" + dialog_id).dialog({
|
$("#" + dialog_id).dialog({
|
||||||
@ -182,7 +185,8 @@ function notifications_modify_two_ways_element (id, source_id, operation) {
|
|||||||
|
|
||||||
// Add elements to database and close dialog
|
// Add elements to database and close dialog
|
||||||
function notifications_add_source_element_to_database(id, source_id) {
|
function notifications_add_source_element_to_database(id, source_id) {
|
||||||
var index = 'selected-' + notifications_two_ways_element_get_sufix (id, source_id);
|
var index = 'selected-' +
|
||||||
|
notifications_two_ways_element_get_sufix (id, source_id);
|
||||||
var select = document.getElementById(index);
|
var select = document.getElementById(index);
|
||||||
var selected = [];
|
var selected = [];
|
||||||
for (var i = select.options.length - 1; i >= 0; i--) {
|
for (var i = select.options.length - 1; i >= 0; i--) {
|
||||||
@ -205,7 +209,11 @@ function notifications_add_source_element_to_database(id, source_id) {
|
|||||||
out_select.appendChild(select.options[i]);
|
out_select.appendChild(select.options[i]);
|
||||||
}
|
}
|
||||||
// Close the dialog
|
// Close the dialog
|
||||||
$("#" + notifications_two_ways_element_get_dialog(id, source_id)).dialog("close");
|
$("#" + notifications_two_ways_element_get_dialog(
|
||||||
|
id,
|
||||||
|
source_id
|
||||||
|
))
|
||||||
|
.dialog("close");
|
||||||
} else {
|
} else {
|
||||||
console.log("Cannot update element.");
|
console.log("Cannot update element.");
|
||||||
}
|
}
|
||||||
@ -304,7 +312,9 @@ function notifications_handle_change_element(event) {
|
|||||||
value = element.value;
|
value = element.value;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.error("Unregonized action (insert on db)", action.bit, '.');
|
console.error(
|
||||||
|
"Unregonized action (insert on db)", action.bit, '.'
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -641,18 +641,59 @@ function notifications_print_source_select_box(
|
|||||||
$delete_title = ($id === 'users') ? __('Delete users') : __('Delete groups');
|
$delete_title = ($id === 'users') ? __('Delete users') : __('Delete groups');
|
||||||
|
|
||||||
// Generate the HTML.
|
// Generate the HTML.
|
||||||
$html_select = "<div class='global-config-notification-single-selector'>";
|
return sprintf(
|
||||||
$html_select .= ' <div>';
|
"
|
||||||
$html_select .= ' <h4>'.$title.'</h4>';
|
<div class='global-config-notification-single-selector'>
|
||||||
|
<div>
|
||||||
|
<h4>%s</h4>
|
||||||
|
%s
|
||||||
|
</div>
|
||||||
|
<div class='global-notifications-icons'>
|
||||||
|
%s
|
||||||
|
%s
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
",
|
||||||
|
$title,
|
||||||
// Put a true if empty sources to avoid to sow the 'None' value.
|
// Put a true if empty sources to avoid to sow the 'None' value.
|
||||||
$html_select .= html_print_select(empty($info_selec) ? true : $info_selec, 'multi-'.$id.'-'.$source_id.'[]', 0, false, '', '', true, true, true, '', $disabled);
|
html_print_select(
|
||||||
$html_select .= ' </div>';
|
empty($info_selec) ? true : $info_selec,
|
||||||
$html_select .= " <div class='global-notifications-icons'>";
|
'multi-'.$id.'-'.$source_id.'[]',
|
||||||
$html_select .= html_print_image('images/input_add.png', true, ['title' => $add_title, 'onclick' => 'add_source_dialog("'.$id.', "'.$source_id.'")"']);
|
0,
|
||||||
$html_select .= html_print_image('images/input_delete.png', true, ['title' => $delete_title, 'onclick' => 'remove_source_elements("'.$id.'", "'.$source_id.'")"']);
|
false,
|
||||||
$html_select .= ' </div>';
|
'',
|
||||||
$html_select .= '</div>';
|
'',
|
||||||
return $html_select;
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
'',
|
||||||
|
$disabled
|
||||||
|
),
|
||||||
|
html_print_image(
|
||||||
|
'images/input_add.png',
|
||||||
|
true,
|
||||||
|
[
|
||||||
|
'title' => $add_title,
|
||||||
|
'onclick' => sprintf(
|
||||||
|
"add_source_dialog('%s', '%s')",
|
||||||
|
$id,
|
||||||
|
$source_id
|
||||||
|
),
|
||||||
|
]
|
||||||
|
),
|
||||||
|
html_print_image(
|
||||||
|
'images/input_delete.png',
|
||||||
|
true,
|
||||||
|
[
|
||||||
|
'title' => $delete_title,
|
||||||
|
'onclick' => sprintf(
|
||||||
|
"remove_source_elements('%s', '%s')",
|
||||||
|
$id,
|
||||||
|
$source_id
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -668,17 +709,79 @@ function notifications_print_source_select_box(
|
|||||||
*/
|
*/
|
||||||
function notifications_print_two_ways_select($info_selec, $users, $source_id)
|
function notifications_print_two_ways_select($info_selec, $users, $source_id)
|
||||||
{
|
{
|
||||||
$html_select = "<div class='global_config_notifications_dialog_add'>";
|
return sprintf(
|
||||||
$html_select .= html_print_select(empty($info_selec) ? true : $info_selec, 'all-multi-'.$users.'-'.$source_id.'[]', 0, false, '', '', true, true, true, '');
|
"
|
||||||
$html_select .= "<div class='global_config_notifications_two_ways_form_arrows'>";
|
<div class='global_config_notifications_dialog_add'>
|
||||||
$html_select .= html_print_image('images/darrowright.png', true, ['title' => $add_title, 'onclick' => 'notifications_modify_two_ways_element("'.$users.'", "'.$source_id.'", "add")']);
|
%s
|
||||||
$html_select .= html_print_image('images/darrowleft.png', true, ['title' => $add_title, 'onclick' => 'notifications_modify_two_ways_element("'.$users.'", "'.$source_id.'", "remove")']);
|
<div class='global_config_notifications_two_ways_form_arrows'>
|
||||||
$html_select .= '</div>';
|
%s
|
||||||
$html_select .= html_print_select(true, 'selected-multi-'.$users.'-'.$source_id.'[]', 0, false, '', '', true, true, true, '');
|
%s
|
||||||
$html_select .= '</div>';
|
</div>
|
||||||
$html_select .= html_print_button(__('Add'), 'Add', false, 'notifications_add_source_element_to_database("'.$users.'", "'.$source_id.'")', "class='sub add'", true);
|
%s
|
||||||
|
</div>
|
||||||
return $html_select;
|
%s
|
||||||
|
",
|
||||||
|
html_print_select(
|
||||||
|
empty($info_selec) ? true : $info_selec,
|
||||||
|
'all-multi-'.$users.'-'.$source_id.'[]',
|
||||||
|
0,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
''
|
||||||
|
),
|
||||||
|
html_print_image(
|
||||||
|
'images/darrowright.png',
|
||||||
|
true,
|
||||||
|
[
|
||||||
|
'title' => __('Add elements'),
|
||||||
|
'onclick' => sprintf(
|
||||||
|
"notifications_modify_two_ways_element('%s', '%s', 'add')",
|
||||||
|
$users,
|
||||||
|
$source_id
|
||||||
|
),
|
||||||
|
]
|
||||||
|
),
|
||||||
|
html_print_image(
|
||||||
|
'images/darrowleft.png',
|
||||||
|
true,
|
||||||
|
[
|
||||||
|
'title' => __('Remove elements'),
|
||||||
|
'onclick' => sprintf(
|
||||||
|
"notifications_modify_two_ways_element('%s', '%s', 'remove')",
|
||||||
|
$users,
|
||||||
|
$source_id
|
||||||
|
),
|
||||||
|
]
|
||||||
|
),
|
||||||
|
html_print_select(
|
||||||
|
true,
|
||||||
|
'selected-multi-'.$users.'-'.$source_id.'[]',
|
||||||
|
0,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
''
|
||||||
|
),
|
||||||
|
html_print_button(
|
||||||
|
__('Add'),
|
||||||
|
'Add',
|
||||||
|
false,
|
||||||
|
sprintf(
|
||||||
|
"notifications_add_source_element_to_database('%s', '%s')",
|
||||||
|
$users,
|
||||||
|
$source_id
|
||||||
|
),
|
||||||
|
"class='sub add'",
|
||||||
|
true
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user