Extension ext-forced/network continued:
[mailer.git] / inc / libs / forced_functions.php
index b45c69edaeae0a58abeab8b9419f7b899c0fca1f..011621f52e97865d6ebebc6d097dd8f178eac662 100644 (file)
@@ -53,7 +53,7 @@ function doTemplateForcedAdTypeSelectionBox ($templateName, $clear = false, $def
 }
 
 // Translate the status IN/OUT
-function translateForcedAdType ($status) {
+function translateForcedAdsType ($status) {
        // Is the status null or empty?
        if (is_null($status)) {
                // Is NULL
@@ -64,10 +64,10 @@ function translateForcedAdType ($status) {
        } // END - if
 
        // Default status is unknown
-       $return = '{%message,ADMIN_FORCED_AD_TYPE_UNKNOWN=' . $status . '%}';
+       $return = '{%message,ADMIN_FORCED_ADS_TYPE_UNKNOWN=' . $status . '%}';
 
        // Construct message id
-       $messageId = 'ADMIN_FORCED_AD_TYPE_' . $status;
+       $messageId = 'ADMIN_FORCED_ADS_TYPE_' . $status;
 
        // Is it there?
        if (isMessageIdValid($messageId)) {
@@ -84,5 +84,29 @@ function getForcedPopupDataByEarningArray ($content) {
        debug_report_bug(__FUNCTION__, __LINE__, 'content=' . print_r($content, true));
 }
 
+// Generator (somewhat getter) for network type options
+function generateForcedAdsTypeOptions ($type =  NULL) {
+       // Is this cached?
+       if (!isset($GLOBALS[__FUNCTION__][$type])) {
+               // Generate output and cache it
+               $GLOBALS[__FUNCTION__][$type] = generateOptionList(
+                       '/ARRAY/',
+                       array(
+                               'BANNER',
+                               'TEXTLINK',
+                               'POPUP',
+                       ),
+                       array(),
+                       $type,
+                       '', '',
+                       array(),
+                       'translateForcedAdsType'
+               );
+       } // END - if
+
+       // Return content
+       return $GLOBALS[__FUNCTION__][$type];
+}
+
 // [EOF]
 ?>