Projet

Général

Profil

Révision 136a805a

Ajouté par Assos Assos il y a plus de 7 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/panels/includes/common.inc
89 89
   *  as allowed or not allowed on the initial call to panels_allowed_layouts::set_allowed()
90 90
   *
91 91
   */
92
  function panels_allowed_layouts($start_allowed = TRUE) {
92
  function __construct($start_allowed = TRUE) {
93 93
    // TODO would be nice if there was a way to just fetch the names easily
94 94
    foreach ($this->list_layouts() as $layout_name) {
95 95
      $this->allowed_layout_settings[$layout_name] = $start_allowed ? 1 : 0;
......
352 352
  $module_name = $form_state['values']['module_name'];
353 353
  variable_set($module_name . '_default', $form_state['values']['panels_common_default']);
354 354
  if (!$form_state['skip']) {
355
    // merge the broken apart array neatly back together
356
    $allowed = $form_state['values']['allowed'];
355
    // Merge the broken apart array neatly back together.
357 356
    $allowed_content_types = array();
358 357
    foreach ($form_state['values']['allowed'] as $allowed) {
359
      $allowed_content_types = array_merge($allowed_content_types, $form_state['values']['content_types'][$allowed]['options']);
358
      $values = $form_state['values']['content_types'][$allowed]['options'];
359
      // If new content of the type is not added, storing a lisy of disabled
360
      // content is not needed.
361
      if (!$form_state['values']['panels_common_default'][$allowed]) {
362
        $values = array_filter($values);
363
      }
364
      $allowed_content_types = array_merge($allowed_content_types, $values);
365
    }
366
    // Values from checkboxes are the same string as they key, but we only need
367
    // to store the boolean value.
368
    foreach ($allowed_content_types as &$value) {
369
      $value = (bool) $value;
360 370
    }
361 371
    variable_set($module_name . '_allowed_types', $allowed_content_types);
362 372
  }

Formats disponibles : Unified diff