You are here

function flag_lists_update_8003 in Flag Lists 8

Same name and namespace in other branches
  1. 4.0.x flag_lists.install \flag_lists_update_8003()

Update the flag list template to include token for flagging collection names.

File

./flag_lists.install, line 111
Contains install and updates for Flag Lists module.

Code

function flag_lists_update_8003() {
  $config_factory = \Drupal::configFactory();
  $config = $config_factory
    ->getEditable('flag.flag.flag_list_template_1');
  $config
    ->set('flag_short', 'Add this item to the [flagging_collection:title] list');
  $config
    ->set('flag_long', 'Add this to your flag list');
  $config
    ->set('flag_message', 'Added to the flag list');
  $config
    ->set('unflag_short', 'Remove this item from the [flagging_collection:title] list');
  $config
    ->set('unflag_long', 'Remove this item from your flag list');
  $config
    ->set('unflag_message', 'Removed from the flag list');
  $config
    ->save(TRUE);
  $message = 'Updated the flag list template with tokens. Please review the your other flag list related flags as well.';
  return $message;
}