You are here

function boxes_admin_ui_get_types in Boxes 7.2

Get The Bean Types

1 call to boxes_admin_ui_get_types()
boxes_admin_ui_boxes_types in boxes_admin_ui/boxes_admin_ui.module
Implements hook_boxes_types().
1 string reference to 'boxes_admin_ui_get_types'
BoxCustom::save in boxes_admin_ui/plugins/custom.inc
Save the record to the database

File

boxes_admin_ui/boxes_admin_ui.module, line 104
Boxes Admin UI

Code

function boxes_admin_ui_get_types() {
  $box_types =& drupal_static(__FUNCTION__);
  if (empty($box_types)) {
    $cache = cache_get('bean_types');
    if (empty($cache->data)) {

      // In install profiles, this function can get called before Drupal's created
      // our database tables (see http://drupal.org/node/1179420), so don't crash
      // Drupal installation by trying to get box types; if we did, we'd query a
      // nonexistent table.
      if (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'install' && drupal_get_installed_schema_version('boxes_admin_ui', TRUE) == SCHEMA_UNINSTALLED) {
        $box_types = array();
      }
      else {
        ctools_include('export');
        $box_types = ctools_export_load_object('box_type');
        cache_set('box_types', $box_types);
      }
    }
    else {
      $box_types = $cache->data;
    }
  }
  return $box_types;
}