You are here

function breakpoints_menu in Breakpoints 7

Implements hook_menu().

File

./breakpoints.module, line 138
Breakpoints @todo: provide button to reload breakpoints from theme

Code

function breakpoints_menu() {
  $items = array();

  // @todo: link to all breakpoints and a list of all groups
  // cf theme settings page
  $items['admin/config/media/breakpoints'] = array(
    'title' => 'Breakpoints',
    'description' => 'Manage breakpoints',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'breakpoints_admin_breakpoints',
    ),
    'access arguments' => array(
      'administer breakpoints',
    ),
    'file' => 'breakpoints.admin.inc',
  );
  $items['admin/config/media/breakpoints/create_style'] = array(
    'title' => 'Add responsive style',
    'description' => 'Add a responsive image style',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'breakpoints_add_style_form',
    ),
    'access arguments' => array(
      'administer breakpoints',
    ),
    'file' => 'breakpoints.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 30,
  );
  $items['admin/config/media/breakpoints/multipliers'] = array(
    'title' => 'Multipliers',
    'description' => 'Manage multipliers',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'breakpoints_multipliers_form',
    ),
    'access arguments' => array(
      'administer breakpoints',
    ),
    'file' => 'breakpoints.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 20,
  );
  $items['admin/config/media/breakpoints/settings'] = array(
    'title' => 'Settings',
    'description' => 'Manage breakpoint settings',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'breakpoints_admin_settings_form',
    ),
    'access arguments' => array(
      'administer breakpoints',
    ),
    'file' => 'breakpoints.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 30,
  );
  $items['admin/config/media/breakpoints/multipliers/%/delete'] = array(
    'title' => '',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'breakpoints_admin_multiplier_delete_form',
      5,
    ),
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer breakpoints',
    ),
    'file' => 'breakpoints.admin.inc',
    'weight' => 15,
  );
  $items['admin/config/media/breakpoints/groups'] = array(
    'title' => 'Groups',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => 10,
  );
  $items['admin/config/media/breakpoints/groups/global'] = array(
    'title' => 'All breakpoints',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -1,
  );
  $items['admin/config/media/breakpoints/groups/add'] = array(
    'title' => 'Add a new group',
    'page arguments' => array(
      'breakpoints_admin_breakpoint_group_edit_form',
    ),
    'type' => MENU_LOCAL_TASK,
    'access arguments' => array(
      'administer breakpoints',
    ),
    'file' => 'breakpoints.admin.inc',
    'weight' => 99,
  );
  $items['admin/config/media/breakpoints/groups/import'] = array(
    'title' => 'Import a new group',
    'page arguments' => array(
      'breakpoints_admin_breakpoint_group_import_form',
    ),
    'type' => MENU_LOCAL_TASK,
    'access arguments' => array(
      'administer breakpoints',
    ),
    'file' => 'breakpoints.admin.inc',
    'weight' => 99,
  );
  $items['admin/config/media/breakpoints/groups/import-breakpoint'] = array(
    'title' => 'Import a new breakpoint',
    'page arguments' => array(
      'breakpoints_admin_breakpoint_import_form',
    ),
    'type' => MENU_LOCAL_TASK,
    'access arguments' => array(
      'administer breakpoints',
    ),
    'file' => 'breakpoints.admin.inc',
    'weight' => 99,
  );
  $items['admin/config/media/breakpoints/%/%'] = array(
    'title' => '',
    'page callback' => 'breakpoints_admin_breakpoint_actions_page',
    'page arguments' => array(
      '',
      4,
      5,
    ),
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer breakpoints',
    ),
    'file' => 'breakpoints.admin.inc',
    'weight' => 15,
  );
  $breakpoint_groups = breakpoints_breakpoint_group_load_all();
  foreach ($breakpoint_groups as $breakpoint_group_name => $breakpoint_group) {
    if (!empty($breakpoint_group->machine_name)) {
      $items['admin/config/media/breakpoints/groups/' . $breakpoint_group->machine_name] = array(
        'title' => $breakpoint_group->name,
        'page arguments' => array(
          'breakpoints_admin_breakpoints',
          $breakpoint_group->machine_name,
        ),
        'type' => MENU_LOCAL_TASK,
        'access arguments' => array(
          'administer breakpoints',
        ),
        'file' => 'breakpoints.admin.inc',
        'weight' => 15,
      );
      $items['admin/config/media/breakpoints/groups/' . $breakpoint_group->machine_name . '/edit'] = array(
        'title' => 'Edit ' . $breakpoint_group->name,
        'page arguments' => array(
          'breakpoints_admin_breakpoint_group_edit_form',
          $breakpoint_group->machine_name,
        ),
        'type' => MENU_CALLBACK,
        'access arguments' => array(
          'administer breakpoints',
        ),
        'file' => 'breakpoints.admin.inc',
        'weight' => 15,
      );
      $items['admin/config/media/breakpoints/groups/' . $breakpoint_group->machine_name . '/delete'] = array(
        'title' => 'Delete ' . $breakpoint_group->name,
        'page arguments' => array(
          'breakpoints_admin_breakpoint_group_delete_form',
          $breakpoint_group->machine_name,
        ),
        'type' => MENU_CALLBACK,
        'access arguments' => array(
          'administer breakpoints',
        ),
        'file' => 'breakpoints.admin.inc',
        'weight' => 15,
      );
      $items['admin/config/media/breakpoints/groups/' . $breakpoint_group->machine_name . '/export'] = array(
        'title' => 'Export ' . $breakpoint_group->name,
        'page arguments' => array(
          'breakpoints_admin_breakpoint_group_export_form',
          $breakpoint_group->machine_name,
        ),
        'type' => MENU_LOCAL_ACTION,
        'access arguments' => array(
          'administer breakpoints',
        ),
        'file' => 'breakpoints.admin.inc',
        'weight' => 15,
      );
      $items['admin/config/media/breakpoints/groups/' . $breakpoint_group->machine_name . '/duplicate'] = array(
        'title' => 'Duplicate ' . $breakpoint_group->name,
        'page arguments' => array(
          'breakpoints_admin_breakpoint_group_duplicate_form',
          $breakpoint_group->machine_name,
        ),
        'type' => MENU_CALLBACK,
        'access arguments' => array(
          'administer breakpoints',
        ),
        'file' => 'breakpoints.admin.inc',
        'weight' => 15,
      );
      $items['admin/config/media/breakpoints/groups/' . $breakpoint_group->machine_name . '/%/%'] = array(
        'title' => '',
        'page arguments' => array(
          'breakpoints_admin_breakpoint_actions_form',
          $breakpoint_group->machine_name,
          6,
          7,
        ),
        'type' => MENU_CALLBACK,
        'access arguments' => array(
          'administer breakpoints',
        ),
        'file' => 'breakpoints.admin.inc',
        'weight' => 15,
      );
    }
  }
  return $items;
}