Add some minor fixes
This commit is contained in:
parent
cc44fc47c9
commit
9e5dec8113
|
|
@ -58,7 +58,7 @@
|
||||||
|
|
||||||
//get total extension count from the database, check limit, if defined
|
//get total extension count from the database, check limit, if defined
|
||||||
if ($action == 'add') {
|
if ($action == 'add') {
|
||||||
if ($_SESSION['limit']['extensions']['numeric'] != '') {
|
if (!empty($_SESSION['limit']['extensions']['numeric'])) {
|
||||||
$sql = "select count(*) ";
|
$sql = "select count(*) ";
|
||||||
$sql .= "from v_extensions ";
|
$sql .= "from v_extensions ";
|
||||||
$sql .= "where domain_uuid = :domain_uuid ";
|
$sql .= "where domain_uuid = :domain_uuid ";
|
||||||
|
|
@ -76,7 +76,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
//get the http values and set them as php variables
|
//get the http values and set them as php variables
|
||||||
if (count($_POST) > 0) {
|
if (!empty($_POST) && count($_POST) > 0) {
|
||||||
|
|
||||||
//get the values from the HTTP POST and save them as PHP variables
|
//get the values from the HTTP POST and save them as PHP variables
|
||||||
if ($action == 'add' || permission_exists("extension_extension")) {
|
if ($action == 'add' || permission_exists("extension_extension")) {
|
||||||
|
|
|
||||||
|
|
@ -84,14 +84,14 @@
|
||||||
$order = $_GET["order"] ?? '';
|
$order = $_GET["order"] ?? '';
|
||||||
|
|
||||||
//get total extension count for domain
|
//get total extension count for domain
|
||||||
if (is_numeric($_SESSION['limit']['extensions']['numeric'])) {
|
if (isset($_SESSION['limit']['extensions']['numeric'])) {
|
||||||
$sql = "select count(*) from v_extensions ";
|
$sql = "select count(*) from v_extensions ";
|
||||||
$sql .= "where domain_uuid = :domain_uuid ";
|
$sql .= "where domain_uuid = :domain_uuid ";
|
||||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||||
$database = new database;
|
$database = new database;
|
||||||
$total_extensions = $database->select($sql, $parameters, 'column');
|
$total_extensions = $database->select($sql, $parameters, 'column');
|
||||||
unset($sql, $parameters);
|
unset($sql, $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
//add the search term
|
//add the search term
|
||||||
$search = strtolower($_GET["search"] ?? '');
|
$search = strtolower($_GET["search"] ?? '');
|
||||||
|
|
@ -177,14 +177,14 @@ if (is_numeric($_SESSION['limit']['extensions']['numeric'])) {
|
||||||
echo "<div class='action_bar' id='action_bar'>\n";
|
echo "<div class='action_bar' id='action_bar'>\n";
|
||||||
echo " <div class='heading'><b>".$text['header-extensions']." (".$num_rows.")</b></div>\n";
|
echo " <div class='heading'><b>".$text['header-extensions']." (".$num_rows.")</b></div>\n";
|
||||||
echo " <div class='actions'>\n";
|
echo " <div class='actions'>\n";
|
||||||
if (permission_exists('extension_import') && (!is_numeric($_SESSION['limit']['extensions']['numeric']) || $total_extensions < $_SESSION['limit']['extensions']['numeric'])) {
|
if (permission_exists('extension_import') && (!isset($_SESSION['limit']['extensions']['numeric']) || $total_extensions < $_SESSION['limit']['extensions']['numeric'])) {
|
||||||
echo button::create(['type'=>'button','label'=>$text['button-import'],'icon'=>$_SESSION['theme']['button_icon_import'],'link'=>'extension_imports.php']);
|
echo button::create(['type'=>'button','label'=>$text['button-import'],'icon'=>$_SESSION['theme']['button_icon_import'],'link'=>'extension_imports.php']);
|
||||||
}
|
}
|
||||||
if (permission_exists('extension_export')) {
|
if (permission_exists('extension_export')) {
|
||||||
echo button::create(['type'=>'button','label'=>$text['button-export'],'icon'=>$_SESSION['theme']['button_icon_export'],'link'=>'extension_download.php']);
|
echo button::create(['type'=>'button','label'=>$text['button-export'],'icon'=>$_SESSION['theme']['button_icon_export'],'link'=>'extension_download.php']);
|
||||||
}
|
}
|
||||||
$margin_left = permission_exists('extension_import') || permission_exists('extension_export') ? "margin-left: 15px;" : null;
|
$margin_left = permission_exists('extension_import') || permission_exists('extension_export') ? "margin-left: 15px;" : null;
|
||||||
if (permission_exists('extension_add') && (!is_numeric($_SESSION['limit']['extensions']['numeric']) || $total_extensions < $_SESSION['limit']['extensions']['numeric'])) {
|
if (permission_exists('extension_add') && (!isset($_SESSION['limit']['extensions']['numeric']) || $total_extensions < $_SESSION['limit']['extensions']['numeric'])) {
|
||||||
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'id'=>'btn_add','style'=>($margin_left ?? ''),'link'=>'extension_edit.php']);
|
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'id'=>'btn_add','style'=>($margin_left ?? ''),'link'=>'extension_edit.php']);
|
||||||
unset($margin_left);
|
unset($margin_left);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue