You are here

function imagezoom_settings_to_array in Image Zoom 7.2

Convert a settings string to an array.

2 calls to imagezoom_settings_to_array()
imagezoom_field_formatter_view in ./imagezoom.module
Implements hook_field_formatter_view().
imagezoom_gallery_field_formatter_view in modules/imagezoom_gallery/imagezoom_gallery.module
Implements hook_field_formatter_view().

File

./imagezoom.module, line 286
Provides an Image Zoom field formatter for Image fields.

Code

function imagezoom_settings_to_array($string) {
  $settings = array();
  if (!empty($string)) {
    $array = explode("\n", $string);
    foreach ($array as $option) {
      $parts = explode(':', $option);
      if (sizeof($parts) == 2) {
        $key = trim($parts[0]);
        $value = trim($parts[1]);
        $settings[$key] = $value;
      }
    }
  }
  return $settings;
}