You are here

function _resp_img_get_suffix in Responsive images and styles 7

File

./resp_img.module, line 445

Code

function _resp_img_get_suffix() {
  static $suffix = FALSE;
  if ($suffix === FALSE && isset($_COOKIE[RESP_IMG_COOKIE]) && is_numeric($_COOKIE[RESP_IMG_COOKIE])) {
    $width = $_COOKIE[RESP_IMG_COOKIE];
    $suffix = variable_get('resp_img_default_suffix', '');
    $widths = resp_img_suffix_load_all_breakpoints();
    foreach ($widths as $k => $v) {
      if ($width >= $v) {
        $suffix = $k;
        break;
      }
    }
  }
  return $suffix;
}