Project

General

Profile

Revision c06bd9a4

Added by Assos Assos almost 4 years ago

Weekly update of contrib modules

View differences:

drupal7/sites/all/modules/panels/i18n_panels/i18n_panels.module
350 350
 *   TRUE if the display is available from code.
351 351
 */
352 352
function _18n_panels_is_exported_panels_display($display) {
353
  if (isset($display->uuid)) {
354
    $displays = _18n_panels_fetch_all_panel_displays();
355
    return isset($displays['exported-' . $display->uuid]);
353
  if (!isset($display->uuid)) {
354
    return FALSE;
355
  }
356
  $uuid = $display->uuid;
357
  // Check exported displays.
358
  ctools_include('export');
359
  $panels_display_temp = ctools_export_crud_load('panels_display', $uuid);
360
  $panels_mini_temp = ctools_export_crud_load('panels_mini', $uuid);
361
  if (
362
    !empty($panels_display_temp)
363
    || !empty($panels_mini_temp)
364
    || (module_exists('panelizer') && ctools_export_crud_load('panelizer_defaults', $uuid))
365
  ) {
366
    return TRUE;
367
  }
368

  
369
  // Check page manager embedded displays.
370
  // @see _18n_panels_fetch_all_panel_displays()
371
  if (module_exists('page_manager')) {
372
    module_load_include('inc', 'page_manager', 'page_manager.admin');
373
    $tasks = page_manager_get_tasks_by_type('page');
374
    $pages = array('operations' => array(), 'tasks' => array());
375
    page_manager_get_pages($tasks, $pages);
376

  
377
    foreach ($pages['tasks'] as $task) {
378
      $page = page_manager_cache_load($task);
379
      foreach ($page->handler_info as $id => $info) {
380
        $page_manager_handler = $page->handlers[$id];
381
        if ($page_manager_handler->handler == 'panel_context') {
382
          $is_exported = ($page_manager_handler->export_type == (EXPORT_IN_CODE | EXPORT_IN_DATABASE) || (isset($page->subtask['storage']) && $page->subtask['storage'] == t('Overridden')));
383
          if (!empty($page_manager_handler->conf['display'])) {
384
            $panels_display = $page_manager_handler->conf['display'];
385
            if ($panels_display->uuid == $uuid) {
386
              return TRUE;
387
            }
388
          }
389
          elseif ($is_exported && isset($page_manager_handler->conf['did'])) {
390
            $panels_display = panels_load_display($page_manager_handler->conf['did']);
391
            if (isset($panels_display->uuid) && $panels_display->uuid == $uuid) {
392
              return TRUE;
393
            }
394
          }
395
        }
396
      }
397
    }
356 398
  }
357 399
  return FALSE;
358 400
}

Also available in: Unified diff