You are here

function _block_class_styles_update_entity_setting in Block Class Styles 7.2

Callback to update the setting of a an entity

Parameters

$entity_type string:

$bundle_type string:

$value mixed:

Related topics

1 string reference to '_block_class_styles_update_entity_setting'
block_class_styles_menu in ./block_class_styles.module
Implements hook_menu().

File

./block_class_styles.admin.inc, line 234
Administration page callbacks for the block_class_styles module.

Code

function _block_class_styles_update_entity_setting($entity_type, $bundle_type, $value) {
  switch ($entity_type) {
    case 'bean':
      $bundle_types = _block_class_styles_bean_bundles();
      $key = array_search($bundle_type, $bundle_types);
      if ($key !== FALSE && !$value) {
        unset($bundle_types[$key]);
        variable_set('block_class_styles_beans', $bundle_types);
        $info = entity_get_info('bean');
        drupal_set_message(t('Removed %title from %bundle forms. To re-enable, visit the <a href="!url">settings page</a>.', array(
          '%title' => variable_get('block_class_styles_fs_title', BLOCK_CLASS_STYLES_FS_TITLE),
          '%bundle' => $info['bundles'][$bundle_type]['label'],
          '!url' => url(BLOCK_CLASS_STYLES_PATH_SETTINGS),
        )));
      }
  }
  drupal_goto();
}