You are here

function imagecrop_page in Image javascript crop 7

Override the page theming for the imagecrop pages.

1 string reference to 'imagecrop_page'
imagecrop_theme in ./imagecrop.module
Implements hook_theme().

File

includes/imagecrop.theme.inc, line 13
Theming functions for showing the imagecrop pages.

Code

function imagecrop_page($variables) {
  $output = '';
  if (isset($variables['messages'])) {
    $output .= $variables['messages'];
  }
  if (!module_exists('block')) {
    $region = 'content';
  }
  else {
    global $theme;
    $query = db_select('block');
    $query
      ->addField('block', 'region');
    $query
      ->condition('theme', $theme);
    $query
      ->condition('module', 'system');
    $query
      ->condition('delta', 'main');
    $region = $query
      ->execute()
      ->fetchField();
  }

  // Render only the main content.
  if (isset($variables['page'][$region])) {
    $output .= imagecrop_render_main_content($variables['page'][$region]);
  }
  elseif (isset($variables['page']['content_zone']['#regions']['content'])) {
    $variables['page']['content_zone']['#regions']['content']['#omega']['page_data']['title'] = FALSE;
    $output .= drupal_render($variables['page']['content_zone']['#regions']['content']);
  }
  else {
    $output = t('The main content block was not found.');
  }
  return $output;
}