public static function boxes_box::factory

cis7 boxes_box.inc public static boxes_box::factory($plugin_key, $values)
cle7 boxes_box.inc public static boxes_box::factory($plugin_key, $values)
elmsmedia7 boxes_box.inc public static boxes_box::factory($plugin_key, $values)
icor7 boxes_box.inc public static boxes_box::factory($plugin_key, $values)
meedjum_blog7 boxes_box.inc public static boxes_box::factory($plugin_key, $values)
mooc7 boxes_box.inc public static boxes_box::factory($plugin_key, $values)

Instantiate, populate and return a box object.

Parameters

$plugin_key:

$values: An array with at least a plugin_key key identifying the plugin class to use for instantiating this box.

2 calls to boxes_box::factory()
boxes_box::load in sites/all/modules/ulmus/boxes/plugins/boxes_box.inc
Load existing box by its unique identifier $delta.
boxes_factory in sites/all/modules/ulmus/boxes/boxes.module
Instantiate box object.

File

sites/all/modules/ulmus/boxes/plugins/boxes_box.inc, line 43

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 factory($plugin_key, $values) {
  ctools_include('plugins');
  if ($class = ctools_plugin_load_class('boxes', 'plugins', $plugin_key, 'handler')) {

    // While we actually prefer to get objects, we need to allow for either,
    // so we convert it all to arrays.
    if (is_object($values)) {
      $values = (array) $values;
    }

    $box = new $class();
    $box->plugin_key = $plugin_key;

    foreach ($box as $key => $value) {
      if (isset($values[$key])) {
        $box->$key = $values[$key];
      }
    }
    foreach ($box->options_defaults() as $key => $value) {
      if (isset($values[$key])) {
        $box->options[$key] = $values[$key];
      }
    }
    return $box;
  }
  return FALSE;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.