+// Translates the network type handler (e.g. banner, paidmail) for templates
+function translateNetworkTypeHandler ($type) {
+ // Get the message id
+ return getMessage('ADMIN_NETWORK_TYPES_' . strtoupper($type) . '');
+}
+
+// Translates request type
+function translateNetworkRequestType ($type) {
+ // Get the message id
+ return getMessage('ADMIN_NETWORK_REQUEST_TYPE_' . strtoupper($type) . '');
+}
+
+// Translates request parameter
+function translateNetworkRequestParameter ($param) {
+ // Get the message id
+ return getMessage('ADMIN_NETWORK_REQUEST_PARAMETER_' . strtoupper($param) . '');
+}
+
+// Translates API index
+function translateNetworkApiIndex ($index) {
+ // Do we have cache?
+ if (!isset($GLOBALS['network_api_index'])) {
+ // Get an array of all API array indexes
+ $GLOBALS['network_api_index'] = array();
+
+ // Get all entries
+ $result = SQL_QUERY('SELECT
+ `network_api_id`, `network_api_index`, `network_translation_name`
+FROM
+ `{?_MYSQL_PREFIX?}_network_api_translation`
+INNER JOIN
+ `{?_MYSQL_PREFIX?}_network_translations`
+ON
+ `network_api_index`=`network_translation_id`
+ORDER BY
+ `sort` ASC', __FUNCTION__, __LINE__);
+
+ // Do we have entries?
+ if (SQL_NUMROWS($result) > 0) {
+ // Get all entries
+ while ($row = SQL_FETCHARRAY($result)) {
+ // Add it to our global array
+ $GLOBALS['network_api_index'][$row['network_api_index']] = $row;
+ } // END - while
+ } // END - if
+
+ // Free result
+ SQL_FREERESULT($result);
+ } // END - if
+
+ // Default name is unknown
+ $name = 'unknown';
+
+ // Is the entry there?
+ if (isset($GLOBALS['network_api_index'][$index])) {
+ // Then get the name
+ $name = $GLOBALS['network_api_index'][$index]['network_translation_name'];
+ } // END - if
+
+ // Return translation
+ return translateNetworkTranslationName($name);
+}
+