You are here

function ctools_content_editable in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 includes/content.inc \ctools_content_editable()

Determine if a content type can be edited or not.

Some content types simply have their content and no options. This function lets a UI determine if it should display an edit link or not.

File

includes/content.inc, line 346
Contains the tools to handle pluggable content that can be used by other applications such as Panels or Dashboard.

Code

function ctools_content_editable($type, $subtype, $conf) {
  if (empty($type['edit form']) && empty($subtype['edit form'])) {
    return FALSE;
  }
  $function = FALSE;
  if (!empty($subtype['check editable'])) {
    $function = ctools_plugin_get_function($subtype, 'check editable');
  }
  elseif (!empty($type['check editable'])) {
    $function = ctools_plugin_get_function($type, 'check editable');
  }
  if ($function) {
    return $function($type, $subtype, $conf);
  }
  return TRUE;
}