You are here

function nivo_slider_locale_refresh in Nivo Slider 7

Same name and namespace in other branches
  1. 8 nivo_slider.module \nivo_slider_locale_refresh()

Update / create translation source for user defined slide strings.

Parameters

$slides: An array of slider slides.

2 calls to nivo_slider_locale_refresh()
nivo_slider_i18n_string_refresh in ./nivo_slider.module
Implements hook_i18n_string_refresh()
nivo_slider_settings_submit in ./nivo_slider_slides.admin.inc
Save settings data.
1 string reference to 'nivo_slider_locale_refresh'
nivo_slider_i18n_string_info in ./nivo_slider.module
Implements hook_i18n_string_info()

File

./nivo_slider.module, line 189
Primarily Drupal hooks.

Code

function nivo_slider_locale_refresh($slides = NULL) {
  if (!isset($slides)) {
    $slides = variable_get('nivo_slider_banner_settings', array());
  }
  foreach ($slides as $slide => $settings) {
    foreach ($settings as $setting => $value) {
      switch ($setting) {
        case 'title':
          i18n_string_update('nivo_slider:slide:' . $slide . ':title', $value);
          break;
        case 'description':
          i18n_string_update('nivo_slider:slide:' . $slide . ':description', $value['value'], array(
            'format' => $value['format'],
          ));
          break;
      }
    }
  }
}