redhen_activity.install in RedHen CRM 7
File
modules/redhen_activity/redhen_activity.install
View source
<?php
function redhen_activity_install() {
$instance = array(
'field_name' => MESSAGE_FIELD_MESSAGE_TEXT,
'bundle' => 'redhen_activity_message',
'entity_type' => 'message_type',
'label' => t('Message text'),
'description' => t('This is the text of all messages of this type.'),
'required' => TRUE,
'settings' => array(
'text_processing' => 1,
'message_text' => TRUE,
),
);
if ($existing_instance = field_info_instance($instance['entity_type'], $instance['field_name'], $instance['bundle'])) {
field_update_instance($instance);
}
else {
field_create_instance($instance);
}
if (!filter_format_load('redhen_activity_message')) {
$format = (object) array(
'format' => 'redhen_activity_message',
'name' => 'RedHen Activity Message',
'weight' => 0,
'filters' => array(
'filter_html' => array(
'weight' => 1,
'status' => 1,
),
),
);
filter_format_save($format);
}
}