You are here

function _photos_json in Album Photos 6.2

Same name and namespace in other branches
  1. 7.3 photos.module \_photos_json()
1 call to _photos_json()
photos_data_sub_block in inc/photos.data.inc

File

./photos.module, line 1433

Code

function _photos_json($type, $v) {
  if (function_exists('json_decode')) {
    if ($type == 'en') {
      return json_encode($v);
    }
    else {
      return json_decode($v);
    }
  }
  else {
    require_once 'php/json-php4.php';
    $json = new Services_JSON();
    if ($type == 'en') {
      return $json
        ->encode($v);
    }
    else {
      return $json
        ->decode($v);
    }
  }
}