Projet

Général

Profil

Révision ef1afbb9

Ajouté par Assos Assos il y a plus de 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/views/plugins/views_plugin_display.inc
365 365
    return FALSE;
366 366
  }
367 367

  
368
  /**
369
   * Should the enabled display more link being opened in an new window?
370
   *
371
   * @codingStandardsIgnoreStart
372
   */
373
  function use_more_open_new_window() {
374
    // @codingStandardsIgnoreEnd
375
    if (!empty($this->definition['use more'])) {
376
      return $this->get_option('open_new_window');
377
    }
378
    return FALSE;
379
  }
380

  
368 381
  /**
369 382
   * Does the display have custom link text?
370 383
   */
......
414 427
      'hide_admin_links' => array('hide_admin_links'),
415 428
      'group_by' => array('group_by'),
416 429
      'query' => array('query'),
417
      'use_more' => array('use_more', 'use_more_always', 'use_more_text'),
418
      'use_more_always' => array('use_more', 'use_more_always', 'use_more_text'),
419
      'use_more_text' => array('use_more', 'use_more_always', 'use_more_text'),
430
      'use_more' => array('use_more',
431
        'use_more_always',
432
        'open_new_window',
433
        'use_more_text',
434
      ),
435
      'use_more_always' => array(
436
        'use_more',
437
        'use_more_always',
438
        'open_new_window',
439
        'use_more_text',
440
      ),
441
      'use_more_text' => array(
442
        'use_more',
443
        'use_more_always',
444
        'open_new_window',
445
        'use_more_text',
446
      ),
447
      'open_new_window' => array(
448
        'use_more',
449
        'use_more_always',
450
        'open_new_window',
451
        'use_more_text',
452
      ),
420 453
      'link_display' => array('link_display', 'link_url'),
421 454

  
422 455
      // Force these to cascade properly.
......
481 514
          'pager_options' => TRUE,
482 515
          'use_more' => TRUE,
483 516
          'use_more_always' => TRUE,
517
          'open_new_window' => FALSE,
484 518
          'use_more_text' => TRUE,
485 519
          'exposed_form' => TRUE,
486 520
          'exposed_form_options' => TRUE,
......
1529 1563
              'edit-use-more' => array(TRUE),
1530 1564
            ),
1531 1565
        );
1566

  
1567
        $form['open_new_window'] = array(
1568
          '#type' => 'checkbox',
1569
          '#title' => t("Open 'more' link in new window (target='blank')"),
1570
          '#description' => t("Leave this unchecked to open the more link in the same window."),
1571
          '#default_value' => $this->get_option('open_new_window'),
1572
          '#dependency' => array(
1573
            'edit-use-more' => array(TRUE),
1574
          ),
1575
        );
1576

  
1532 1577
        $form['use_more_text'] = array(
1533 1578
          '#type' => 'textfield',
1534 1579
          '#title' => t('More link text'),
......
2386 2431
      case 'use_more':
2387 2432
        $this->set_option($section, intval($form_state['values'][$section]));
2388 2433
        $this->set_option('use_more_always', !intval($form_state['values']['use_more_always']));
2434
        $this->set_option('open_new_window', $form_state['values']['open_new_window']) == '1';
2389 2435
        $this->set_option('use_more_text', $form_state['values']['use_more_text']);
2390 2436
      case 'distinct':
2391 2437
        $this->set_option($section, $form_state['values'][$section]);
......
2599 2645

  
2600 2646
        $path = check_url(url($path, $url_options));
2601 2647

  
2602
        return theme($theme, array('more_url' => $path, 'link_text' => check_plain($this->use_more_text()), 'view' => $this->view));
2648
        return theme($theme, array('more_url' => $path, 'new_window' => $this->use_more_open_new_window(), 'link_text' => check_plain($this->use_more_text()), 'view' => $this->view));
2603 2649
      }
2604 2650
    }
2605 2651
  }

Formats disponibles : Unified diff