You are here

function _google_admanager_get_ad_slots in DFP Small Business (Google Ad Manager) 6.3

Same name and namespace in other branches
  1. 6 google_admanager.module \_google_admanager_get_ad_slots()
  2. 6.2 google_admanager.module \_google_admanager_get_ad_slots()
  3. 7.2 google_admanager.module \_google_admanager_get_ad_slots()

Get all ad slots each correspond to block (with delta/name).

3 calls to _google_admanager_get_ad_slots()
google_admanager_admin_settings_form_submit in ./google_admanager.admin.inc
Implementation of hook_admin_settings_form_submit().
google_admanager_block in ./google_admanager.module
Implementation of hook_block().
_google_admanager_block in ./google_admanager.admin.inc
Callback for hook_block().

File

./google_admanager.module, line 354

Code

function _google_admanager_get_ad_slots() {
  $ad_slots = array();
  $list = variable_get('google_admanager_ad_slots', array());
  foreach ($list as $ad_slot) {
    if (!empty($ad_slot['name'])) {
      $ad_slots[md5(trim($ad_slot['name']))] = $ad_slot['name'];
    }
  }

  // sorting the list for easy reference
  asort($ad_slots);
  return $ad_slots;
}