You are here

public static function boxes_box::load in Boxes 7

Same name and namespace in other branches
  1. 6 plugins/boxes_box.inc \boxes_box::load()

Load existing box by its unique identifier $delta.

1 call to boxes_box::load()
boxes_box_load in ./boxes.module
Load a box.

File

plugins/boxes_box.inc, line 22

Class

boxes_box
Abstract base class defining a box. A boxes content plugin provides a form of options for configuring content and renders content for display.

Code

public static function load($delta, $reset = FALSE) {
  if (!isset(self::$boxes[$delta]) || $reset) {
    ctools_include('export');
    $box = ctools_export_load_object('box', 'names', array(
      $delta,
    ));
    if (!empty($box) && ($values = array_pop($box))) {
      self::$boxes[$delta] = self::factory($values->plugin_key, $values);
      self::$boxes[$delta]->new = FALSE;
    }
  }
  return isset(self::$boxes[$delta]) && get_class(self::$boxes[$delta]) != 'stdClass' ? self::$boxes[$delta] : NULL;
}