You are here

function ad_menu_add_global_settings in Advertisement 7

Same name and namespace in other branches
  1. 6.3 ad.module \ad_menu_add_global_settings()
  2. 6 ad.module \ad_menu_add_global_settings()
  3. 6.2 ad.module \ad_menu_add_global_settings()

Load settings for all ad modules. Those modules, who don't have their settings form, will get a standard one.

1 call to ad_menu_add_global_settings()
ad_menu in ./ad.module
Implementation of hook_menu().

File

./ad.module, line 1356

Code

function ad_menu_add_global_settings(&$menu_items) {
  $adtypes = ad_get_types();
  foreach ($adtypes as $type => $name) {

    // Ad type global settings.
    $settings = 'ad_' . $type . '_global_settings';
    $file = 'ad_image.module';
    if (!function_exists($settings)) {
      $settings = 'ad_no_global_settings';
      $file = 'ad.admin.inc';
    }
    $menu_items['admin/content/ad/configure/' . $type] = array(
      'title' => $name,
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        $settings,
      ),
      'access arguments' => array(
        'administer advertisements',
      ),
      'type' => MENU_LOCAL_TASK,
      'weight' => 2,
      'file' => 'ad.admin.inc',
    );
  }
}