2020-08-15 17:39:00 +02:00
< ? php
/**
* @ file
2020-08-18 14:29:35 +02:00
* General functions for the farmOS installation profile .
2020-08-15 17:39:00 +02:00
*/
/**
* Define farmOS modules that can be installed .
*
* @ return array
2020-12-08 12:41:37 +01:00
* Returns an array with three sub - arrays : 'base' , 'default' and 'optional' .
* Base modules will always be installed , but can be uninstalled . Default and
* optional modules will appear as options during farmOS installation and in
* a form available to admins . During initial farmOS installation , default
* modules will be selected by default , and optional modules will require the
* user to select them for installation .
2020-08-15 17:39:00 +02:00
*/
function farm_modules () {
return [
2020-12-08 12:41:37 +01:00
'base' => [
2021-03-18 15:47:40 +01:00
'farm_api' => t ( 'farmOS API' ),
'farm_login' => t ( 'Login with username or email.' ),
'farm_settings' => t ( 'farmOS Settings forms' ),
2023-08-09 23:47:38 +02:00
'farm_setup' => t ( 'farmOS Setup pages' ),
2021-03-18 15:47:40 +01:00
'farm_ui' => t ( 'farmOS UI' ),
2021-09-16 12:07:11 +02:00
'farm_update' => t ( 'farmOS Update' ),
2020-12-08 12:41:37 +01:00
],
2020-08-15 17:39:00 +02:00
'default' => [
2020-10-06 15:55:50 +02:00
'farm_land' => t ( 'Land assets' ),
2020-09-30 16:58:04 +02:00
'farm_plant' => t ( 'Plant assets' ),
'farm_animal' => t ( 'Animal assets' ),
'farm_equipment' => t ( 'Equipment assets' ),
2020-10-06 15:55:50 +02:00
'farm_structure' => t ( 'Structure assets' ),
'farm_water' => t ( 'Water assets' ),
2020-08-15 17:39:00 +02:00
'farm_activity' => t ( 'Activity logs' ),
'farm_observation' => t ( 'Observation logs' ),
2020-09-27 20:07:46 +02:00
'farm_seeding' => t ( 'Seeding logs' ),
2020-08-15 17:39:00 +02:00
'farm_input' => t ( 'Input logs' ),
'farm_harvest' => t ( 'Harvest logs' ),
2020-09-27 20:07:46 +02:00
'farm_maintenance' => t ( 'Maintenance logs' ),
2021-02-24 22:37:52 +01:00
'farm_quantity_standard' => t ( 'Standard quantity type' ),
2020-10-17 13:30:25 +02:00
'farm_role_roles' => t ( 'Default roles: Manager, Worker, Viewer' ),
2021-03-18 23:20:01 +01:00
'farm_land_types' => t ( 'Default land types: Property, Field, Bed, Paddock, Landmark' ),
2020-10-14 05:37:46 +02:00
'farm_structure_types' => t ( 'Default structure types: Building, Greenhouse' ),
2020-08-15 17:39:00 +02:00
],
'optional' => [
2021-03-18 23:19:21 +01:00
'farm_inventory' => t ( 'Inventory management' ),
2022-04-15 15:00:14 +02:00
'farm_material' => t ( 'Material assets' ),
2021-08-17 20:52:54 +02:00
'farm_seed' => t ( 'Seed assets' ),
2024-01-30 19:37:44 +01:00
'farm_product' => t ( 'Product assets' ),
2020-09-30 16:58:04 +02:00
'farm_sensor' => t ( 'Sensor assets' ),
'farm_compost' => t ( 'Compost assets' ),
'farm_group' => t ( 'Group assets' ),
2020-08-15 17:39:00 +02:00
'farm_transplanting' => t ( 'Transplanting logs' ),
'farm_lab_test' => t ( 'Lab test logs' ),
2021-05-26 17:02:44 +02:00
'farm_birth' => t ( 'Birth logs' ),
2020-08-15 17:39:00 +02:00
'farm_medical' => t ( 'Medical logs' ),
2023-08-16 17:33:38 +02:00
'farm_import_csv' => t ( 'CSV importer' ),
2024-01-25 12:50:58 +01:00
'farm_export_kml' => t ( 'KML exporter' ),
2021-08-31 21:07:40 +02:00
'farm_import_kml' => t ( 'KML asset importer' ),
2024-01-17 21:28:27 +01:00
'farm_map_mapbox' => t ( 'Mapbox map layers: Satellite, Outdoors' ),
2023-10-30 22:51:58 +01:00
'farm_api_default_consumer' => t ( 'Default API Consumer' ),
2021-12-20 20:18:21 +01:00
'farm_fieldkit' => t ( 'Field Kit integration' ),
2022-01-06 21:07:20 +01:00
'farm_l10n' => t ( 'Translation/localization features' ),
2023-08-26 18:11:50 +02:00
'farm_role_account_admin' => t ( 'Account Admin role' ),
2020-08-15 17:39:00 +02:00
],
];
}
2021-02-26 00:14:10 +01:00
/**
* Implements hook_form_BASE_FORM_ID_alter () .
*/
function farm_form_update_manager_update_form_alter ( & $form , & $form_state , $form_id ) {
// Disable updating through the UI.
// @see https://www.drupal.org/project/farm/issues/3136140
$message = t ( 'Performing updates through this interface is disabled by farmOS. To update modules, use a packaged release of farmOS to ensure that any necessary patches are applied to dependencies.' );
\Drupal :: messenger () -> addError ( $message );
$form [ 'actions' ][ '#access' ] = FALSE ;
}