Skip to content
  1. Feb 25, 2011
  2. Mar 27, 2006
  3. Feb 21, 2006
  4. Jan 29, 2006
  5. 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
  6. Jan 19, 2006
  7. Jan 18, 2006
  8. Dec 15, 2005
  9. Dec 05, 2005
  10. Dec 02, 2005
  11. Nov 23, 2005
  12. Nov 12, 2005
  13. Nov 01, 2005
  14. Oct 11, 2005
  15. Oct 07, 2005
  16. Sep 23, 2005
  17. Aug 29, 2005
  18. Aug 28, 2005
    • Dries Buytaert's avatar
      - Patch #29785 by Chx: multiple node types were broken so we refactored · c9fc300b
      Dries Buytaert authored
        part of the node system!  If you have a module that implements node
        types, you'll have to udpate its CVS HEAD version.
      
        We replaced _node_name() and _node_types() by _node().  The new _node()
        hook let's you define one or more node types, including their names.
        The implementation of the _node() hook needs to:
      
         return array($type1 => array('name' => $name1, 'base' => $base1),
                      $type2 => array('name' => $name2, 'base' => $base2));
      
        where $type is the node type, $name is the human readable name of the type
        and $base is used instead of <hook> for <hook>_load, <hook>_view, etc.
      
        For example, the story module's node hook looks like this:
      
          function story_node() {
            return array('story' => array('name' => t('story'), 'base' => 'story'));
          }
      
        The page module's node hook module like:
      
          function page_node() {
            return array('page' => array('name' => t('page'), 'base' => 'page'));
          }
      
        However, more complex node modules like the project module and the
        flexinode module can use the 'base' parameter to specify a different base.
      
        The project module implements two node types, proejcts and issues, so it
        can do:
      
          function project_node() {
            return array(
             array('project_project' => array('name' => t('project'), 'base' => 'project'),
             array('project_issue' => array('name' => t('issue'), 'base' => 'project_issue'));
          }
      
        In the flexinode module's case there can only one base ...
      
        This hook will simplify the CCK, and will make it easy (or easier) to merge
        the story and page module.
      
        In addition, node_list() became node_get_types().  In addition, we created
        the following functions: node_get_name($type) and node_get_base($type).
      c9fc300b
  19. Aug 25, 2005
  20. Apr 01, 2005
  21. Feb 08, 2005
  22. Jan 26, 2005
  23. Jan 15, 2005
  24. Dec 07, 2004
    • Dries Buytaert's avatar
      · 60352821
      Dries Buytaert authored
      - Refactored the queue module: removed the queue module's field from the node table.  With help from Gerhard.
      
      - Slight addition to INSTALL.txt with regard to PHP versions.
      
      - Updated/reworded some node type descriptions as per Boris' suggestions.
      
      - Adding missing {} around a table name in update.php.
      60352821
  25. Dec 04, 2004
  26. Nov 23, 2004
  27. Oct 23, 2004
  28. Sep 28, 2004
  29. Sep 27, 2004
    • Dries Buytaert's avatar
      - Patch #11045 by Stefan: improved consistency of node modules: · ff17aa0b
      Dries Buytaert authored
        + made the helptext under the 'Explanation or submission guidelines', more the same (blog & story);
        + made the form_set_error() texts consistent when the body of a blog/story does not match or exceeds the specified minimal numer of words.
        + used the $options for form_select() and form_radios() inline like we do in the rest of drupal;
        + made the textarea sizes for the submission pages the same for all node types and also for the 'Explanation or submission guidelines';
      ff17aa0b
  30. Sep 16, 2004
    • Dries Buytaert's avatar
      · 5c7983c4
      Dries Buytaert authored
      - Patch #8179 by JonBob: reintroduced menu caching.
      5c7983c4
  31. Aug 21, 2004
    • Dries Buytaert's avatar
      · 94e30bf7
      Dries Buytaert authored
      - Patch by JonBob: for consistency and readability, add brief descriptions of each source file inside the @file comment block at the head of the file. This helps with Doxygen indexing, and also allows neophytes to see what a file does immediately on opening the source, regardless of the organization of the hooks.
      94e30bf7
  32. Aug 18, 2004
    • Dries Buytaert's avatar
      · 83a739bd
      Dries Buytaert authored
      - Code improvements by Stefan: made all status messages consistent (and easier to translate).
      83a739bd
  33. Aug 10, 2004
    • Steven Wittens's avatar
      The Input formats - filter patch has landed. I still need to make update... · 660f9928
      Steven Wittens authored
      The Input formats - filter patch has landed. I still need to make update instructions for modules and update the hook docs.
      
      Here's an overview of the changes:
      1) Multiple Input formats: they are complete filter configurations (what filters to use, in what order and with which settings). Input formats are admin-definable, and usage of them is role-dependant. For example, you can set it up so that regular users can only use limited HTML, while admins can free HTML without any tag limitations.
      The input format can be chosen per content item (nodes, comments, blocks, ...) when you add/edit them. If only a single format is available, there is no choice, and nothing changes with before.
      
      The default install (and the upgrade) contains a basic set of formats which should satisfy the average user's needs.
      
      2) Filters have toggles
      Because now you might want to enable a filter only on some input formats, an explicit toggle is provided by the filter system. Modules do not need to worry about it and filters that still have their own on/off switch should get rid of it.
      
      3) Multiple filters per module
      This was necessary to accomodate the next change, and it's also a logical extension of the filter system.
      
      4) Embedded PHP is now a filter
      Thanks to the multiple input formats, I was able to move the 'embedded PHP' feature from block.module, page.module and book.module into a simple filter which executes PHP code. This filter is part of filter.module, and by default there is an input format 'PHP', restricted to the administrator only, which contains this filter.
      This change means that block.module now passes custom block contents through the filter system.
      As well as from reducing code duplication and avoiding two type selectors for page/book nodes, you can now combine PHP code with other filters.
      
      5) User-supplied PHP code now requires <?php ?> tags.
      This is required for teasers to work with PHP code. Because PHP evaluation is now just another step in the filter process, we can't do this. Also, because teasers are generated before filtering, this would result in errors when the teaser generation would cut off a piece of PHP code.
      
      Also, regular PHP syntax explicitly includes the <?php ?> tags for PHP files, so it makes sense to use the same convention for embedded PHP in Drupal.
      
      6) Filter caching was added.
      Benchmarking shows that even for a simple setup (basic html filtering + legacy URL rewriting), filtercache can offer speedups. Unlike the old filtercache, this uses the normal cache table.
      
      7) Filtertips were moved from help into a hook_filter_tips(). This was required to accomodate the fact that there are multiple filters per module, and that filter settings are format dependant. Shoehorning filter tips into _help was ugly and silly. The display of the filter tips is done through the input format selector, so filter_tips_short() no longer exists.
      
      8) A more intelligent linebreak convertor was added, which doesn't stop working if you use block-level tags and which adds <p> tags.
      660f9928
  34. Jul 31, 2004
    • Dries Buytaert's avatar
      · 202eee42
      Dries Buytaert authored
      - Patch #9543 by JonBob: added node-level access control!
      202eee42
  35. Jul 13, 2004
    • Dries Buytaert's avatar
      · 3613729d
      Dries Buytaert authored
      - Patch #8398 by TDobes: changed permissions for the blog, story, and page modules (and all occurrances elsewhere) to match their 4.4.x equivalents.  In the discussion when these permissions were introduced, it was decided that "edit own ..." was clearer, but "maintain personal ..." slipped into CVS HEAD anyway, while "edit own ..." landed in the 4.4.x branch.
      
      Changes are as follows:
      "maintain personal blog" -> "edit own blog" (aggregator.module, blog.module, blogapi.module)
      "maintain personal pages" -> "edit own pages" (page.module)
      "maintain personal stories" -> "edit own stories (story.module)
      3613729d
  36. Jul 08, 2004
    • Dries Buytaert's avatar
      · 898bdeff
      Dries Buytaert authored
      - Marked required fields on the node (story, book, page, blog) and comment
        forms using the $required argument of the form_ functions.
      
      - Replaced all Optional's and Required's from the taxonomy forms with proper
        use of the form_ functions.
      
      Please check your contributed modules too!
      898bdeff
  37. Jul 04, 2004
    • Dries Buytaert's avatar
      · fe2b3e7c
      Dries Buytaert authored
      - Patch by Steven and me: refactored the form handling of nodes. The node system is now using form_set_error() and friends like the rest of Drupal does. This makes for both a consistent user experience and consistent code. It simplifies the forms and validation code, however, it does change the node API slightly:
      
          * The _validate hook and the _nodeapi('validate') hook of the node API (1) no longer take an 'error' parameter and (2) should no longer return an error array. To set an error, call form_set_error().
      
          * The _form hook of the node module no longer takes a form hook and should not worry about displaying errors. Ditto for _nodeapi('form_post') and _nodeapi('form_pre').
      fe2b3e7c
  38. Jun 21, 2004
  39. Jun 18, 2004
    • Dries Buytaert's avatar
      · 54b77d64
      Dries Buytaert authored
      Tabs patch!
      
      CHANGES
      -------
      
       + Introduced tabs. First, we extended the menu system to support tabs. Next, a tab was added for every link that was (1) an administrative action other than the implicit 'view' (2) relevant to that particular page only. This is illustrated by the fact that all tabs are verbs and that clicking a page's tab leads you to a subpage of that page.
      
       + Flattened the administration menu. The tabs helped simplify the navigation menu as I could separate 'actions' from 'navigation'. In addition, I removed the 'administer > configuration'-menu, renamed 'blocks' to 'sidebars' which I hope is a bit more descriptive, and made a couple more changes. Earlier, we already renamed 'taxonomy' to 'categorization' and we move 'statistics' under 'logs'.
      
       + Grouped settings. All settings have been grouped under 'administer > settings'.
      
      TODO
      ----
      
       + Update core themes: only Xtemplate default supports tabs and even those look ugly.  Need help.
      
       + Update contributed modules.  The menu() hook changed drastically.  Updating your code adhere the new menu() function should be 90% of the work.  Moreover, ensure that your modue's admin links are still valid and that URLs to node get updated to the new scheme ('node/view/x' -> 'node/x').
      54b77d64