You are here

function overlay_paths_overlay_child_initialize in Overlay Paths 7

Implements hook_overlay_child_initialize().

File

./overlay_paths.module, line 188
The overlay paths module.

Code

function overlay_paths_overlay_child_initialize() {

  // Scan the current path to try to find and custom styles
  $paths = array_filter(overlay_paths_get_overlay_paths(), 'is_array');
  foreach ($paths as $path => $options) {
    if (drupal_match_path(current_path(), $path) || drupal_match_path(drupal_get_path_alias(current_path()), $path)) {
      if (isset($options['width'])) {
        if ($width = overlay_paths_match_width($options['width'])) {
          $css = <<<EOT
#overlay {
  width: {<span class="php-variable">$width</span>};
  min-width: {<span class="php-variable">$width</span>};
  margin: 0 auto;
}
EOT;
          drupal_add_css($css, array(
            'type' => 'inline',
          ));
        }
      }
      break;
    }
  }
}