You are here

function panels_common_get_allowed_layout_object in Panels 6.3

Same name and namespace in other branches
  1. 7.3 includes/common.inc \panels_common_get_allowed_layout_object()

Get the allowed layout object for the given module.

2 calls to panels_common_get_allowed_layout_object()
panels_common_allowed_layouts_form in includes/common.inc
The FAPI code for generating an 'allowed layouts' selection form.
panels_common_get_allowed_layouts in includes/common.inc
Get the allowed layouts for the given module.

File

includes/common.inc, line 425
Functions used by more than one panels client module.

Code

function panels_common_get_allowed_layout_object($module_name) {
  $allowed_layouts = unserialize(variable_get($module_name . "_allowed_layouts", serialize('')));

  // if no parameter was provided, or the variable_get failed
  if (!$allowed_layouts) {

    // still no dice. simply creates a dummy version where all layouts
    // are allowed.
    $allowed_layouts = new panels_allowed_layouts();
    $allowed_layouts->allow_new = TRUE;
    $allowed_layouts->module_name = $module_name;
  }

  // sanitize allowed layout listing; this is redundant if the
  // $allowed_layouts param was null, but the data is cached anyway
  $allowed_layouts
    ->sync_with_available();
  return $allowed_layouts;
}