You are here

function flickr_page_build in Flickr 7

Implements hook_page_build().

File

./flickr.module, line 24
The Flickr module.

Code

function flickr_page_build(&$page) {

  // Determine the setting to use flickr.css or not.
  if (variable_get('flickr_css', 1)) {
    drupal_add_css(drupal_get_path('module', 'flickr') . '/flickr.css', array(
      'group' => CSS_DEFAULT,
      'every_page' => TRUE,
    ));
  }

  // Determine the setting to use flickr_license_overlay.css or not (license
  // icon on the image).
  if (variable_get('flickr_license', 1) == 1) {
    drupal_add_css(drupal_get_path('module', 'flickr') . '/flickr_cc_icons_on_hover.css', array(
      'group' => CSS_DEFAULT,
      'every_page' => TRUE,
    ));
  }

  // Determine the setting to use flickr_cc_icons.css or not (license info in
  // the caption).
  if (variable_get('flickr_license', 0)) {
    drupal_add_css(drupal_get_path('module', 'flickr') . '/flickr_cc_icons.css', array(
      'group' => CSS_DEFAULT,
      'every_page' => TRUE,
    ));
  }

  // Adds a link to the Flickr photo page in the Colorbox 'default' style.
  // Tweak the condition to apply on other styles. Also needs CSS changes.
  // !path_is_admin($_GET['q'])) was added to avoid the JS kicking in on admin
  // pages. It mangled the dragging of block weight on admin/structure/block.
  if (function_exists('_colorbox_active') && !path_is_admin($_GET['q']) && variable_get('flickr_class', '') == 'colorbox') {
    if (variable_get('colorbox_style', 'default') == 'default' && _colorbox_active()) {
      drupal_add_js(drupal_get_path('module', 'flickr') . '/flickr_colorbox.js');
    }
  }
}