|
@@ -46,14 +46,17 @@
|
|
|
$language = new text;
|
|
|
$text = $language->get();
|
|
|
|
|
|
+//set from session variables
|
|
|
+ $list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
|
|
+
|
|
|
//get the http post data
|
|
|
- if (is_array($_POST['databases'])) {
|
|
|
+ if (!empty($_POST['databases'])) {
|
|
|
$action = $_POST['action'];
|
|
|
$databases = $_POST['databases'];
|
|
|
}
|
|
|
|
|
|
//process the http post data by action
|
|
|
- if ($action != '' && is_array($databases) && @sizeof($databases) != 0) {
|
|
|
+ if (!empty($action) && !empty($databases)) {
|
|
|
switch ($action) {
|
|
|
case 'copy':
|
|
|
if (permission_exists('database_add')) {
|
|
@@ -74,8 +77,8 @@
|
|
|
}
|
|
|
|
|
|
//get variables used to control the order
|
|
|
- $order_by = $_GET["order_by"];
|
|
|
- $order = $_GET["order"];
|
|
|
+ $order_by = $_GET["order_by"] ?? '';
|
|
|
+ $order = $_GET["order"] ?? '';
|
|
|
|
|
|
//prepare to page the results
|
|
|
$sql = "select count(*) from v_databases ";
|
|
@@ -83,9 +86,9 @@
|
|
|
$num_rows = $database->select($sql, null, 'column');
|
|
|
|
|
|
//prepare to page the results
|
|
|
- $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
|
|
+ $rows_per_page = (!empty($_SESSION['domain']['paging']['numeric'])) ? $_SESSION['domain']['paging']['numeric'] : 50;
|
|
|
$param = "";
|
|
|
- $page = is_numeric($_GET['page']) ? $_GET['page'] : 0;
|
|
|
+ $page = isset($_GET['page']) ? $_GET['page'] : 0;
|
|
|
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page);
|
|
|
$offset = $rows_per_page * $page;
|
|
|
|
|
@@ -141,7 +144,7 @@
|
|
|
echo "<tr class='list-header'>\n";
|
|
|
if (permission_exists('database_add') || permission_exists('database_delete')) {
|
|
|
echo " <th class='checkbox'>\n";
|
|
|
- echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".($databases ?: "style='visibility: hidden;'").">\n";
|
|
|
+ echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".(!empty($databases) ?: "style='visibility: hidden;'").">\n";
|
|
|
echo " </th>\n";
|
|
|
}
|
|
|
echo th_order_by('database_driver', $text['label-driver'], $order_by, $order);
|
|
@@ -149,12 +152,12 @@
|
|
|
echo th_order_by('database_host', $text['label-host'], $order_by, $order);
|
|
|
echo th_order_by('database_name', $text['label-name'], $order_by, $order);
|
|
|
echo th_order_by('database_description', $text['label-description'], $order_by, $order, null, "class='hide-sm-dn'");
|
|
|
- if (permission_exists('database_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
|
|
+ if (permission_exists('database_edit') && $list_row_edit_button == 'true') {
|
|
|
echo " <td class='action-button'> </td>\n";
|
|
|
}
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
- if (is_array($databases) && @sizeof($databases) != 0) {
|
|
|
+ if (!empty($databases)) {
|
|
|
$x = 0;
|
|
|
foreach ($databases as $row) {
|
|
|
$list_row_url = "database_edit.php?id=".urlencode($row['database_uuid']);
|
|
@@ -177,7 +180,7 @@
|
|
|
}
|
|
|
echo " </td>\n";
|
|
|
echo " <td class='description overflow hide-sm-dn'>".escape($row['database_description'])." </td>\n";
|
|
|
- if (permission_exists('database_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
|
|
+ if (permission_exists('database_edit') && $list_row_edit_button == 'true') {
|
|
|
echo " <td class='action-button'>\n";
|
|
|
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
|
|
echo " </td>\n";
|