You are here

public function GridStack::getJsonSummaryBreakpoints in GridStack 8.2

Same name and namespace in other branches
  1. 8 src/Entity/GridStack.php \Drupal\gridstack\Entity\GridStack::getJsonSummaryBreakpoints()

Returns JSON for options.breakpoints[xs|sm|md|lg|xl] keyed by indices.

Simplify and remove keys: Original: [{"x":1,"y":0,"width":2,"height":8}. Now: [[1,0,2,8].

File

src/Entity/GridStack.php, line 282

Class

GridStack
Defines the GridStack configuration entity.

Namespace

Drupal\gridstack\Entity

Code

public function getJsonSummaryBreakpoints($breakpoint = 'lg', $grids = '', $exclude_region = TRUE) {
  $grids = $grids ?: $this
    ->getBreakpointItems($breakpoint);
  if ($grids) {
    $grids = is_string($grids) ? Json::decode($grids) : $grids;
    $values = $this
      ->massageGrids($grids, $exclude_region);
    return Json::encode($values);
  }
  return '';
}