// We are about to register a new extension
$do = 'register'; $taskId = bigintval(getRequestParameter('reg_ext'));
// The id comes from task management and it is - of course - *not* the extension's name!
-} elseif ((isFormSent('change')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isFormSent('change')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// De-/activate extensions
foreach (postRequestParameter('sel') as $taskId => $active) {
// Shall we keep the extension always active?
// Redirect to prevent missing cache in js.php
redirectToUrl('modules.php?module=admin&what=extensions&changed=' . countPostSelection());
-} elseif (((isFormSent('edit')) || (isPostRequestParameterSet('modify'))) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif (((isFormSent('edit')) || (isPostRequestParameterSet('modify'))) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Change settings like CSS file load
if (isPostRequestParameterSet('modify')) {
// Change entries
loadTemplate('admin_extensions_edit', false, $OUT);
$do = 'edit';
}
-} elseif ((isPostRequestParameterSet('delete')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isPostRequestParameterSet('delete')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// List extensions and when verbose is enabled SQL statements which will be executed
$OUT = '';
foreach (postRequestParameter('sel') as $taskId => $sel) {
// Get extension name
$ext_name = getExtensionName($taskId);
- if (getConfig('verbose_sql') == 'Y') {
+ if (isVerboseSqlEnabled()) {
// Load SQL commands in remove mode
if (loadExtension($ext_name, 'remove', '', true)) {
// Generate extra table with loaded SQL commands
// Load template
loadTemplate('admin_extensions_delete', false, $OUT);
$do = 'delete';
-} elseif ((isFormSent('remove')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isFormSent('remove')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Remove extensions from DB (you have to delete all files manually!)
$cache_update = '0';
foreach (postRequestParameter('sel') as $taskId => $active) {
} else {
// Load extension data without CSS informations
$result = SQL_QUERY("SELECT
- `id` AS ext_id, `ext_name`, `ext_active, `ext_version`
+ `id` AS ext_id, `ext_name`, `ext_active`, `ext_version`
FROM
`{?_MYSQL_PREFIX?}_extensions`
".$where."
}
// Are there some entries?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Extensions are registered
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {