// Handle a (maybe) sent form here
function doNetworkHandleForm () {
- // Do we have a form sent?
+ // Is there a form sent?
if (countRequestPost() > 0) {
// Detect sent POST form
detectNetworkProcessForm();
LIMIT 1",
array(bigintval($networkId)), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Then get it
$GLOBALS['network_data'][$networkId] = SQL_FETCHARRAY($result);
LIMIT 1",
array(bigintval($networkId)), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Then get it
$GLOBALS['network_data'][$networkId] = SQL_FETCHARRAY($result);
LIMIT 1',
array(bigintval($networkId)), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Then get it
$GLOBALS['network_type_data'][$networkId] = SQL_FETCHARRAY($result);
LIMIT 1',
array(bigintval($networkId)), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Then get it
$networkRequestData = SQL_FETCHARRAY($result);
ORDER BY
`network_short_name` ASC", __FUNCTION__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
// List all entries
$rows = array();
bigintval($networkId)
), __FUNCTION__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
// List all entries
$rows = array();
d.`network_short_name` ASC,
t.`network_type_handler` ASC", __FUNCTION__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
// List all entries
$rows = array();
// Generates an option list of request types
function generateNetworkRequestTypeOptions ($default = '') {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$default])) {
// Generate the list
$GLOBALS[__FUNCTION__][$default] = generateOptions(
// Generates an option list of network_api_active
function generateNetworkApiActiveOptions ($default = '') {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$default])) {
// Generate the list
$GLOBALS[__FUNCTION__][$default] = generateYesNoOptions($default);
// Translates API index
function translateNetworkApiIndex ($index) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS['network_array_index'])) {
// Get an array of all API array indexes
$GLOBALS['network_array_index'] = array();
ORDER BY
`sort` ASC', __FUNCTION__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
// Get all entries
while ($row = SQL_FETCHARRAY($result)) {
// Translates network API configuration status (see function isNetworkApiConfigured()) by given id
function translateNetworkApiConfiguredStatusById ($networkId) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$networkId])) {
// By default it is not configured
$GLOBALS[__FUNCTION__][$networkId] = '{--ADMIN_NETWORK_API_NOT_CONFIGURED--}';
// Checks if the given network is configured by looking its API configuration entry up
function isNetworkApiConfigured ($networkId) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$networkId])) {
// Check for an entry in network_api_config
$GLOBALS[__FUNCTION__][$networkId] = (countSumTotalData(
// Checks whether the given network type handler is configured
function isNetworkTypeHandlerConfigured ($networkId, $networkTypeId) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$networkId][$networkTypeId])) {
// Determine it
$GLOBALS[__FUNCTION__][$networkId][$networkTypeId] = (countSumTotalData(
// Displays selected networks for editing
function doAdminNetworkProcessHandleNetworks () {
- // Do we have selections?
+ // Is there selections?
if (ifPostContainsSelections()) {
// Something has been selected, so start displaying one by one
$OUT = '';
// Load this network's data
$networkData = getNetworkDataById($networkId);
- // Do we have found the network?
+ // Is there found the network?
if (count($networkData) > 0) {
// Add row template with given form name
$OUT .= loadTemplate('admin_' . $GLOBALS['network_form_name'] . '_networks_row', true, $networkData);
// Handle network type form
function doAdminNetworkProcessHandleNetworkTypes () {
- // Do we have selections?
+ // Is there selections?
if (ifPostContainsSelections()) {
// Load network data
$networkData = getNetworkDataById(getRequestElement('network_id'));
// Load this network's data
$networkTypeData = getNetworkTypeDataById($networkId);
- // Do we have found the network?
+ // Is there found the network?
if (count($networkTypeData) > 0) {
if (isFormSent('edit')) {
// Add row template for deleting
// Handle network request parameter form
function doAdminNetworkProcessHandleRequestParams () {
- // Do we have selections?
+ // Is there selections?
if (ifPostContainsSelections()) {
// Init cache array
$GLOBALS['network_request_params_disabled'] = array();
// Load this network's data
$networkRequestData = getNetworkRequestParamsDataById($networkId);
- // Do we have found the network?
+ // Is there found the network?
if (count($networkRequestData) > 0) {
if (isFormSent('edit')) {
// Add row template for deleting
// Changes given networks
function doAdminNetworkProcessChangeNetworks () {
- // Do we have selections?
+ // Is there selections?
if (ifPostContainsSelections()) {
// By default nothing is updated
$updated = 0;
continue;
} // END - if
- // Do we have this enty?
+ // Is there this enty?
if (!isset($entry[$networkId])) {
// Not found, needs fixing
reportBug(__FUNCTION__, __LINE__, 'No entry in key=' . $key . ', id=' . $networkId . ' found.');
} // END - if
} // END - foreach
- // Do we have updates?
+ // Is there updates?
if ($updated > 0) {
// Updates done
displayMessage('{%message,ADMIN_NETWORK_UPDATED=' . $updated . '%}');
// Removes given networks
function doAdminNetworkProcessRemoveNetworks () {
- // Do we have selections?
+ // Is there selections?
if (ifPostContainsSelections()) {
// By default nothing is removed
$removed = 0;
} // END - if
} // END - foreach
- // Do we have removes?
+ // Is there removes?
if ($removed > 0) {
// Removals done
displayMessage('{%message,ADMIN_NETWORK_REMOVED=' . $removed . '%}');
// Changes given network type handlers
function doAdminNetworkProcessChangeHandlerTypes () {
- // Do we have selections?
+ // Is there selections?
if (ifPostContainsSelections()) {
// By default nothing is updated
$updated = 0;
continue;
} // END - if
- // Do we have this enty?
+ // Is there this enty?
if (!isset($entry[$networkId])) {
// Not found, needs fixing
reportBug(__FUNCTION__, __LINE__, 'No entry in key=' . $key . ', id=' . $networkId . ' found.');
} // END - if
} // END - foreach
- // Do we have updates?
+ // Is there updates?
if ($updated > 0) {
// Updates done
displayMessage('{%message,ADMIN_NETWORK_TYPE_HANDLER_UPDATED=' . $updated . '%}');
// Changes given network request parameters
function doAdminNetworkProcessChangeRequestParams () {
- // Do we have selections?
+ // Is there selections?
if (ifPostContainsSelections()) {
// By default nothing is updated
$updated = 0;
continue;
} // END - if
- // Do we have this enty?
+ // Is there this enty?
if (!isset($entry[$networkId])) {
// Not found, needs fixing
reportBug(__FUNCTION__, __LINE__, 'No entry in key=' . $key . ', id=' . $networkId . ' found.');
} // END - if
} // END - foreach
- // Do we have updates?
+ // Is there updates?
if ($updated > 0) {
// Updates done
displayMessage('{%message,ADMIN_NETWORK_REQUEST_PARAMETER_UPDATED=' . $updated . '%}');
// Removes given network type handlers
function doAdminNetworkProcessRemoveNetworkTypes () {
- // Do we have selections?
+ // Is there selections?
if (ifPostContainsSelections()) {
// By default nothing is removed
$removed = 0;
} // END - if
} // END - foreach
- // Do we have removes?
+ // Is there removes?
if ($removed > 0) {
// Removals done
displayMessage('{%message,ADMIN_NETWORK_TYPE_HANDLER_REMOVED=' . $removed . '%}');
// Removes given network request parameters
function doAdminNetworkProcessRemoveNetworkRequestParams () {
- // Do we have selections?
+ // Is there selections?
if (ifPostContainsSelections()) {
// By default nothing is removed
$removed = 0;
} // END - if
} // END - foreach
- // Do we have removes?
+ // Is there removes?
if ($removed > 0) {
// Removals done
displayMessage('{%message,ADMIN_NETWORK_REQUEST_PARAMETER_REMOVED=' . $removed . '%}');
$result = SQL_QUERY_ESC('SELECT `network_type_id` FROM `{?_MYSQL_PREFIX?}_network_types` WHERE `network_id`=%s ORDER BY `network_type_id` ASC',
array(bigintval(getRequestElement('network_id'))), __FUNCTION__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (SQL_HASZERONUMS($result)) {
// No, then abort here
displayMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_SET_ALL_404--}');
$result = SQL_QUERY_ESC('SELECT `network_data_id` FROM `{?_MYSQL_PREFIX?}_network_types_config` WHERE `network_id`=%s ORDER BY `network_type_id` ASC',
array(bigintval(getRequestElement('network_id'))), __FUNCTION__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (SQL_HASZERONUMS($result)) {
// No, then abort here
displayMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_SET_ALL_404--}');