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_field_locale_link_edit.inc
2 2

  
3 3
/**
4 4
 * @file
5
 * Definition of views_handler_field_locale_link_edit.
5
 * Contains .
6 6
 */
7 7

  
8 8
/**
......
11 11
 * @ingroup views_field_handlers
12 12
 */
13 13
class views_handler_field_locale_link_edit extends views_handler_field {
14
  function construct() {
14

  
15
  /**
16
   * {@inheritdoc}
17
   */
18
  public function construct() {
15 19
    parent::construct();
16 20
    $this->additional_fields['lid'] = 'lid';
17 21
  }
18 22

  
19
  function option_definition() {
23
  /**
24
   * {@inheritdoc}
25
   */
26
  public function option_definition() {
20 27
    $options = parent::option_definition();
21 28

  
22 29
    $options['text'] = array('default' => '', 'translatable' => TRUE);
......
24 31
    return $options;
25 32
  }
26 33

  
27
  function options_form(&$form, &$form_state) {
34
  /**
35
   * {@inheritdoc}
36
   */
37
  public function options_form(&$form, &$form_state) {
28 38
    $form['text'] = array(
29 39
      '#type' => 'textfield',
30 40
      '#title' => t('Text to display'),
......
33 43
    parent::options_form($form, $form_state);
34 44
  }
35 45

  
36
  function query() {
46
  /**
47
   * {@inheritdoc}
48
   */
49
  public function query() {
37 50
    $this->ensure_my_table();
38 51
    $this->add_additional_fields();
39 52
  }
40 53

  
41
  function access() {
54
  /**
55
   * {@inheritdoc}
56
   */
57
  public function access() {
42 58
    // Ensure user has access to edit translations.
43 59
    return user_access('translate interface');
44 60
  }
45 61

  
46
  function render($values) {
62
  /**
63
   * {@inheritdoc}
64
   */
65
  public function render($values) {
47 66
    $value = $this->get_value($values, 'lid');
48 67
    return $this->render_link($this->sanitize_value($value), $values);
49 68
  }
50 69

  
51
  function render_link($data, $values) {
70
  /**
71
   * {@inheritdoc}
72
   */
73
  public function render_link($data, $values) {
52 74
    $text = !empty($this->options['text']) ? $this->options['text'] : t('edit');
53 75

  
54 76
    $this->options['alter']['make_link'] = TRUE;
......
57 79

  
58 80
    return $text;
59 81
  }
82

  
60 83
}

Formats disponibles : Unified diff