|
@@ -43,14 +43,14 @@
|
|
$text = $language->get();
|
|
$text = $language->get();
|
|
|
|
|
|
//get the http post data
|
|
//get the http post data
|
|
- if (is_array($_POST['dashboard'])) {
|
|
|
|
|
|
+ if (!empty($_POST['dashboard'])) {
|
|
$action = $_POST['action'];
|
|
$action = $_POST['action'];
|
|
$search = $_POST['search'];
|
|
$search = $_POST['search'];
|
|
$dashboard = $_POST['dashboard'];
|
|
$dashboard = $_POST['dashboard'];
|
|
}
|
|
}
|
|
|
|
|
|
//process the http post data by action
|
|
//process the http post data by action
|
|
- if ($action != '' && is_array($dashboard) && @sizeof($dashboard) != 0) {
|
|
|
|
|
|
+ if (!empty($action) && is_array($dashboard) && @sizeof($dashboard) != 0) {
|
|
|
|
|
|
switch ($action) {
|
|
switch ($action) {
|
|
case 'copy':
|
|
case 'copy':
|
|
@@ -79,8 +79,8 @@
|
|
}
|
|
}
|
|
|
|
|
|
//get order and order by
|
|
//get order and order by
|
|
- $order_by = $_GET["order_by"];
|
|
|
|
- $order = $_GET["order"];
|
|
|
|
|
|
+ $order_by = $_GET["order_by"] ?? null;
|
|
|
|
+ $order = $_GET["order"] ?? null;
|
|
|
|
|
|
//add the search
|
|
//add the search
|
|
if (isset($_GET["search"])) {
|
|
if (isset($_GET["search"])) {
|
|
@@ -195,7 +195,7 @@
|
|
$parameters['search'] = '%'.$search.'%';
|
|
$parameters['search'] = '%'.$search.'%';
|
|
}
|
|
}
|
|
$database = new database;
|
|
$database = new database;
|
|
- $num_rows = $database->select($sql, $parameters, 'column');
|
|
|
|
|
|
+ $num_rows = $database->select($sql, $parameters ?? null, 'column');
|
|
unset($sql, $parameters);
|
|
unset($sql, $parameters);
|
|
|
|
|
|
//get the list
|
|
//get the list
|
|
@@ -224,9 +224,9 @@
|
|
$parameters['search'] = '%'.strtolower($search).'%';
|
|
$parameters['search'] = '%'.strtolower($search).'%';
|
|
}
|
|
}
|
|
$sql .= order_by($order_by, $order, 'dashboard_order', 'asc');
|
|
$sql .= order_by($order_by, $order, 'dashboard_order', 'asc');
|
|
- $sql .= limit_offset($rows_per_page, $offset);
|
|
|
|
|
|
+ $sql .= limit_offset($rows_per_page ?? null, $offset ?? null);
|
|
$database = new database;
|
|
$database = new database;
|
|
- $dashboard = $database->select($sql, $parameters, 'all');
|
|
|
|
|
|
+ $dashboard = $database->select($sql, $parameters ?? null, 'all');
|
|
unset($sql, $parameters);
|
|
unset($sql, $parameters);
|
|
|
|
|
|
//create token
|
|
//create token
|
|
@@ -245,20 +245,20 @@
|
|
if (permission_exists('dashboard_add')) {
|
|
if (permission_exists('dashboard_add')) {
|
|
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'id'=>'btn_add','name'=>'btn_add','link'=>'dashboard_edit.php']);
|
|
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'id'=>'btn_add','name'=>'btn_add','link'=>'dashboard_edit.php']);
|
|
}
|
|
}
|
|
- if (permission_exists('dashboard_add') && $dashboard) {
|
|
|
|
|
|
+ if (permission_exists('dashboard_add') && !empty($dashboard)) {
|
|
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'id'=>'btn_copy','name'=>'btn_copy','style'=>'display:none;','onclick'=>"modal_open('modal-copy','btn_copy');"]);
|
|
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'id'=>'btn_copy','name'=>'btn_copy','style'=>'display:none;','onclick'=>"modal_open('modal-copy','btn_copy');"]);
|
|
}
|
|
}
|
|
- if (permission_exists('dashboard_edit') && $dashboard) {
|
|
|
|
|
|
+ if (permission_exists('dashboard_edit') && !empty($dashboard)) {
|
|
echo button::create(['type'=>'button','label'=>$text['button-toggle'],'icon'=>$_SESSION['theme']['button_icon_toggle'],'id'=>'btn_toggle','name'=>'btn_toggle','style'=>'display:none;','onclick'=>"modal_open('modal-toggle','btn_toggle');"]);
|
|
echo button::create(['type'=>'button','label'=>$text['button-toggle'],'icon'=>$_SESSION['theme']['button_icon_toggle'],'id'=>'btn_toggle','name'=>'btn_toggle','style'=>'display:none;','onclick'=>"modal_open('modal-toggle','btn_toggle');"]);
|
|
}
|
|
}
|
|
- if (permission_exists('dashboard_delete') && $dashboard) {
|
|
|
|
|
|
+ if (permission_exists('dashboard_delete') && !empty($dashboard)) {
|
|
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display:none;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
|
|
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display:none;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
|
|
}
|
|
}
|
|
echo "<form id='form_search' class='inline' method='get'>\n";
|
|
echo "<form id='form_search' class='inline' method='get'>\n";
|
|
- echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown=''>";
|
|
|
|
|
|
+ echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search ?? '')."\" placeholder=\"".$text['label-search']."\" onkeydown=''>";
|
|
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search']);
|
|
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search']);
|
|
//echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'dashboard.php','style'=>($search == '' ? 'display: none;' : null)]);
|
|
//echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'dashboard.php','style'=>($search == '' ? 'display: none;' : null)]);
|
|
- if ($paging_controls_mini != '') {
|
|
|
|
|
|
+ if (!empty($paging_controls_mini)) {
|
|
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>\n";
|
|
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>\n";
|
|
}
|
|
}
|
|
echo " </form>\n";
|
|
echo " </form>\n";
|
|
@@ -266,26 +266,26 @@
|
|
echo " <div style='clear: both;'></div>\n";
|
|
echo " <div style='clear: both;'></div>\n";
|
|
echo "</div>\n";
|
|
echo "</div>\n";
|
|
|
|
|
|
- if (permission_exists('dashboard_add') && $dashboard) {
|
|
|
|
|
|
+ if (permission_exists('dashboard_add') && !empty($dashboard)) {
|
|
echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('copy'); list_form_submit('form_list');"])]);
|
|
echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('copy'); list_form_submit('form_list');"])]);
|
|
}
|
|
}
|
|
- if (permission_exists('dashboard_edit') && $dashboard) {
|
|
|
|
|
|
+ if (permission_exists('dashboard_edit') && !empty($dashboard)) {
|
|
echo modal::create(['id'=>'modal-toggle','type'=>'toggle','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_toggle','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('toggle'); list_form_submit('form_list');"])]);
|
|
echo modal::create(['id'=>'modal-toggle','type'=>'toggle','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_toggle','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('toggle'); list_form_submit('form_list');"])]);
|
|
}
|
|
}
|
|
- if (permission_exists('dashboard_delete') && $dashboard) {
|
|
|
|
|
|
+ if (permission_exists('dashboard_delete') && !empty($dashboard)) {
|
|
echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('delete'); list_form_submit('form_list');"])]);
|
|
echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('delete'); list_form_submit('form_list');"])]);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
echo "<form id='form_list' method='post'>\n";
|
|
echo "<form id='form_list' method='post'>\n";
|
|
echo "<input type='hidden' id='action' name='action' value=''>\n";
|
|
echo "<input type='hidden' id='action' name='action' value=''>\n";
|
|
- echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";
|
|
|
|
|
|
+ echo "<input type='hidden' name='search' value=\"".escape($search ?? '')."\">\n";
|
|
|
|
|
|
echo "<table class='list'>\n";
|
|
echo "<table class='list'>\n";
|
|
echo "<tr class='list-header'>\n";
|
|
echo "<tr class='list-header'>\n";
|
|
if (permission_exists('dashboard_add') || permission_exists('dashboard_edit') || permission_exists('dashboard_delete')) {
|
|
if (permission_exists('dashboard_add') || permission_exists('dashboard_edit') || permission_exists('dashboard_delete')) {
|
|
echo " <th class='checkbox'>\n";
|
|
echo " <th class='checkbox'>\n";
|
|
- echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".($dashboard ?: "style='visibility: hidden;'").">\n";
|
|
|
|
|
|
+ echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".(!empty($dashboard) ?: "style='visibility: hidden;'").">\n";
|
|
echo " </th>\n";
|
|
echo " </th>\n";
|
|
}
|
|
}
|
|
echo th_order_by('dashboard_name', $text['label-dashboard_name'], $order_by, $order);
|
|
echo th_order_by('dashboard_name', $text['label-dashboard_name'], $order_by, $order);
|
|
@@ -293,12 +293,12 @@
|
|
echo th_order_by('dashboard_order', $text['label-dashboard_order'], $order_by, $order);
|
|
echo th_order_by('dashboard_order', $text['label-dashboard_order'], $order_by, $order);
|
|
echo th_order_by('dashboard_enabled', $text['label-dashboard_enabled'], $order_by, $order, null, "class='center'");
|
|
echo th_order_by('dashboard_enabled', $text['label-dashboard_enabled'], $order_by, $order, null, "class='center'");
|
|
echo " <th class='hide-sm-dn'>".$text['label-dashboard_description']."</th>\n";
|
|
echo " <th class='hide-sm-dn'>".$text['label-dashboard_description']."</th>\n";
|
|
- if (permission_exists('dashboard_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
|
|
|
|
|
+ if (permission_exists('dashboard_edit') && isset($_SESSION['theme']['list_row_edit_button']['boolean']) && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
|
echo " <td class='action-button'> </td>\n";
|
|
echo " <td class='action-button'> </td>\n";
|
|
}
|
|
}
|
|
echo "</tr>\n";
|
|
echo "</tr>\n";
|
|
|
|
|
|
- if (is_array($dashboard) && @sizeof($dashboard) != 0) {
|
|
|
|
|
|
+ if (!empty($dashboard)) {
|
|
$x = 0;
|
|
$x = 0;
|
|
foreach ($dashboard as $row) {
|
|
foreach ($dashboard as $row) {
|
|
if (permission_exists('dashboard_edit')) {
|
|
if (permission_exists('dashboard_edit')) {
|
|
@@ -332,7 +332,7 @@
|
|
}
|
|
}
|
|
echo " </td>\n";
|
|
echo " </td>\n";
|
|
echo " <td class='description overflow hide-sm-dn'>".escape($row['dashboard_description'])."</td>\n";
|
|
echo " <td class='description overflow hide-sm-dn'>".escape($row['dashboard_description'])."</td>\n";
|
|
- if (permission_exists('dashboard_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
|
|
|
|
|
+ if (permission_exists('dashboard_edit') && isset($_SESSION['theme']['list_row_edit_button']['boolean']) && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
|
echo " <td class='action-button'>\n";
|
|
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 button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
|
echo " </td>\n";
|
|
echo " </td>\n";
|
|
@@ -345,11 +345,11 @@
|
|
|
|
|
|
echo "</table>\n";
|
|
echo "</table>\n";
|
|
echo "<br />\n";
|
|
echo "<br />\n";
|
|
- echo "<div align='center'>".$paging_controls."</div>\n";
|
|
|
|
|
|
+ echo "<div align='center'>".($paging_controls ?? '')."</div>\n";
|
|
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
|
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
|
echo "</form>\n";
|
|
echo "</form>\n";
|
|
|
|
|
|
//include the footer
|
|
//include the footer
|
|
require_once "resources/footer.php";
|
|
require_once "resources/footer.php";
|
|
|
|
|
|
-?>
|
|
|
|
|
|
+?>
|