You are here

function backup_migrate_menu in Backup and Migrate 5

Same name and namespace in other branches
  1. 8.2 backup_migrate.module \backup_migrate_menu()
  2. 8.3 backup_migrate.module \backup_migrate_menu()
  3. 5.2 backup_migrate.module \backup_migrate_menu()
  4. 6.3 backup_migrate.module \backup_migrate_menu()
  5. 6 backup_migrate.module \backup_migrate_menu()
  6. 6.2 backup_migrate.module \backup_migrate_menu()
  7. 7.3 backup_migrate.module \backup_migrate_menu()
  8. 7.2 backup_migrate.module \backup_migrate_menu()

Implementation of hook_menu().

File

./backup_migrate.module, line 13
Create (manually or scheduled) and restore backups of your Drupal MySQL database with an option to exclude table data (f.e. cache_*)

Code

function backup_migrate_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/content/backup_migrate',
      'title' => t('Backup and Migrate'),
      'description' => t('Backup/restore your database or migrate data to or from another Drupal site.'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'backup_migrate_backup',
      ),
      'access' => user_access('perform backup'),
      'type' => MENU_NORMAL_ITEM,
    );
    $items[] = array(
      'path' => 'admin/content/backup_migrate/export',
      'title' => t('Backup/Export DB'),
      'description' => t('Backup the database.'),
      'callback' => '_backup_migrate_export',
      'access' => user_access('perform backup'),
      'weight' => 0,
      'type' => MENU_DEFAULT_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/content/backup_migrate/restore',
      'title' => t('Restore/Import DB'),
      'description' => t('Restore the database from a previous backup'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'backup_migrate_restore',
      ),
      'access' => user_access('restore from backup'),
      'weight' => 1,
      'type' => MENU_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/content/backup_migrate/files',
      'title' => t('Saved Backups'),
      'description' => t('View existing backup files'),
      'callback' => '_backup_migrate_list_files',
      'access' => user_access('access backup files'),
      'weight' => 2,
      'type' => MENU_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/content/backup_migrate/files/manual',
      'title' => t('Manual Backups'),
      'callback' => '_backup_migrate_list_files',
      'callback arguments' => array(
        'manual',
      ),
      'access' => user_access('access backup files'),
      'weight' => 1,
      'type' => MENU_DEFAULT_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/content/backup_migrate/files/scheduled',
      'title' => t('Scheduled Backups'),
      'callback' => '_backup_migrate_list_files',
      'callback arguments' => array(
        'scheduled',
      ),
      'access' => user_access('access backup files'),
      'weight' => 2,
      'type' => MENU_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/content/backup_migrate/schedule',
      'title' => t('Backup Schedule'),
      'description' => t('View existing backup files'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'backup_migrate_schedule',
      ),
      'access' => user_access('access backup files'),
      'weight' => 3,
      'type' => MENU_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/content/backup_migrate/restorefile',
      'title' => t('restore from backup'),
      'description' => t('Restore database from a backup file on the server'),
      'callback' => '_backup_migrate_restore_from_server',
      'access' => user_access('restore from backup'),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/content/backup_migrate/delete',
      'title' => t('Delete File'),
      'description' => t('Delete a backup file'),
      'callback' => '_backup_migrate_delete',
      'access' => user_access('delete backup files'),
      'type' => MENU_CALLBACK,
    );
  }
  return $items;
}