Skip to content
Snippets Groups Projects
  1. Sep 05, 2006
  2. Aug 31, 2006
  3. Aug 27, 2006
  4. Aug 25, 2006
  5. Aug 23, 2006
  6. Aug 22, 2006
  7. Aug 21, 2006
  8. Aug 20, 2006
  9. Aug 18, 2006
  10. Aug 14, 2006
  11. Aug 10, 2006
  12. Aug 07, 2006
  13. Jul 31, 2006
  14. Jul 02, 2006
  15. May 26, 2006
  16. May 23, 2006
  17. May 07, 2006
  18. Apr 26, 2006
  19. Apr 17, 2006
  20. Apr 04, 2006
  21. Mar 04, 2006
    • Dries Buytaert's avatar
      - Patch #52381 by Zen: · a9ff6cd3
      Dries Buytaert authored
          * Converts the block administration page to the fapi model.
          * Removes some 'type=markup' elements.
          * Adds a form_render($form['form_id']); in the theme function. Adding a form_render($form) just outputs an unthemed form. I suspect this is because of the heavy nesting of form elements and the rather dodgy array declaration, but I'm unsure.
          * Documentation/language fixes.
      a9ff6cd3
  22. Feb 21, 2006
  23. Feb 10, 2006
  24. Jan 29, 2006
  25. Jan 26, 2006
  26. Jan 24, 2006
  27. Jan 20, 2006
    • Dries Buytaert's avatar
      - Patch #45530 by Morbus: filter_form shouldn't default to #weight 0 · 8c02d4ec
      Dries Buytaert authored
      When a form element doesn't specify a #weight, it is assumed internally as #weight 0. However, to ensure that our form elements display visually *as they were defined in the array* we, in form_builder, count the number of elements, divide by 1000, and set that as the weight:
      
      # Assign a decimal placeholder weight to preserve original array order
      if (!isset($form[$key]['#weight'])) {
        $form[$key]['#weight'] = $count/1000;
      }
      
      The above code will set the #weights of elements that have not defined a weight to something like 0 (first element in array definition), 0.001, 0.002, and so on. However, anytime a form element *explicitly* defines a #weight of 0, that #weight is kept at exactly 0, which would cause that form element to appear BEFORE the elements that didn't have a #weight defined (and thus received a #weight such as 0.002).
      
      Consider the following pseudo example:
      
      $form['game_title'] = array(
          '#type' => 'textfield',
          ...
          );
      $form['game_description'] = array(
          '#type' => 'textarea',
          ...
          );
      $form['game_format'] = filter_form(variable_get('game_format', NULL));
      return $form;
      
      Here, we're not definiing weights on our two textfields. We then add an filter_form. The second parameter of the filter_form is $weight, which defaults to 0. After this $form hits form_builder, we have weights 0 (game_title), 0.001 (game_description), and 0 (filter_form) respectively. This is then sorted by weight, which causes filter_form (the third element in the array) to appear BEFORE game_description (0 is lighter than 0.001).
      
      The short lesson is: explicitly defining #weight 0 for a form element is probably a bad idea. This patch changes the default #weight of filter_form to NULL, instead of 0, and also removes any other explicit setting of #weight to 0 in core.
      8c02d4ec
  28. Jan 19, 2006
  29. Jan 12, 2006
  30. Jan 08, 2006
  31. Jan 06, 2006
  32. Dec 14, 2005
  33. Dec 05, 2005
  34. Dec 02, 2005
  35. Nov 16, 2005
Loading