$message_id) { update_manger_set_read_message($message_id, 0); } } if ($read_action !== false) { $selected = get_parameter('select_multiple', false); foreach ($selected as $k => $message_id) { update_manger_set_read_message($message_id, 1); } } if ($delete_action !== false) { $selected = get_parameter('select_multiple', false); foreach ($selected as $k => $message_id) { update_manger_set_deleted_message($message_id); } } $offset = (int) get_parameter('offset', 0); $total_messages = update_manager_get_not_deleted_messages(); if ($total_messages) { // Get all messages $sql = 'SELECT data, svn_version, filename, data_rollback, db_field_value FROM tupdate '; $sql .= 'WHERE description NOT LIKE \'%"'.$config['id_user'].'":1%\' '; $sql .= 'OR description IS NULL '; $sql .= 'ORDER BY svn_version DESC '; $sql .= 'LIMIT '.$offset.','.$config['block_size'].' '; $um_messages = []; $um_messages = db_get_all_rows_sql($sql); echo '
'; html_print_input_hidden('tab', 'messages'); html_print_input_hidden('offset', $offset); echo '
'; html_print_submit_button( __('Delete'), 'delete_button', false, 'class="sub delete"' ); echo '
'; echo '
'; html_print_submit_button( __('Mark as not read'), 'not_read_button', false, 'class="sub wand"' ); echo '
'; echo '
'; html_print_submit_button( __('Mark as read'), 'read_button', false, 'class="sub upd"' ); echo '
'; // Pagination if ($total_messages > $config['block_size']) { ui_pagination(update_manager_get_total_messages(), false, 0); } $table = new stdClass(); $table->width = '100%'; $table->class = 'databox data'; $table->cellpadding = 4; $table->cellspacing = 4; $table->head = []; $table->data = []; $table->align = []; $table->size = []; $table->id = 'um_messages_table'; $table->align[0] = 'left'; $table->align[1] = 'left'; $table->align[2] = 'left'; $table->align[3] = 'left'; $table->align[4] = 'left'; $table->size[0] = '30px'; $table->size[1] = '100px'; $table->size[3] = '80px'; $table->size[4] = '60px'; $table->style[0] = 'padding-left: 20px'; $table->style[1] = 'display: none'; $table->head[0] = html_print_checkbox_extended('all_selection[]', 0, false, false, '', '', true); $table->head[2] = __('Subject'); $i = 0; foreach ($um_messages as $message) { $data[0] = html_print_checkbox_extended('select_multiple[]', $message['svn_version'], false, false, '', 'class="check_selection"', true); $table->cellclass[count($table->data)][0] = 'um_individual_check'; $data[1] = $message['svn_version']; $table->cellclass[count($table->data)][1] = 'um_individual_info'; $data[2] = io_safe_output($message['db_field_value']); $table->cellclass[count($table->data)][2] = 'um_individual_subject'; // Change row class if message is read or not by this user if (update_manger_get_read_message($message['svn_version'], $message['data_rollback'])) { $table->rowclass[count($table->data)] = 'um_read_message'; } else { $table->rowclass[count($table->data)] = 'um_not_read_message'; } array_push($table->data, $data); } html_print_table($table); echo '
'; html_print_submit_button( __('Delete'), 'delete_button', false, 'class="sub delete"' ); echo '
'; echo '
'; html_print_submit_button( __('Mark as not read'), 'not_read_button', false, 'class="sub wand"' ); echo '
'; echo '
'; html_print_submit_button( __('Mark as read'), 'read_button', false, 'class="sub upd"' ); echo '
'; echo '
'; // Get unread messages to update the notification ball. // Clean the cache because the unread messages can be different. db_clean_cache(); $total_unread_messages = update_manager_get_unread_messages(); } else { ui_print_info_message([ 'no_close' => true, 'message' => __('There is not any update manager messages.') ]); } ?>