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/plugins/views_plugin_row.inc
2 2

  
3 3
/**
4 4
 * @file
5
 * Contains the base row style plugin.
5
 * Definition of views_plugin_row.
6 6
 */
7 7

  
8 8
/**
......
17 17
 */
18 18

  
19 19
/**
20
 * Default plugin to view a single row of a table. This is really just a wrapper around
21
 * a theme function.
20
 * Default plugin to view a single row of a table. This is really just a wrapper
21
 * around a theme function.
22 22
 */
23 23
class views_plugin_row extends views_plugin {
24

  
24 25
  /**
25
   * Initialize the row plugin.
26
   * {@inheritdoc}
26 27
   */
27
  function init(&$view, &$display, $options = NULL) {
28
  public function init(&$view, &$display, $options = NULL) {
28 29
    $this->view = &$view;
29 30
    $this->display = &$display;
30 31

  
......
32 33
    $this->unpack_options($this->options, isset($options) ? $options : $display->handler->get_option('row_options'));
33 34
  }
34 35

  
35
  function uses_fields() {
36
  /**
37
   * {@inheritdoc}
38
   */
39
  public function uses_fields() {
36 40
    return !empty($this->definition['uses fields']);
37 41
  }
38 42

  
39

  
40
  function option_definition() {
43
  /**
44
   * {@inheritdoc}
45
   */
46
  public function option_definition() {
41 47
    $options = parent::option_definition();
42 48
    if (isset($this->base_table)) {
43 49
      $options['relationship'] = array('default' => 'none');
......
49 55
  /**
50 56
   * Provide a form for setting options.
51 57
   */
52
  function options_form(&$form, &$form_state) {
58
  public function options_form(&$form, &$form_state) {
53 59
    parent::options_form($form, $form_state);
54 60
    if (isset($this->base_table)) {
55 61
      $view = &$form_state['view'];
......
98 104
  /**
99 105
   * Validate the options form.
100 106
   */
101
  function options_validate(&$form, &$form_state) { }
107
  public function options_validate(&$form, &$form_state) {
108
  }
102 109

  
103 110
  /**
104 111
   * Perform any necessary changes to the form values prior to storage.
105 112
   * There is no need for this function to actually store the data.
106 113
   */
107
  function options_submit(&$form, &$form_state) { }
114
  public function options_submit(&$form, &$form_state) {
115
  }
108 116

  
109
  function query() {
117
  /**
118
   * {@inheritdoc}
119
   */
120
  public function query() {
110 121
    if (isset($this->base_table)) {
111 122
      if (isset($this->options['relationship']) && isset($this->view->relationship[$this->options['relationship']])) {
112 123
        $relationship = $this->view->relationship[$this->options['relationship']];
......
121 132
  /**
122 133
   * Allow the style to do stuff before each row is rendered.
123 134
   *
124
   * @param $result
135
   * @param array $result
125 136
   *   The full array of results from the query.
126 137
   */
127
  function pre_render($result) { }
138
  public function pre_render($result) {
139
  }
128 140

  
129 141
  /**
130 142
   * Render a row object. This usually passes through to a theme template
......
136 148
   * @return string
137 149
   *   The rendered output of a single row, used by the style plugin.
138 150
   */
139
  function render($row) {
151
  public function render($row) {
140 152
    return theme($this->theme_functions(),
141 153
      array(
142 154
        'view' => $this->view,
......
145 157
        'field_alias' => isset($this->field_alias) ? $this->field_alias : '',
146 158
      ));
147 159
  }
160

  
148 161
}
149 162

  
150 163
/**

Formats disponibles : Unified diff