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_rss_fields.inc
1 1
<?php
2

  
2 3
/**
3 4
 * @file
4
 * Contains an implementation of RSS items based on fields on a row plugin.
5
 * Definition of views_plugin_row_rss_fields.
5 6
 */
6 7

  
7 8
/**
8 9
 * Renders an RSS item based on fields.
9 10
 */
10 11
class views_plugin_row_rss_fields extends views_plugin_row {
11
  function option_definition() {
12

  
13
  /**
14
   * {@inheritdoc}
15
   */
16
  public function option_definition() {
12 17
    $options = parent::option_definition();
13 18
    $options['title_field'] = array('default' => '');
14 19
    $options['link_field'] = array('default' => '');
......
20 25
    return $options;
21 26
  }
22 27

  
23
  function options_form(&$form, &$form_state) {
28
  /**
29
   * {@inheritdoc}
30
   */
31
  public function options_form(&$form, &$form_state) {
24 32
    parent::options_form($form, $form_state);
25 33

  
26 34
    $initial_labels = array('' => t('- None -'));
......
89 97
    );
90 98
  }
91 99

  
92
  function validate() {
100
  /**
101
   *
102
   */
103
  public function validate() {
93 104
    $errors = parent::validate();
94 105
    $required_options = array('title_field', 'link_field', 'description_field', 'creator_field', 'date_field');
95 106
    foreach ($required_options as $required_option) {
......
105 116
    return $errors;
106 117
  }
107 118

  
108
  function render($row) {
119
  /**
120
   * {@inheritdoc}
121
   */
122
  public function render($row) {
109 123
    static $row_index;
110 124
    if (!isset($row_index)) {
111 125
      $row_index = 0;
......
165 179
  /**
166 180
   * Retrieves a views field value from the style plugin.
167 181
   *
168
   * @param $index
169
   *   The index count of the row as expected by views_plugin_style::get_field().
170
   * @param $field_id
182
   * @param int $index
183
   *   The index of the row as expected by views_plugin_style::get_field().
184
   * @param string $field_id
171 185
   *   The ID assigned to the required field in the display.
172 186
   */
173
  function get_field($index, $field_id) {
187
  public function get_field($index, $field_id) {
174 188
    if (empty($this->view->style_plugin) || !is_object($this->view->style_plugin) || empty($field_id)) {
175 189
      return '';
176 190
    }

Formats disponibles : Unified diff