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

  
3 3
/**
4 4
 * @file
5
 * Contains the table style plugin.
5
 * Definition of views_plugin_style_table.
6 6
 */
7 7

  
8 8
/**
......
24 24
   */
25 25
  public $order;
26 26

  
27
  function option_definition() {
27
  /**
28
   * {@inheritdoc}
29
   */
30
  public function option_definition() {
28 31
    $options = parent::option_definition();
29 32

  
30 33
    $options['columns'] = array('default' => array());
......
45 48
   *
46 49
   * @return bool
47 50
   */
48
  function build_sort() {
51
  public function build_sort() {
49 52
    if (!isset($_GET['order']) && ($this->options['default'] == -1 || empty($this->view->field[$this->options['default']]))) {
50 53
      return TRUE;
51 54
    }
......
62 65
  /**
63 66
   * Add our actual sort criteria
64 67
   */
65
  function build_sort_post() {
68
  public function build_sort_post() {
66 69
    if (!isset($_GET['order'])) {
67 70
      // check for a 'default' clicksort. If there isn't one, exit gracefully.
68 71
      if (empty($this->options['default'])) {
......
111 114
   * - Any fields not currently represented must be added.
112 115
   * - Columns must be re-ordered to match the fields.
113 116
   *
114
   * @param $columns
117
   * @param array $columns
115 118
   *   An array of all fields; the key is the id of the field and the
116 119
   *   value is the id of the column the field should be in.
117
   * @param $fields
120
   * @param array $fields
118 121
   *   The fields to use for the columns. If not provided, they will
119 122
   *   be requested from the current display. The running render should
120 123
   *   send the fields through, as they may be different than what the
......
123 126
   * @return array
124 127
   *    An array of all the sanitized columns.
125 128
   */
126
  function sanitize_columns($columns, $fields = NULL) {
129
  public function sanitize_columns($columns, $fields = NULL) {
127 130
    $sanitized = array();
128 131
    if ($fields === NULL) {
129 132
      $fields = $this->display->handler->get_option('fields');
......
157 160
  /**
158 161
   * Render the given style.
159 162
   */
160
  function options_form(&$form, &$form_state) {
163
  public function options_form(&$form, &$form_state) {
161 164
    parent::options_form($form, $form_state);
162 165
    $handlers = $this->display->handler->get_handlers('field');
163 166
    if (empty($handlers)) {
......
202 205

  
203 206
    $columns = $this->sanitize_columns($this->options['columns']);
204 207

  
205
    // Create an array of allowed columns from the data we know:
208
    // Create an array of allowed columns from the data we know.
206 209
    $field_names = $this->display->handler->get_field_labels();
207 210

  
208 211
    if (isset($this->options['default'])) {
......
301 304
    );
302 305
  }
303 306

  
304
  function even_empty() {
307
  /**
308
   *
309
   */
310
  public function even_empty() {
305 311
    return parent::even_empty() || !empty($this->options['empty_table']);
306 312
  }
307 313
}

Formats disponibles : Unified diff