You are here

function panels_mini_sanitize in Panels 5.2

Same name and namespace in other branches
  1. 6.2 panels_mini/panels_mini.module \panels_mini_sanitize()

Sanitize a mini panel, to guarantee certain data is as we believe it will be.

3 calls to panels_mini_sanitize()
panels_mini_load in panels_mini/panels_mini.module
Load a mini panel.
panels_mini_load_all in panels_mini/panels_mini.module
Fetch all mini panels in the system.
panels_mini_save in panels_mini/panels_mini.module
Save a mini panel.

File

panels_mini/panels_mini.module, line 990
panels_mini.module

Code

function panels_mini_sanitize($panel_mini) {
  foreach (array(
    'contexts',
    'relationships',
    'requiredcontexts',
  ) as $id) {
    if (!is_array($panel_mini->{$id})) {
      $panel_mini->{$id} = array();
    }
  }
  return $panel_mini;
}