You are here

function ctools_content_get_defaults in Chaos Tool Suite (ctools) 7

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

Set up the default $conf for a new instance of a content type.

1 call to ctools_content_get_defaults()
ctools_content_type_new in ctools_custom_content/ctools_custom_content.module
Create callback for creating a new CTools custom content type.

File

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

Code

function ctools_content_get_defaults($plugin, $subtype) {
  if (isset($plugin['defaults'])) {
    $defaults = $plugin['defaults'];
  }
  elseif (isset($subtype['defaults'])) {
    $defaults = $subtype['defaults'];
  }
  if (isset($defaults)) {
    if (is_string($defaults) && function_exists($defaults)) {
      if ($return = $defaults($pane)) {
        return $return;
      }
    }
    elseif (is_array($defaults)) {
      return $defaults;
    }
  }
  return array();
}