function scald_gallery_install in Scald: Gallery 7.2
Same name and namespace in other branches
- 7 scald_gallery.install \scald_gallery_install()
Implements hook_install().
File
- ./
scald_gallery.install, line 10 - Scald Gallery Installation.
Code
function scald_gallery_install() {
ScaldAtomController::addType('gallery', 'Gallery', 'Gallery');
// Associate the gallery atom type to the "library" image style
// in the library context.
$context_config = scald_context_config_load('sdl_library_item');
$context_config->transcoder['gallery']['*'] = 'style-Library';
scald_context_config_save($context_config);
// Create fields and instances. Ignore the exceptions when field exists
// (because it is in a feature etc.).
try {
foreach (scald_gallery_installed_fields() as $field) {
field_create_field($field);
}
foreach (scald_gallery_installed_instances() as $instance) {
field_create_instance($instance);
}
} catch (Exception $e) {
}
}