You are here

function panels_allowed_layouts::api_save in Panels 6.2

Same name and namespace in other branches
  1. 5.2 includes/common.inc \panels_allowed_layouts::api_save()

Use panels_allowed_layouts::module_name to generate a variable for variable_set(), in which a serialized version of $this will be stored.

Does nothing if panels_allowed_layouts::module_name is not set.

IMPORTANT NOTE: if you use variable_get() in a custom client module save() method, you MUST wrap $this in serialize(), then unserialize() what you get from variable_get(). Failure to do so will result in an incomplete object. The following code will work:


 $allowed_layouts = unserialize(variable_get('your_variable_name', serialize(''));

If you don't serialize the second parameter of variable_get() and the variable name you provide can't be found, an E_STRICT warning will be generated for trying to unserialize an entity that has not been serialized.

File

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

Class

panels_allowed_layouts
Class definition for the allowed layouts governing structure.

Code

function api_save() {
  if (!is_null($this->module_name)) {
    variable_set($this->module_name . "_allowed_layouts", serialize($this));
  }
}