Skip to content

Instantly share code, notes, and snippets.

@cyberswat
Created January 27, 2011 23:02
Show Gist options
  • Save cyberswat/799489 to your computer and use it in GitHub Desktop.
Save cyberswat/799489 to your computer and use it in GitHub Desktop.
_complex_widget_installed_instances()
<?php
/**
* Return a structured array defining the instances for this content type.
*
* This is provided as a function so that it can be used in both hook_install()
* and hook_uninstall().
*/
function _complex_widget_installed_instances() {
$types = array(t('number'), t('string'));
return array(
'source_variable' => array(
'field_name' => 'source_variable',
'label' => t('Variables'),
'widget' => array(
'type' => 'source_variable',
'settings' => array(
'summary_rows' => 2,
'types' => implode('|', $types),
),
'weight' => -4,
'module' => 'source',
),
'settings' => array('display_summary' => FALSE),
'display' => array(
'default' => array(
'label' => 'hidden',
'type' => 'source_default',
),
'teaser' => array(
'label' => 'hidden',
'type' => 'source_default',
),
),
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment