You are here

function slickgrid_views_plugin::is_editable in Slickgrid 6

1 call to slickgrid_views_plugin::is_editable()
slickgrid_views_plugin::options_form in ./slickgrid_views_plugin.inc
Add settings for the particular slickgrid.

File

./slickgrid_views_plugin.inc, line 319

Class

slickgrid_views_plugin
Extending the view_plugin_style class to provide a slickgrid style.

Code

function is_editable($handler, $field_type) {

  // Is this a taxonomy field?
  if (in_array($handler->table, array(
    'term_node',
    'term_data',
    'vocabulary',
  ))) {

    // If it is a taxonomy field, it is only editable if it has one VID selected
    if (!(is_array($handler->options['vids']) && slickgrid_taxonomy_field_get_vid($handler))) {
      return FALSE;
    }
  }

  // Is this a locked field?
  // NID & node type should never be editable. Are there any other fields that need to be locked?
  if (in_array($field_type, array(
    'node_nid',
    'node_type',
  ))) {
    return FALSE;
  }
  return TRUE;
}