]> git.mxchange.org Git - mailer.git/commitdiff
Added function sendHttpRequest() which will help ext-network for simplified sending...
authorRoland Häder <roland@mxchange.org>
Sat, 27 Aug 2011 02:43:24 +0000 (02:43 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 27 Aug 2011 02:43:24 +0000 (02:43 +0000)
inc/http-functions.php
inc/language/network_de.php
templates/de/html/admin/admin_list_networks.tpl

index 36f0296eab2ae6045f84da8abc0f529ab6ad98c7..b65729810526fee9dc0651d8e9b84b0eec65940c 100644 (file)
@@ -130,14 +130,42 @@ function removeHttpHostNameFromUrl ($url) {
        return $url;
 }
 
-// Send a HEAD request
+// Sends a HTTP request (GET, POST, HEAD are currently supported)
+function sendHttpRequest ($requestType, $baseUrl, $requestData = array(), $removeHeader = false) {
+       // Init response
+       $response = array();
+
+       // Start "detecting" the request type
+       switch ($requestType) {
+               case 'HEAD': // Send a HTTP/1.1 HEAD request
+                       $response = sendHeadRequest($baseUrl, $requestData);
+                       break;
+
+               case 'GET': // Send a HTTP/1.1 GET request
+                       $response = sendGetRequest($baseUrl, $requestData, $removeHeader);
+                       break;
+
+               case 'POST': // Send a HTTP/1.1 POST request
+                       $response = sendPostRequest($baseUrl, $requestData, $removeHeader);
+                       break;
+
+               default: // Unsupported HTTP request, this is really bad and needs fixing
+                       debug_report_bug(__FUNCTION__, __LINE__, 'Unsupported request detected. requestType=' . $requestType . ',baseUrl=' . $baseUrl . ',requestData()=' . count($requestData));
+                       break;
+       } // END - switch
+
+       // Return response
+       return $response;
+}
+
+// Sends a HEAD request
 function sendHeadRequest ($baseUrl, $requestData = array()) {
        // Generate full GET URL
        $getUrl = generateGetUrlFromBaseUrlData($baseUrl, $requestData);
 
        // Do we have http[s]:// in front of the URL?
        if (isFullQualifiedUrl($getUrl)) {
-               // Remove http[s]://<hostname> from url
+               // Remove http[s]://<hostname> from URL
                $getUrl = removeHttpHostNameFromUrl($getUrl);
        } elseif (substr($getUrl, 0, 1) != '/') {
                // Prepend a slash
index 17c0379b08dc9dd7c470312a902d3c6d359575b3..bdb6f284d623c3c5fc83c19bf37aa27ddeb52703 100644 (file)
@@ -171,6 +171,7 @@ addMessages(array(
        'ADMIN_NETWORK_TYPES_PAGEPEEL' => "Page-Peel",
        'ADMIN_NETWORK_TYPES_TRAFFIC' => "Traffic", // These are visitor exchanges like ext-surfbar!
        // - Sponsor networks
+       'ADMIN_LIST_NEWORK_DATA_TITLE' => "Auflistung der Grunddaten aller Werbenetzwerke",
        'ADMIN_NETWORK_NONE_SUPPORTED' => "Es sind noch keine Werbenetzwerke eingerichtet.",
        'ADMIN_NETWORK_SHORT_NAME' => "Kurzname:",
        'ADMIN_NETWORK_TITLE' => "Linktitel:",
index 64fa0f10963c1f839d99abee4cacc95c8ed095cc..3a5c50c4917a03036cb89f49d8f75ffa4d8cf548 100644 (file)
@@ -1,31 +1,36 @@
 <div align="center">
 <form accept-charset="UTF-8" action="{%url=modules.php?module=admin&amp;what=list_networks&amp;do=handle_network%}" method="post">
 <table border="0" cellspacing="0" cellpadding="0" class="table dashed">
-       <tr>
-               <td height="25" colspan="3" class="header_column bottom right separator">&nbsp;</td>
-               <td colspan="2" class="header_column bottom right" align="center">
-                       <strong>{--ADMIN_NETWORK_SEPARATOR--}</strong>
-               </td>
-               <td colspan="3" class="header_column bottom separator">&nbsp;</td>
-       </tr>
-       <tr>
-               <td align="center" class="header_column bottom right" height="25"><strong>{--ID_SELECT--}</strong></td>
-               <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_SHORT_NAME--}</strong></td>
-               <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_REFERRAL_LINK--}</strong></td>
-               <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_DATA_SEPARATOR2--}</strong></td>
-               <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_ROW_SEPARATOR2--}</strong></td>
-               <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_REQUEST_TYPE--}</strong></td>
-               <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_CHARSET--}</strong></td>
-               <td align="center" class="header_column bottom"><strong>{--ADMIN_NETWORK_REQUIRE_ID_CARD--}</strong></td>
-       </tr>
-       $content
-       <tr>
-               <td colspan="8" class="table_footer">
-                       <input type="reset" class="form_reset" value="{--UNDO_SELECTIONS--}" />
-                       <input type="submit" class="form_submit" name="edit" value="{--ADMIN_ACTION_EDIT_SUBMIT--}" />
-                       <input type="submit" class="form_delete" name="delete" value="{--ADMIN_ACTION_DELETE_SUBMIT--}" />
-               </td>
-       </tr>
+<tr>
+       <td colspan="8" class="table_header">
+               <strong>{--ADMIN_LIST_NEWORK_DATA_TITLE--}</strong>
+       </td>
+</tr>
+<tr>
+       <td height="25" colspan="3" class="header_column bottom right separator">&nbsp;</td>
+       <td colspan="2" class="header_column bottom right" align="center">
+               <strong>{--ADMIN_NETWORK_SEPARATOR--}</strong>
+       </td>
+       <td colspan="3" class="header_column bottom separator">&nbsp;</td>
+</tr>
+<tr>
+       <td align="center" class="header_column bottom right" height="25"><strong>{--ID_SELECT--}</strong></td>
+       <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_SHORT_NAME--}</strong></td>
+       <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_REFERRAL_LINK--}</strong></td>
+       <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_DATA_SEPARATOR2--}</strong></td>
+       <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_ROW_SEPARATOR2--}</strong></td>
+       <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_REQUEST_TYPE--}</strong></td>
+       <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_CHARSET--}</strong></td>
+       <td align="center" class="header_column bottom"><strong>{--ADMIN_NETWORK_REQUIRE_ID_CARD--}</strong></td>
+</tr>
+$content
+<tr>
+       <td colspan="8" class="table_footer">
+               <input type="reset" class="form_reset" value="{--UNDO_SELECTIONS--}" />
+               <input type="submit" class="form_submit" name="edit" value="{--ADMIN_ACTION_EDIT_SUBMIT--}" />
+               <input type="submit" class="form_delete" name="delete" value="{--ADMIN_ACTION_DELETE_SUBMIT--}" />
+       </td>
+</tr>
 </table>
 </form>