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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vlad.dancer’s picture

Status: Active » Needs review
FileSize
460 bytes

drupal_alter();

Spleshka’s picture

Status: Needs review » Fixed

Thanks, commited/pushed to 7.x-4.x.

vlad.dancer’s picture

Thx a lot! This save me from hack)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.