function hook_admin_duplicate_year
Search API
This hook allows other modules to act when we are using the admin operation of duplicating an entire catalog year's worth of data.
This is called AFTER the core code has run. We expect $source_year and $destination_year to be 4-digit years. Ex: 2021 and 2022.
$_SESSION['admin_duplicate_year'] will have the courses, groups, and degrees we have worked on as well, which other modules may find useful, or wish to make changes to.
3 string references to 'hook_admin_duplicate_year'
- admin.module in modules/
admin/ admin.module - The administrative configurations for FlightPath.
- admin_duplicate_year_form_submit in modules/
admin/ admin.module - This function will set up a batch operation so we can duplicate an entire year with less chance of time or memory running out.
- admin_duplicate_year_perform_batch_operation in modules/
admin/ admin.module - The is the batch operation to duplicate from $old_year to $new_year
File
- includes/
hook.api.php, line 34 - Lists all available hooks within FlightPath's core code.
Code
function hook_admin_duplicate_year($source_year, $destination_year) {
// $_SESSION['admin_duplicate_year'] will have the courses, groups, and degrees we have worked on as well,
// which other modules may find useful, or wish to make changes to.
// Ex: $_SESSION['admin_duplicate_year']['courses'] ... ['groups'] ... ['degrees']
// Delete relevant data with catalog_year = destination_year
// ...
// Copy relevant data FROM catalog year source_year to destination_year
// ...
}
