Projet

Général

Profil

Révision 18596a08

Ajouté par Assos Assos il y a presque 7 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/module_filter/module_filter.theme.inc
37 37
    array('data' => t('Description'), 'class' => array('description')),
38 38
    array('data' => t('Links'), 'class' => array('links')),
39 39
  );
40
  if (variable_get('module_filter_version_column', 0)) {
41
    array_splice($header, 2, 0, array(array('data' => t('Version'), 'class' => array('version'))));
42
  }
40 43
  $package_ids = array('all');
41 44
  $enabled['all'] = array();
42 45

  
......
101 104
      }
102 105
      $row[] = array('class' => array('name'), 'data' => $label . '><strong>' . drupal_render($module['name']) . '</strong> <span class="module-machine-name">(' . $key . ')</span></label>');
103 106

  
107
      if (variable_get('module_filter_version_column', 0) && $version) {
108
        $row[] = array('class' => array('version'), 'data' => drupal_render($module['version']));
109
      }
110

  
104 111
      // Add the description, along with any modules it requires.
112
      if (empty($module['description']['#markup'])) {
113
        $module['description']['#markup'] = '<em>' . t('No description available.') . '</em>';
114
      }
105 115
      $description = '<span class="details"><span class="text">' . drupal_render($module['description']) . '</span></span>';
106
      if ($version || $requires || $required_by) {
116
      if ($requires || $required_by || (!variable_get('module_filter_version_column', 0) && $version)) {
107 117
        $description .= '<div class="requirements">';
108
        if ($version) {
118
        if (!variable_get('module_filter_version_column', 0) && $version) {
109 119
          $description .= '<div class="admin-requirements">' . t('Version: !module-version', array('!module-version' => drupal_render($module['version']))) . '</div>';
110 120
        }
111 121
        if ($requires) {
......
136 146
    $form['modules'][$package]['#printed'] = TRUE;
137 147
  }
138 148

  
139
  if (variable_get('module_filter_count_enabled', 1)) {
140
    $enabled_counts = array();
141
    foreach ($enabled as $package_id => $value) {
142
      $enabled_counts[$package_id] = array(
143
        'enabled' => count(array_filter($value)),
144
        'total' => count($value),
145
      );
146
    }
147
    drupal_add_js(array(
148
      'moduleFilter' => array(
149
        'packageIDs' => $package_ids,
150
        'enabledCounts' => $enabled_counts,
151
      )
152
    ), 'setting');
149
  //Get packages and count number of modules
150
  $enabled_counts = array();
151
  foreach ($enabled as $package_id => $value) {
152
    $enabled_counts[$package_id] = array(
153
      'enabled' => count(array_filter($value)),
154
      'total' => count($value),
155
    );
153 156
  }
157
  drupal_add_js(array(
158
    'moduleFilter' => array(
159
      'packageIDs' => $package_ids,
160
      'enabledCounts' => $enabled_counts,
161
    )
162
  ), 'setting');
154 163

  
155 164
  // Add first and last class to rows.
156 165
  $rows[0]['class'][] = 'first';
......
165 174
  return $output;
166 175
}
167 176

  
177
/**
178
 * Theme function for module filter operations.
179
 * @param $variables
180
 * @return
181
 *   HTML for admin status operations.
182
 */
168 183
function theme_module_filter_operations(&$vars) {
169 184
  $links = &$vars['links'];
170 185
  $dropbutton = $vars['dropbutton'];
......
174 189
    if ($dropbutton) {
175 190
      hide($links[$key]);
176 191
      if (!empty($links[$key]['#href'])) {
177
        $operations[] = array(
192
        $operations[$key] = array(
178 193
          'title' => $links[$key]['#title'],
179 194
          'href' => $links[$key]['#href'],
180 195
        );
196
        if (isset($links[$key]['#options'])) {
197
          $operations[$key] += $links[$key]['#options'];
198
        }
181 199
      }
182 200
    }
183 201
    else {
184 202
      $data = drupal_render($links[$key]);
185 203
      if (!empty($data)) {
186
        $operations[] = array('data' => $data);
204
        $operations[$key] = array('data' => $data);
187 205
      }
188 206
    }
189 207
  }

Formats disponibles : Unified diff