function simpleads_update_7002 in SimpleAds 7
Rearrange SimleAds fields.
File
- ./
simpleads.updates.inc, line 268 - SimpleAds Updates.
Code
function simpleads_update_7002(&$sandbox) {
$t = get_t();
user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array(
'count ad impressions',
'count ad clicks',
));
$instance = array(
'field_name' => 'field_ad_flash',
'entity_type' => 'node',
'label' => $t('Ad Flash'),
'bundle' => 'simpleads',
'description' => st('Upload Flash file for this Ad.'),
'required' => FALSE,
'settings' => array(
'file_directory' => 'field/flash',
'file_extensions' => 'swf',
'max_filesize' => '',
'max_resolution' => '',
'min_resolution' => '',
'alt_field' => FALSE,
'title_field' => '',
),
'widget' => array(
'type' => 'file_generic',
'settings' => array(),
'weight' => -1,
),
'display' => array(
'default' => array(
'label' => 'hidden',
'type' => 'file_default',
'weight' => -1,
),
'teaser' => array(
'label' => 'hidden',
'type' => 'file_default',
'weight' => -1,
),
),
);
field_update_instance($instance);
$instance = array(
'field_name' => 'field_ad_url',
'entity_type' => 'node',
'bundle' => 'simpleads',
'label' => $t('URL Address'),
'required' => FALSE,
'widget' => array(
'type' => 'text_textfield',
'settings' => array(
'size' => 60,
),
'weight' => 1,
),
'settings' => array(
'text_processing' => 0,
),
'display' => array(
'default' => array(
'label' => 'above',
'type' => 'text_default',
'settings' => array(),
),
),
);
field_update_instance($instance);
}