'', 'label' => __('Dashboards'), ], ] ); if (isset($resultDelete) === true) { \ui_print_result_message( $resultDelete, __('Successfully deleted'), __('Could not be deleted') ); } if (isset($resultCopy) === true) { \ui_print_result_message( $resultCopy, __('Successfully duplicate'), __('Could not be duplicate') ); } if (empty($dashboards) === true) { ui_print_info_message( [ 'no_close' => true, 'message' => __('There are no dashboards defined.'), ] ); } else { $id_table = 'dashboards_list'; $columns = [ 'name', 'cells', 'groups', 'favorite', 'full_screen', ]; $column_names = [ __('Name'), __('Cells'), __('Group'), __('Favorite'), __('Full screen'), ]; if ($manageDashboards === 1) { $columns[] = 'copy'; $columns[] = 'delete'; $column_names[] = __('Copy'); $column_names[] = __('Delete'); } ui_print_datatable( [ 'id' => $id_table, 'class' => 'info_table', 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $column_names, 'ajax_url' => 'include/ajax/dashboard.ajax', 'ajax_data' => [ 'method' => 'draw', 'urlDashboard' => $urlDashboard, 'manageDashboards' => $manageDashboards, ], 'default_pagination' => $config['block_size'], 'no_sortable_columns' => [ 4, 5, 6, ], 'order' => [ 'field' => 'name', 'direction' => 'desc', ], 'search_button_class' => 'sub filter float-right', 'form' => [ 'inputs' => [ [ 'label' => __('Name'), 'type' => 'text', 'class' => 'w80p', 'id' => 'free_search', 'name' => 'free_search', ], [ 'label' => __('Group'), 'type' => 'select_groups', 'id' => 'group', 'name' => 'group', ], ], ], 'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar', 'csv' => false, ] ); } $input_button = ''; if ($writeDashboards === 1) { $text = __('Create a new dashboard'); // Button for display modal options dashboard. $onclick = 'show_option_dialog('.json_encode( [ 'title' => $text, 'btn_text' => __('Ok'), 'btn_cancel' => __('Cancel'), 'url' => $ajaxController, 'url_ajax' => ui_get_full_url('ajax.php'), ] ); $onclick .= ')'; $input_button = html_print_button( __('New dashboard'), '', false, $onclick, ['icon' => 'add'], true ); if (isset($output) === false) { $output = '
'; } $output .= '
'; echo $output; // Div for modal update dashboard. echo ''; } if (isset($tablePagination) === false) { $tablePagination = ''; } html_print_action_buttons( $input_button, [ 'type' => 'form_action', 'right_content' => $tablePagination, ] ); ui_require_javascript_file('pandora_dashboards');