function views_slideshow_xtra_example_install in Views Slideshow Xtra 7.2
Same name and namespace in other branches
- 7.3 views_slideshow_xtra_example/views_slideshow_xtra_example.install \views_slideshow_xtra_example_install()
- 7 views_slideshow_xtra_example/views_slideshow_xtra_example.install \views_slideshow_xtra_example_install()
Implements hook_install().
File
- views_slideshow_xtra_example/
views_slideshow_xtra_example.install, line 10 - Install file for Views Slideshow Xtra Example module.
Code
function views_slideshow_xtra_example_install() {
$t = get_t();
// Define the node type.
$node_vsx = array(
'type' => 'views_slideshow_xtra',
'custom' => 1,
'name' => $t('Views Slideshow Xtra'),
'base' => 'node_content',
'description' => $t('Node type used for making Views Slideshows Xtra Slides.'),
);
$content_type = node_type_set_defaults($node_vsx);
node_type_save($content_type);
// Create all the fields we are adding to our content type.
// http://api.drupal.org/api/function/field_create_field/7
foreach (_views_slideshow_xtra_example_installed_fields() as $field) {
field_create_field($field);
}
// Create all the instances for our fields.
// http://api.drupal.org/api/function/field_create_instance/7
foreach (_views_slideshow_xtra_example_installed_instances() as $instance) {
$instance['entity_type'] = 'node';
$instance['bundle'] = $node_vsx['type'];
field_create_instance($instance);
}
}