Projet

Général

Profil

Révision 5d12d676

Ajouté par Assos Assos il y a environ 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/views/modules/locale/views_handler_sort_node_language.inc
1 1
<?php
2 2

  
3
/**
4
 * @file
5
 * Contains .
6
 */
7

  
3 8
/**
4 9
 * Sort handler that allows sorting on a specific language.
5 10
 *
......
10 15
  /**
11 16
   * {@inheritdoc}
12 17
   */
13
  function can_expose() {
18
  public function can_expose() {
14 19
    return FALSE;
15 20
  }
16 21

  
17 22
  /**
18 23
   * {@inheritdoc}
19 24
   */
20
  function query() {
25
  public function query() {
21 26
    if (isset($this->options['language'])) {
22 27
      $langcode = $this->get_system_langcode($this->options['language']);
23 28
      // Validate the langcode.
......
33 38
  /**
34 39
   * Converts a views language code into a Drupal language code.
35 40
   */
36
  function get_system_langcode($langcode) {
41
  public function get_system_langcode($langcode) {
37 42
    global $language_content;
38 43
    $default_language = language_default('language');
39 44
    $system_langcode = str_replace(array(
......
51 56
  /**
52 57
   * {@inheritdoc}
53 58
   */
54
  function option_definition() {
59
  public function option_definition() {
55 60
    $options = parent::option_definition();
56 61
    $options['language'] = array('default' => '***CURRENT_LANGUAGE***');
57 62
    return $options;
......
60 65
  /**
61 66
   * {@inheritdoc}
62 67
   */
63
  function admin_summary() {
68
  public function admin_summary() {
64 69
    $summary = parent::admin_summary();
65 70
    if ($this->options['language']) {
66 71
      $language_options = $this->get_language_options();
......
78 83
   * @return array
79 84
   *   All the languages.
80 85
   */
81
  function get_language_options() {
86
  public function get_language_options() {
82 87
    $languages = array(
83 88
      '***CURRENT_LANGUAGE***' => t("Current user's language"),
84 89
      '***DEFAULT_LANGUAGE***' => t("Default site language"),
85
      LANGUAGE_NONE => t('No language')
90
      LANGUAGE_NONE => t('No language'),
86 91
    );
87 92
    $languages = array_merge($languages, views_language_list());
88 93
    return $languages;
......
91 96
  /**
92 97
   * {@inheritdoc}
93 98
   */
94
  function show_sort_form(&$form, &$form_state) {
99
  public function show_sort_form(&$form, &$form_state) {
95 100
    parent::show_sort_form($form, $form_state);
96 101

  
97 102
    $form['language'] = array(
......
104 109
  }
105 110

  
106 111
}
107

  

Formats disponibles : Unified diff