Extension ext-network continued:
[mailer.git] / inc / libs / network_functions.php
index 761b5b85060bbf7c4f00d8d0ff57d9e7bf44b528..8438c972198160a9a9864f91eb632e874f1dfeae 100644 (file)
@@ -172,11 +172,11 @@ function isNetworkActiveById ($networkId) {
 }
 
 // "Getter" for 'network_activated' column depending on current administrator's expert setting
-function getNetworkActivatedColumn ($whereAnd = 'WHERE', $table = '') {
+function getNetworkActivatedColumn ($whereAnd = 'WHERE', $table = '', $addSql = '') {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__][$whereAnd][$table])) {
                // Default is exclude deactivated networks
-               $GLOBALS[__FUNCTION__][$whereAnd][$table] = ' ' . $whereAnd . ' ' . $table . "`network_active`='Y'";
+               $GLOBALS[__FUNCTION__][$whereAnd][$table] = ' ' . $whereAnd . ' ' . $table . "`network_active`='Y'" .  $addSql;
 
                // Is the export setting on and debug mode enabled?
                if ((isAdminsExpertSettingEnabled()) && (isDebugModeEnabled())) {
@@ -688,7 +688,7 @@ function doAdminRemoveNetworkEntry ($table, $column, $id, $limit = 1) {
 }
 
 // Generates a list of networks for given script and returns it
-function generateAdminNetworkList ($separated = FALSE, $includeConfigured = TRUE, $includeUnconfigured = TRUE, $extraName = '') {
+function generateAdminNetworkList ($separated = FALSE, $includeConfigured = TRUE, $includeUnconfigured = TRUE, $extraName = '', $addSql = '') {
        // Init output
        $content = '';
 
@@ -704,7 +704,7 @@ function generateAdminNetworkList ($separated = FALSE, $includeConfigured = TRUE
        `network_active`
 FROM
        `{?_MYSQL_PREFIX?}_network_data`
-' . getNetworkActivatedColumn() . '
+' . getNetworkActivatedColumn('WHERE', '', $addSql) . '
 ORDER BY
        `network_short_name` ASC', __FUNCTION__, __LINE__);
 
@@ -747,10 +747,10 @@ ORDER BY
                        $content = generateSelectionBoxFromArray($rows, 'network_id', 'network_id', '', $extraName, 'network');
                } else {
                        // Generate two small, first configured
-                       $content = generateAdminNetworkList(FALSE, TRUE, FALSE, '_configured');
+                       $content = generateAdminNetworkList(FALSE, TRUE, FALSE, '_configured', $addSql);
 
                        // Then add unconfigured
-                       $content .= generateAdminNetworkList(FALSE, FALSE, TRUE, '_unconfigured');
+                       $content .= generateAdminNetworkList(FALSE, FALSE, TRUE, '_unconfigured', $addSql);
                }
        } else {
                // Nothing selected
@@ -1187,6 +1187,12 @@ function handleNetworkPaymentCheckRequest () {
        reportBug(__FUNCTION__, __LINE__, 'Not yet implemented.');
 }
 
+// Handles the network-delete-url request
+function handleNetworkDeleteUrlRequest () {
+       // @TODO Implement this function, don't forget to set HTTP status back to '200 OK' if everything went fine
+       reportBug(__FUNCTION__, __LINE__, 'Not yet implemented.');
+}
+
 // Handle a single request parameter key by given network type handler id and "internal" key
 function handleRequestParameterKey ($networkTypeId, $networkRequestKey) {
        // Construct call-back function name