These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * /_includes/settings/dw-list-accounts.inc.php |
||
4 | * |
||
5 | * This file is part of DomainMOD, an open source domain and internet asset manager. |
||
6 | * Copyright (c) 2010-2017 Greg Chetcuti <[email protected]> |
||
7 | * |
||
8 | * Project: http://domainmod.org Author: http://chetcuti.com |
||
9 | * |
||
10 | * DomainMOD is free software: you can redistribute it and/or modify it under the terms of the GNU General Public |
||
11 | * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later |
||
12 | * version. |
||
13 | * |
||
14 | * DomainMOD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied |
||
15 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
||
16 | * |
||
17 | * You should have received a copy of the GNU General Public License along with DomainMOD. If not, see |
||
18 | * http://www.gnu.org/licenses/. |
||
19 | * |
||
20 | */ |
||
21 | ?> |
||
22 | <?php |
||
23 | View Code Duplication | if ($_SESSION['s_dw_view_all'] == "1") { |
|
1 ignored issue
–
show
|
|||
24 | |||
25 | $page_title = "Listing All Server Accounts"; |
||
26 | |||
27 | } else { |
||
28 | |||
29 | $page_title = 'Listing Server Accounts on ' . $_SESSION['s_dw_server_name'] . ' (' . $_SESSION['s_dw_server_host'] . ')'; |
||
30 | |||
31 | } |
||
32 | $breadcrumb = "Accounts"; |
||
33 | $software_section = "dw"; |
||
34 | $software_section_logo = "fa-database"; |
||
35 | $slug = "dw-list-accounts"; |
||
36 | $datatable_css = '#' . $slug . ' thead th { padding: 2px 0px 2px 6px; border: 0; white-space: nowrap; } |
||
37 | #' . $slug . ' tbody tr:hover { background-color: #ffffff; } |
||
38 | #' . $slug . ' tbody td { padding: 2px 0px 2px 6px; border: 0; white-space: nowrap; }'; |
||
39 | $datatable_class = 'table table-striped dt-responsive cell-border compact'; |
||
40 | $datatable_options = 'var oldStart = 0; |
||
41 | $(\'#' . $slug . '\').DataTable({ |
||
42 | "paging": true, |
||
43 | "lengthChange": true, |
||
44 | "lengthMenu": [ [10, 25, 50, 75, 100, -1], [10, 25, 50, 75, 100, "All"] ], |
||
45 | "searching": true, |
||
46 | "info": true, |
||
47 | "autoWidth": true, |
||
48 | "bAutoWidth": false, |
||
49 | "responsive": { |
||
50 | details: { |
||
51 | type: "column" |
||
52 | } |
||
53 | }, |
||
54 | "columnDefs": [ { |
||
55 | className: "control", |
||
56 | orderable: false, |
||
57 | targets: 0 |
||
58 | } ], |
||
59 | "ordering": true, |
||
60 | "order": [[ 1, "asc" ]], |
||
61 | "bSortClasses": false, |
||
62 | "dom": \'<"top"lif>rt<"bottom"ip><"clear">\', |
||
63 | "fnDrawCallback": function (o) { |
||
64 | if ( o._iDisplayStart != oldStart ) { |
||
65 | var targetOffset = $("#' . $slug . '").offset().top; |
||
66 | $("html,body").animate({scrollTop: targetOffset}, 0); |
||
67 | oldStart = o._iDisplayStart; |
||
68 | } |
||
69 | } |
||
70 | });'; |
||
71 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.