You are here

function mediafront_user_settings_submit in MediaFront 7.2

Submit handler to save all the user settings for the mediafront player.

_state

Parameters

$form:

File

modules/mediafront_user/mediafront_user.module, line 52

Code

function mediafront_user_settings_submit($form, &$form_state) {

  // Store the settings in the user object.
  $account = user_load($form_state['values']['account']);
  if ($account && $account->uid) {
    user_save($account, array(
      'data' => array(
        'mediafront' => array(
          'autoplay' => $form_state['values']['autoplay'],
        ),
      ),
    ));
    drupal_set_message('Your custom media player settings have been saved.');
  }
}