Projet

Général

Profil

Révision 5a7e6170

Ajouté par Florent Torregrosa il y a environ 10 ans

Update :

  • panels : 7.x-3.3 -> 7.x-3.4
  • pdf_reader : 7.x-1.0-rc4 -> 7.x-1.0-rc5

Voir les différences:

drupal7/sites/all/modules/panels/plugins/display_renderers/panels_renderer_standard.class.php
259 259
      }
260 260
    }
261 261
    $this->prepared['panes'] = $first + $normal + $last;
262

  
263
    // Allow other modules the alter the prepared panes array.
264
    drupal_alter('panels_panes_prepared', $this->prepared['panes'], $this);
265

  
262 266
    return $this->prepared['panes'];
263 267
  }
264 268

  
......
404 408
   */
405 409
  function add_meta() {
406 410
    if (!empty($this->plugins['layout']['css'])) {
407
      if (file_exists(path_to_theme() . '/' . $this->plugins['layout']['css'])) {
408
        $this->add_css(path_to_theme() . '/' . $this->plugins['layout']['css']);
411
      $css = $this->plugins['layout']['css'];
412
      if (!is_array($css)) {
413
        $css = array($css);
409 414
      }
410
      else {
411
        $this->add_css($this->plugins['layout']['path'] . '/' . $this->plugins['layout']['css']);
415
      foreach($css as $file) {
416
        if (file_exists(path_to_theme() . '/' . $file)) {
417
          $this->add_css(path_to_theme() . '/' . $file);
418
        }
419
        else {
420
          $this->add_css($this->plugins['layout']['path'] . '/' . $file);
421
        }
412 422
      }
413 423
    }
414 424

  
415 425
    if ($this->admin && isset($this->plugins['layout']['admin css'])) {
416
      $this->add_css($this->plugins['layout']['path'] . '/' . $this->plugins['layout']['admin css']);
426
      $admin_css = $this->plugins['layout']['admin css'];
427
      if (!is_array($admin_css)) {
428
        $admin_css = array($admin_css);
429
      }
430
      foreach($admin_css as $file) {
431
        $this->add_css($this->plugins['layout']['path'] . '/' . $file);
432
      }
417 433
    }
418 434
  }
419 435

  
......
436 452
        break;
437 453
      case 'inline':
438 454
        $url = base_path() . $filename;
439
        $this->prefix .= '<link type="text/css" rel="stylesheet" href="' . $url . '" />'."\n";
455
        $this->prefix .= '<link type="text/css" rel="stylesheet" href="' . file_create_url($url) . '" />'."\n";
440 456
        break;
441 457
    }
442 458
  }
......
473 489
   *  A Panels pane object, as loaded from the database.
474 490
   */
475 491
  function render_pane(&$pane) {
492
    module_invoke_all('panels_pane_prerender', $pane);
493

  
476 494
    $content = $this->render_pane_content($pane);
477 495
    if ($this->display->hide_title == PANELS_TITLE_PANE && !empty($this->display->title_pane) && $this->display->title_pane == $pane->pid) {
478 496

  
......
526 544
      $this->display->context = array();
527 545
    }
528 546

  
529
    $content = FALSE;
530 547
    $caching = !empty($pane->cache['method']) && empty($this->display->skip_cache);
531 548
    if ($caching && ($cache = panels_get_cached_content($this->display, $this->display->args, $this->display->context, $pane))) {
532 549
      $content = $cache->content;
......
540 557

  
541 558
      $content = ctools_content_render($pane->type, $pane->subtype, $pane->configuration, array(), $this->display->args, $this->display->context);
542 559

  
543
      if (empty($content)) {
544
        return;
545
      }
546

  
547 560
      foreach (module_implements('panels_pane_content_alter') as $module) {
548 561
        $function = $module . '_panels_pane_content_alter';
549 562
        $function($content, $pane, $this->display->args, $this->display->context, $this, $this->display);
......
555 568
      }
556 569
    }
557 570

  
558
    // Pass long the css_id that is usually available.
559
    if (!empty($pane->css['css_id'])) {
560
      $content->css_id = check_plain($pane->css['css_id']);
561
    }
571
    // If there's content, check if we've css configuration to add.
572
    if (!empty($content)) {
573
      // Pass long the css_id that is usually available.
574
      if (!empty($pane->css['css_id'])) {
575
        $content->css_id = check_plain($pane->css['css_id']);
576
      }
562 577

  
563
    // Pass long the css_class that is usually available.
564
    if (!empty($pane->css['css_class'])) {
565
      $content->css_class = check_plain($pane->css['css_class']);
578
      // Pass long the css_class that is usually available.
579
      if (!empty($pane->css['css_class'])) {
580
        $content->css_class = check_plain($pane->css['css_class']);
581
      }
566 582
    }
567 583

  
568 584
    return $content;

Formats disponibles : Unified diff