function boxes_load_plugin_class in Boxes 7.2
Load a widget class
Parameters
$plugin_key string: the key fo the plugin
Return value
BoxTypePluginInterface | Boolean An instance of the boxes class or FALSE if not loaded
6 calls to boxes_load_plugin_class()
- Box::loadUp in includes/
boxes.core.inc - This is a work around for version of PDO that call __construct() before it loads up the object with values from the DB.
- Box::setUp in includes/
boxes.core.inc - Set up the object instance on construction or unserializiation.
- BoxEntityAPIController::setPlugin in includes/
boxes.core.inc - BoxesTestPlugins::testBoxesLoadPlugin in ./
boxes.test - Test loading of the plugin
- boxes_load_plugin_class_all in ./
boxes.module - Load all widget classes
1 string reference to 'boxes_load_plugin_class'
- boxes_reset in ./
boxes.module - Reset the static variables and caches
File
- ./
boxes.module, line 338
Code
function boxes_load_plugin_class($plugin_key = NULL) {
$cache =& drupal_static(__FUNCTION__);
if (!isset($cache[$plugin_key])) {
ctools_include('plugins');
$class = ctools_plugin_load_class('boxes', 'types', $plugin_key, 'handler');
if ($class && boxes_check_plugin_class($class)) {
$cache[$plugin_key] = new $class(boxes_fetch_plugin_info($plugin_key));
}
}
return isset($cache[$plugin_key]) ? $cache[$plugin_key] : FALSE;
}