Hi, first of all thx for this great module!
I'm new to ctools modals and have a task to theme modal, so I've made research how to override modal options.
Here possible solutions:
- Using Drupal.theme.prototype.CToolsModalDialog but this will override all ctools modals
- Using drupal_add_js
drupal_add_js(array( 'ctools-ajax-register-style' => array( 'modalTheme' => 'custom_theme' 'closeImage' => theme('image', array( 'path' => drupal_get_path('theme', 'mytheme') . ('/img/modal_close.png'), 'title' => t('Close window'), 'alt' => t('Close window'), )), )), 'setting');
+ modalTheme setting. This is more elegant.
But, when custom/contrib theme/module has soft dependency to yours, first one do wasted drupal_add_js calling or prototype declaring. Сertainly developers can add module_exists/fuction_exists for additional check or even module dependency in .info.
I propose to add alter hook via drupal_alter() that allows another modules to act with modal options variable.
Patch icluded below.
If this solution is excess, please, close issue.
Comment | File | Size | Author |
---|---|---|---|
#1 | ajax_register-allow-modules-to-override-modal-options-2028463-1.patch | 460 bytes | vlad.dancer |
Comments
Comment #1
vlad.dancerdrupal_alter();
Comment #2
SpleshkaThanks, commited/pushed to 7.x-4.x.
Comment #3
vlad.dancerThx a lot! This save me from hack)