You are here

function opigno_messaging_update_8009 in Opigno messaging 8

Update private messages views header link with base path.

File

./opigno_messaging.install, line 120
Install, update and uninstall functions for the Opigno Messaging module.

Code

function opigno_messaging_update_8009() {
  $config_path = drupal_get_path('module', 'opigno_messaging') . '/config/optional';
  $storage = new FileStorage($config_path);
  $config_storage = \Drupal::service('config.storage');
  $data = $storage
    ->read('views.view.private_message');
  $data['display']['default']['display_options']['header']['area_text_custom']['content'] = '<a class="new-message" href="[opigno:url-with-slash]private-message/create">New message</a><h2 class="messages">Messages</h2>';
  $config_storage
    ->write('views.view.private_message', $data);
}