Index: linkimagefield.module =================================================================== --- linkimagefield.module (revision 2898) +++ linkimagefield.module (working copy) @@ -12,44 +12,10 @@ * - for some reason the display formatter is not being set as the default * - */ - + +include_once dirname(__FILE__) . '/linkimagefield_widget.inc'; + /** - * Implementation of hook_init(). - * - * Load required includes. - */ -function linkimagefield_init() { - // If Content, FileField, or ImageField is not available, immediately disable Link Image Field. - $disable = FALSE; - $message = ''; - - if (!module_exists('content')) { - $disable = TRUE; - $message = t('The Content Creation Kit needs to be installed for it to work properly.'); - } - - if (!module_exists('filefield')) { - $disable = TRUE; - $message = (!empty($message) ? '
' : '') . t('The FileField module needs to be installed for it to work properly.'); - } - - if (!module_exists('imagefield')) { - $disable = TRUE; - $message = (!empty($message) ? '
' : '') . t('The ImageField module needs to be installed for it to work properly.'); - } - - if ($disable) { - module_disable(array('linkimagefield')); - drupal_set_message(t('The Link Image Field module has been disabled.
') . $message); - return; - } - - // Load include code - module_load_include('inc', 'linkimagefield', 'linkimagefield_widget'); -} - - -/** * Implementation of hook_elements(). */ function linkimagefield_elements() {