CVS edit link for James Marks

Site Index module

MOTIVATION
----------
I am applying for a CVS account because I have written what I believe to be a useful module - Site Index - and want to make it available to other Drupal users as part of my contribution to Drupal. I and the organization I work for have benefited greatly over the last two years by using Drupal core and contributed modules to construct our intranet site and I'd like to start giving back what I can to the Drupal community.

I wrote the Site Index module after searching for but failing to find a module (or a configuration of CCK and Views) that allows manual creation of a 'book-style' alphabetical index - with headings, entries and redirect entries - of site content. We needed something that would allow the easy creation and management of index entries that linked to given items of content (node, view, basically anything with a functional and accessible path) using custom index text.

Our staff is multinational and multilingual and not always technologically savvy so the index needed to be simple and straightforward. All the available solutions we found produced indexes that were too complex, consisted of entries produced by progammatically retrieving and displaying node, view or page titles, taxonomy terms, etc. and, frankly, were too confusing to our average user to be beneficial in the way we needed.

GOAL
----
The Site Index module is intended to provide an easy to configure and easy to use public-facing alphabetical index of site content that allows site users to easily find content through a variety of descriptive index entries. It allows anyone with site index admin permission to create and manage index entries, index headings with subordinate entries and index entries that redirect to other index entries.

It provides an alternative to search functionality in that it allows intentional and informed guidance for users to what the organization, through its site admins, believes to be the most relevent and useful information to its users. It is intended to complement rather than replace search functionality.

FUNCTIONALITY
-------------
Displays a site index consisting of headings and entries in an alphabetical format that link to site content.

Provides display of a single page containing all site entries or a page of entries based on chosen index letter.

Periodically tests and updates site entry status (which determines inclusion in the site index) based on link functionality (which can be affected by link rot, node status changes, etc...).

Allows creation and deletion of index entry links through an admin page or from within the node edit form.

Provides optional notification, when editing nodes, if node is not listed in site index.

Provides report of non-functional entry links with edit and delete options.

CONFIGURABLE OPTIONS
--------------------
User-definable title of and path to the site index page.

Creation and deletion of site index entries directly from within node edit forms.

Notification on node edit forms for nodes that are not included in the site index.

Expanded or collapsed fieldset for index entry fields in node edit form.

Option of inclusion, by content type, of index entry fieldset in node edit form.

PAGES
-----

admin/build/siteindex     (Adding, editing & deleting of index entries)
admin/settings/siteindex  (Configuration settings)
admin/reports/siteindex   (Report of non-functional entry links, if any)
admin/help/siteindex      (Help page)
site_index                (Default Index path)

FILES
-----
README.txt
siteindex.css
siteindex.info
siteindex.install
siteindex.module

STATUS
------
The module has been tested in-house and is in use on our intranet site. Because it hasn't yet been heavily tested by a number of different site index admins (we only have one at the moment) I would consider it to be a beta version at this point although I'm not aware of any outstanding bugs or problems with it (and, given that we're using it, I would be happy to fix any that are found).

COMPARABLE MODULES
------------------
IndexPage (http://drupal.org/project/indexpage)
Index (http://drupal.org/project/index)
Vocabulary Index (http://drupal.org/project/vocabindex)

                    Site Index    IndexPage     Index         Vocabulary Index
------------------------------------------------------------------------------
User-facing         Yes           No            Yes           Yes

Index generation    Manual        Programmed    Programmed    Programmed

Drupal versions     6             5, 6, 7(dev)  6(dev)        5, 6 (Succeeded
                                                              by Index)

Index content       Anything      Content       Comments,     Vocabularies
                    accessible    by content    Nodes,
                    by a path     type          Content types,
                                                Languages,
                                                Roles,
                                                Terms,
                                                Users,
                                                Vocabularies

Grouping/ordering   Alphabetical  Content       Comments,     Vocabularies
                                  by content    Nodes,
                                  type          Content types,
                                                Languages,
                                                Roles,
                                                Terms,
                                                Users,
                                                Vocabularies

Comments

james marks’s picture

StatusFileSize
new12.41 KB

I'm attaching the Site Index code to the CVS account application.

James

james marks’s picture

Status: Postponed (maintainer needs more info) » Needs review

Changing the status.

James

sun’s picture

Status: Needs review » Needs work
Issue tags: +Module review
  1. Typo in filename READEME.txt
  2. CSS class .alpha-index is outside of the module's namespace.
  3. minor: you're encouraged to follow Drupal's coding standards for CSS, http://drupal.org/node/302199
  4. function siteindex_install() {
    ...
      drupal_set_message(st("Site Index settings are available under !link", 
        array( '!link' => l('Administer > Site configuration > Site Index settings ', 'admin/settings/siteindex' ))
      ));
    }
    

    Drupal modules should not output such messages after performing (any) installation tasks. There are dedicated modules, which may be doing this. All other modules should follow practices of Drupal core modules.

  5. You can remove t() everywhere from hook_schema().
  6. /**
     * Path to the site index page used for building a variety of links.
     */
    define('SITEINDEX_PAGE_PATH', variable_get('siteindex_page_path', 'site_index'));
    
    /**
     * Title of the Site Index menu link in the Navigation menu.
     */
    define('SITEINDEX_MENU_TITLE', variable_get('siteindex_menu_title', 'Site index'));
    

    These two constants need to be removed. variable_get() is enough of an abstraction.

  7. siteindex_entry_list() generates a PHP notice for $table if there are no entries. There is more code in the module that will likely generate notices and warnings. In general, you should develop with E^ALL for PHP's error_reporting.
  8. minor: siteindex.css is loaded on all/any pages.
  9. Most module functions are declared as "private" (leading underscore). This is very untypical for a Drupal module, especially, since siteindex API functions are private, too.
  10. minor: MENU_CALLBACKs do not necessarily need a 'title' or 'description', as they are not displayed anyway. Might be a good idea to "group" the autocomplete callbacks into siteindex/autocomplete/[thing].
  11. The HTML/CSS ID siteindex-node-form likely clashes with a possible node type name "sideindex".
  12. In the siteindex_add_edit_entry() form, the submit button label string needs to be passed through t() where the variable string is set, not where it is assigned to the button. Otherwise, the string cannot be translated.

    The cancel button should use a dedicated #submit handler, so as to not clobber the regular form submission.

    minor: "confirm" in [_]siteindex_confirm_first_level_value() and other functions should be renamed to "validate". Ideally, they should get $form and $form_state as arguments, just like any other form validation handler.

    It looks like _siteindex_test_path() should be a more common form validation handler, too. At least the error handling tied to it looks a bit weak currently.

    You may also find the #element_validate Form API property interesting. It allows you to perform form element value validation on a per element basis, which might heavily simplify your form handling here. _siteindex_form_alter_validate() looks like you really could use #element_validate.

    _siteindex_add_edit_entry_submit() performs identification and routing logic, which was already done in _siteindex_add_edit_entry() or elsewhere. That's a bit fragile and might impose security issues, since the form processing should not be able to entirely manipulate the target thing that is submitted. You can store originally identified properties in $form['#siteindex'] or in #type 'value' form elements; both ways are accessible in form validation and submit handlers.

    The submit button label text should not have an effect on data storage and CRUD logic. You should check whether an entry needs to be created or updated, based upon whether the form resp. submitted form values contain an id or not. -- Ideally, you might want to consider to move the actual data storage into API functions, i.e. siteindex_entry_save(&$entry).

  13. In several places, you are fiddling with drupal_get_destination() for form submissions. You should not have to, as Drupal core automatically cares for alternating destinations for you. If not, then you should document what is being done there and why.
  14. The siteindex_notices admin setting, and potentially others, should use a checkbox as UI element.
  15.   $form['#submit'][] = menu_rebuild();
    

    No way. :) First of all, menu_rebuild() is invoked immediately here, not as a submit handler. Thus, everytime you visit the admin settings, the entire menu is rebuild. You should be using a dedicated submit handler for the admin settings here, which performs that action.

  16. _siteindex_change_index_entry_status() and likely other functions might better use the more common [subject]_[verb] naming - i.e., here: siteindex_entry_change_status($ieid, $status). In this very special case, passing strings that are translated into 1/0 looks a bit weird.
  17.   $sql = "UPDATE {siteindex}
              SET    status = %d
              WHERE  ieid = %d";
      $sql_args = array($status, $ieid);
      db_query($sql, $sql_args);
    

    minor: In general, in Drupal, we write SQL statements on one line and without needless variables (unless they are needed, of course):

      db_query("UPDATE {siteindex} SET status = %d WHERE ieid = %d", array($status, $ieid));
    
  18. _siteindex_check_for_duplicate_entries() seems to be a form validation handler, which also invokes form_set_error(). Either it's an API function or it's a form validation handler, but please not both. I.e., same remarks as above.
  19. _siteindex_delete_entry() may ideally be renamed to siteindex_entry_delete_form(), so as to clarify that the function is a form constructor. Ideally, the form submit handler should invoke a separate API function siteindex_entry_delete() to delete an entry.

    The delete form needs to use confirm_form().

  20.     // If it's an index entry with no first- or second-level values
        // then it's an index entry being deleted form the node entry form
        elseif (!empty($entry['ieid'])) {
          $sql = "DELETE FROM {siteindex}
                  WHERE       ieid = %d";
          db_query($sql, $entry['ieid']);
        }
    

    This should and must not happen. It would mean that user input and stored data can get lost mysteriously. I.e., this entire elseif needs to vanish.

  21. /**
     * Menu callback.
     *
     * Returns user to index entry list without submitting index entry form
     */
    function _siteindex_form_cancel($destination) {
      drupal_goto($destination);
    }
    

    This looks very very odd. Not sure what you were trying to do, but this is an illegal mix of sub-system APIs, which makes no sense. Is this supposed to be a form submit handler instead of a menu callback (as the PHPDoc states)? If it is, then the function gets $form and $form_state as arguments, so $destination can't work. If it's not, then it's indeed a menu callback that redirects to another path, which is needless, since you could specify 'page callback' => 'drupal_goto', 'page arguments' => array(1 [or 'static/destination'), in hook_menu() already. But in the end, a page callback that permanently and unconditionally redirects is entirely wrong in the first place. ;)

    Thus, something is wrong here and this entire function needs to go.

  22. In _siteindex_page(), $title needs to be check_plain()ed for drupal_set_title(), as $title can contain arbitary user input.

    $index_letter and eventually all other stored user input that is output in the index needs to be check_plain()ed, too. This in particular applies to headings that are output further below.

  23. Lastly, the module contains plenty of logic to allow to alter the internal system path the index is appearing on:
      $form['siteindex_page_path'] = array(
        '#type'          => 'textfield',
        '#title'         => t('Path to site index page'),
        '#description'   => t('Path to the site index page. Existing index entries will be updated if this value is changed.'),
        '#default_value' => variable_get('siteindex_page_path', 'site_index'),
      );
    

    This entire configuration setting is very uncommon for a Drupal module and actually needless, since 'site_index' is the internal system path. One wants to have it on a different path, users are able to create a URL alias for it. Modules like Subpath Alias additionally introduce support for dynamic arguments after URL aliases.

    Finally, the default path should be 'siteindex', not 'site_index', as the latter is not the module's namespace.

james marks’s picture

Status: Needs work » Needs review
StatusFileSize
new11.82 KB
  1. Fixed.
  2. Fixed. Changed '.alpha-index' to '.siteindex-alpha-index'
  3. Done.
  4. I've commented it out but I added the message following the suggestion to do so under 'Recommended practices' in 'Module documentation guidelines' (http://drupal.org/node/161085). If its use is incorrect, the guidelines should be probably be corrected.
  5. Fixed.
  6. Fixed. I had added the constants thinking it would be better to reduce the number of calls to the database to one at the top of the file.
  7. Fixed. Initialized $table before if statement
  8. Fixed. Moved drupal_add_css to siteindex_page() function
  9. Fixed.
  10. Fixed. Removed titles and descriptions and rewrote path element order (and menu callback function names) to facilitate grouping of similar autocomplete callbacks.
  11. Fixed. Changed 'siteindex-node-form' to 'siteindex-fieldset'.
    1. Fixed.
    2. Fixed.
    3. Removed shared siteindex_confirm_first_level_value and put code in respective validation handlers.
    4. Error handling has been simplified somewhat. I am no longer testing node status, just testing whether a path exists or not and letting access callbacks handle whether the path is accessible to the user at time of attempted access.

      With regard to whether siteindex_test_path() should be a validation handler, it performs two functions; 1) it tests paths submitted via forms (form validation) and 2) tests, on a periodic basis, existing siteindex entry paths (not form validation). For that reason, it doesn't seem right (to me) to call it a form validator if it does more than form validation.
    5. Other changes I've made have ended up simplifying siteindex_form_alter_validate() so I'm not sure if #element_validate would do much more here. '#element_validate' is interesting and would be useful except in cases where the validity of the submission depends on the comparative evaluation of two separate fields simultaneously. I'll look for instances where it would be a better solution.
    6. I'm using two different path fields in the form that share a common path field in the siteindex table because while users can easily enter a path to content, they cannot so easily enter a link to a named anchor on a page. Therefore, the index entry field uses an autocomplete path to help identify existing index entries by title and then those titles are converted to links to named anchors upon submission.
      When path data is pulled from the table, I need identify whether the path is to content or to a named anchor and, if so, convert the link to the named anchor back to index entry titles for the user to understand. So, I'm converting from literal paths on extraction and to them on submission, different kinds of conversion in different functions.
      Originally, when the user entered an index entry title, I had the autocomplete function build and display the link to the named anchor in parenthesis that followed the index entry heading + entry in the submission form then just used the content in parenthesis upon submission but the display of the explicit path to the named anchor confused the users. (They didn't care about, and don't want to see, raw html links to named anchors when they were trying to identify an index entry.)
      The weakest part of this that I see is the representation of the index heading + entry text using an arrow (->) as a delimiter. I need a reliable way to split the heading from the entry when testing the path but this admittedly seems (to me) to be a bit kludgy.
      I hope I haven't misunderstood your point and have adequately addressed it. I'm sure you'll let me know if I haven't. :)
    7. Fixed. Testing presence or absence of ieid to determine if form submission is an addition or an edit.
  12. Fixed. Used $form['#redirect'] and dropped all 'destination' fiddling. (Ironically, it looks like $form['#redirect'] has been killed in D7 by you. :) )
  13. Fixed.
  14. Fixed. Added conditional code to check for need of menu rebuild.
  15. Changed passing strings then converting to integers to just passing integers. With regard to function naming, I'd looked through core modules in the past and hadn't been able to identify a standard function naming convention ([verb][subject] or [subject][verb]). Both appear to exist side-by-side. In some cases, one or the other appears to be used to logically group related functions together: [verb][subject]: user_validate_name, user_validate_mail, user_validate_picture; [subject][verb] node_type_save, node_type_delete. Are there published guidelines as to which is appropriate when? Is this a critical issue? I want my code to conform to standards, I just haven't been able to find clearly articulated ones when it comes to subject-verb order in function naming.
  16. Fixed. Is there a general rule as to how long a one-line query can be before it is written on multiple lines? Arrays are written on multiple lines if they exceed more than 80 characters (according to the Coding Standards document). Would that standard apply to other long code strings?
  17. Fixed. siteindex_test_for_duplicate_entries() no longer sets form errors and, instead, acts as an api to simply return a TRUE or FALSE for the test result. Form errors are set, if appropriate, in the validation functions.
  18. Fixed. Is it a requirement to use confirm_form()? I'm using it now but I don't like it as much as what I had originally because it fails to offer the 'Cancel' option as a button, rendering it as a link instead. Since they're both options, it seems that they should both be rendered in similar fashion.
  19. Ok, here's where I defend my code. :) The intent here is to allow deletion of site index entries from the multi-value fieldset in the node edit form similar to way specific values can be deleted from multi-value CCK fields by deleting the value and submitting the form. The removal of editable values indicates the intended deletion of the related record. In any other fields on a node edit form, CCK or not, submission of empty fields indicates intended deletion of those values. Why not allow the deletion site index values as well?
  20. Replaced by a dedicated submit handler.
    1. Fixed.
    2. Fixed. Running $index_letter, $heading and $heading_id have been run through check_plain() and subheadings should have been run through either check_url or check_plain as a result of being run though 'l()' during the construction of the $entry_array.
    3. Fixed.
    4. Fixed.
dman’s picture

Hi. re #4. I'm responsible for the mixed messages you may have got there. I find it extremely useful for a module to say "Hi, I'm installed, here's how to use me" rather than silently hide itself deep in the menu tree making you search for it for the next 5 minutes. To me that's affordance. Sun appears to have a slight difference of opinion.
You can't please everyone :-)

sun’s picture

Thanks! No time for a full review, sorry.

4. I've commented it out but I added the message following the suggestion to do so under 'Recommended practices' in 'Module documentation guidelines' (http://drupal.org/node/161085). If its use is incorrect, the guidelines should be probably be corrected.

Interesting. Not sure who put those up. In general, it's best to follow latest and greatest code in Drupal core. None of the core modules display a message after installing or uninstalling. And, I keep my major argument: To be really helpful, you should integrate with one of the existing "admin guide" modules instead, i.e., modules that allow other modules to expose structured information and ordered tasks to install and configure the module. Simple messages simply don't buy you anything useful, since they'll vanish, are only visible to one user, and stuff.

We should fix those guidelines.

6. Fixed. I had added the constants thinking it would be better to reduce the number of calls to the database to one at the top of the file.

Mad assumptions :) http://api.drupal.org/api/function/variable_get/6 does not query the database, it's a very fast function.

13. Fixed. Used $form['#redirect'] and dropped all 'destination' fiddling. (Ironically, it looks like $form['#redirect'] has been killed in D7 by you. :) )

IIRC, I actually meant to drop the entire special destination handling. If you want a form to redirect to somewhere else (than the default page/path after submission), then you can simply pass a 'destination' query parameter to it:

http://example.com/path/to/form?destination=custom/redirect/path/to/end/on

Form API will respect this destination path and ignore any hard-coded path.

16. Changed passing strings then converting to integers to just passing integers. With regard to function naming, I'd looked through core modules in the past and hadn't been able to identify a standard function naming convention ([verb][subject] or [subject][verb]). Both appear to exist side-by-side. In some cases, one or the other appears to be used to logically group related functions together: [verb][subject]: user_validate_name, user_validate_mail, user_validate_picture; [subject][verb] node_type_save, node_type_delete. Are there published guidelines as to which is appropriate when? Is this a critical issue? I want my code to conform to standards, I just haven't been able to find clearly articulated ones when it comes to subject-verb order in function naming.

Good, modern, fancy: [subject]_[verb]
Old, ugly, bad: [verb]_[subject]

This concept is easily understandable and allows to quickly draft new APIs. Speaking of, any module/API should expose the base CRUD functions along with hooks, like many of core's APIs do:

siteindex_entry_load() => hook_siteindex_entry_load()
siteindex_entry_save() => hook_siteindex_entry_insert() / hook_siteindex_entry_update()
siteindex_entry_delete() => hook_siteindex_entry_delete()

Those user validation helper functions you mentioned (and others) date back to... Drupal 4.6 actually: http://api.drupal.org/api/function/user_validate_name/4.6 -- however, finding good names for such universal helper functions also is not an easy task. One could argue that "user" is the subject already (although it's the module name).

17. Fixed. Is there a general rule as to how long a one-line query can be before it is written on multiple lines? Arrays are written on multiple lines if they exceed more than 80 characters (according to the Coding Standards document). Would that standard apply to other long code strings?

Comments are required to wrap at 80 chars. Arrays are treated kinda special; although there is no clear rule that forces you to wrap arrays (write them as multi-line), many people always do and prefer it. Any other code or string does not need to wrap, but if there is a sane method of making it wrap, it may be used. Overly (very very) long strings, for example, may simply be concatenated:

$text = 'foo bar baz';
$text .= 'baz bar foo';

However, this really applies to text strings only. Code lines (most often conditions) may be split into multiple conditions, if possible.

19. Fixed. Is it a requirement to use confirm_form()? I'm using it now but I don't like it as much as what I had originally because it fails to offer the 'Cancel' option as a button, rendering it as a link instead. Since they're both options, it seems that they should both be rendered in similar fashion.

If you want to change this standard in Drupal, then you are welcome to change it in Drupal core. :) Otherwise, when implementing "mainstream" functionality, you and everyone else is and should be following common module development practices. This ensures compatibility with other modules, simplifies theming for front-end developers, and in this case, also ensures security.

But truth to be told: Changing the link to a form button has been actively discussed for D7, but deferred to D8 due to missing consensus and activity on the issue. :)

20. Ok, here's where I defend my code. :) The intent here is to allow deletion of site index entries from the multi-value fieldset in the node edit form similar to way specific values can be deleted from multi-value CCK fields by deleting the value and submitting the form. The removal of editable values indicates the intended deletion of the related record. In any other fields on a node edit form, CCK or not, submission of empty fields indicates intended deletion of those values. Why not allow the deletion site index values as well?

IIRC, then this code was/is executed during editing (or similar) - and not during/after final form submission. The code needs to make sure that all stored data is persistent, and data is only deleted, when the user actively and actually requested the deletion. Just removing values during a multi-step form operation would not be a serious deletion request.

james marks’s picture

http://api.drupal.org/api/function/variable_get/6 does not query the database, it's a very fast function.

Good to know. (There's so much to learn... :) )

IIRC, I actually meant to drop the entire special destination handling. If you want a form to redirect to somewhere else (than the default page/path after submission), then you can simply pass a 'destination' query parameter to it:
http://example.com/path/to/form?destination=custom/redirect/path/to/end/on
Form API will respect this destination path and ignore any hard-coded path.

I did drop the entire special destination handling and am using the standard 'destination=' approach in links for any use of the siteindex_add_edit() form outside of the admin/build/siteindex URL. (The siteindex_add_edit_entry() form is also used for editing entries from the siteindex report, admin/reports/siteindex.) I'm using $form['#redirect'] as the default for the admin/build/siteindex URL. (Hope I'm still not misunderstanding your point.)

If you want to change this standard in Drupal, then you are welcome to change it in Drupal core. :) ... But truth to be told: Changing the link to a form button has been actively discussed for D7, but deferred to D8 due to missing consensus and activity on the issue. :)

I'd be an enthusiastic supporter of the two button approach (if I ever get to the point where I get to have any input on changing core). :)

Ok, here's where I defend my code. :) The intent here is to allow deletion of site index entries from the multi-value fieldset in the node edit form similar to way specific values can be deleted from multi-value CCK fields by deleting the value and submitting the form. The removal of editable values indicates the intended deletion of the related record. In any other fields on a node edit form, CCK or not, submission of empty fields indicates intended deletion of those values. Why not allow the deletion site index values as well?

IIRC, then this code was/is executed during editing (or similar) - and not during/after final form submission. The code needs to make sure that all stored data is persistent, and data is only deleted, when the user actively and actually requested the deletion. Just removing values during a multi-step form operation would not be a serious deletion request.

The code is executed upon submission, not editing. This code handles only fields that have been added to the node edit form (not added via a multi-step form) through the use of hook_form_alter() and only alters the stored data upon submission. Typically, when editing a node, altering or deleting values in non-required fields doesn't require the user to actively request or confirm the deletion of specific field values, does it? (I don't think it does but I obviously have much to learn. :) )

james marks’s picture

I find it extremely useful for a module to say "Hi, I'm installed, here's how to use me"

I found it useful as well. I thought it was a nice idea, given that the first place I usually go after installing a module is the module configuration settings. Having a link directly to it was handy.

james marks’s picture

Thanks! No time for a full review, sorry.

Thank you, by the way. Your review was extremely helpful. All the stuff I've developed to date has been for internal use and and doesn't get this kind of core-Drupal review. I'm going back to apply this stuff to some of the other internal modules I've written. (I have another module that I'd like to submit if this one gets accepted but that module needs some work at this point.)

sun’s picture

Still no time for a full review, but:

I'd be an enthusiastic supporter of the two button approach (if I ever get to the point where I get to have any input on changing core). :)

You, me, everyone, can! Just pick yourself an issue + work on it! :) This issue, for example, is discussed in

#116939: Add a Cancel link on forms
#772758: Delete confirm form, make the cancel link to button

However, as mentioned before, that particular topic is too late for D7. But you can always play http://drupal.org/bug-bingo or http://drupal.org/patch-bingo :)

If you want to see D7 out of the door earlier, you can always help to fix remaining bugs. Writing patches for Drupal core makes you learn to write even more awesome code :)

james marks’s picture

StatusFileSize
new15.39 KB

Uploading a screenshot.

James

avpaderno’s picture

Why did you decide to create a new module, rather than opening feature supports for the existing projects?

sun’s picture

I think James already described in the original motivation message. Without having actually looked at the mentioned modules or otherwise knowing them, I actually think this module makes sense (to some extent). It looks like James is going to be a happy community citizen, and the only remaining thing missing here seems to be a final security review.

james marks’s picture

StatusFileSize
new12.04 KB

Ok, all my function names are now "Good, modern, fancy: [subject]_[verb]":

siteindex_admin_list()
siteindex_admin_settings()
siteindex_cron()
siteindex_entries_get()
siteindex_entries_test_and_update()
siteindex_entry_add_edit()
siteindex_entry_add_edit_validate()
siteindex_entry_add_edit_submit()
siteindex_entry_cancel()
siteindex_entry_delete_submit()
siteindex_entry_get()
siteindex_entry_list()
siteindex_entry_path_autocomplete()
siteindex_entry_path_test()
siteindex_first_level_autocomplete()
siteindex_form_alter()
siteindex_form_alter_validate()
siteindex_form_alter_submit()
siteindex_help()
siteindex_invalid_entries_get()
siteindex_invalid_entries_report()
siteindex_menu()
siteindex_menu_rebuild()
siteindex_page()
siteindex_perm()
siteindex_test_for_duplicate_entries()
siteindex_theme()
theme_siteindex_entry_fieldset()
theme_siteindex_entry_list()

James

james marks’s picture

StatusFileSize
new12.03 KB

Refactored code for the following improvements:

  • Formatted index page output using theme_item_list() following feedback on #drupal-contribute.
  • Rewrote and simplified admin's index list page by constructing it as a simple array rather than a form and, consequently, removed unnecessary theme function.
  • Simplified stylesheet styles.

James

james marks’s picture

Why did you decide to create a new module, rather than opening feature supports for the existing projects?

The functionality we were looking for was so different from that provided by the existing modules that I felt it would be a better solution to create a separate module than to try to modify the functionality of existing modules:

  1. None of the other modules produce alphabetical "book-style" indexes which was a requirement for us.
  2. All of the other modules generate their output programmatically and the output consists of node titles, taxonomy terms, etc. We needed the ability to create and display multiple variations of custom index entries based on terms a user might think of to look for content.
  3. All of the other modules provide interfaces that allow the user to browse through or search for content but those interfaces require a level of technical competency and comfort. We wanted our index to be as simple as possible in a format that was familiar and accessible to any user: a list of terms, alphabetically ordered, in a book-style index format.

The site this module was written for is an intranet that serves as the primary portal for our staff to access information about our agency. Consequently, there is a fairly long and carefully maintained list of topics and content that we want our staff to have ready access to in a familiar and simple-to-use format.

Obviously, this module isn't the best solution for every web site but I'd think it could be for some.

James

james marks’s picture

StatusFileSize
new12.01 KB

Fixed a bug that interfered with deleting index entries that appeared after switching to using confirm_form().

James

james marks’s picture

OK! I think that marks the end of my last-minute adjustments. As far as I know this has everything sun asked for, could someone let me know if there's anything else I need to do?

James

avpaderno’s picture

Status: Needs review » Fixed

I approved the application as maintainer of Profile Plus (see http://drupal.org/node/866142).

Status: Fixed » Closed (fixed)
Issue tags: -Module review

Automatically closed -- issue fixed for 2 weeks with no activity.