I was unable to find a module that allowed users to restrict what taxonomy vocabularies could be made available as option lists in webforms so quickly put this one together.
Simply check what taxonomy vocabularies you want to allow site editors to use here admin/config/content/webform-taxonomy then let them use those vocabularies as preset lists when building a webform.
This has been built for Drupal 7 only at the moment, I may write a backport for Drupal 6 if there are any requests and webform module allowing ;)
Sandbox: http://drupal.org/sandbox/adamelleston/1502752
git repo: git clone --branch master adamelleston@git.drupal.org:sandbox/adamelleston/1502752.git webform_vocabularies
Feedback very much welcome
Comments
Comment #1
jpontani commentedYou have nested directories that you should get rid of. The main branch of your project should only be the module files (not the module directory itself). In this case, the only files that should be available on your repo should be .info and .module, with no parent directories.
You may include subdirectories if you need them, such ass css, js, images, includes, etc.
Automated Review
Due to the structure of the current repo, automated review will not run.
Manual Review
Your function comments should follow Doxygen style formatting. See Doxygen and comment formatting conventions
Code Style (I am not as thorough as the automated review, but I am seeing some)
webform_vocabularies_menu
- You do not need to specify an access callback if you are using user_access, as it it defaulted to that unless otherwise inherited from the parent menu item.
webform_vocabularies_admin_settings
- No need to store the return form of system_settings_form and then just return it; just return it right away:
webform_vocabularies_webform_select_options_info
- You don't need to run an additional boolean check if the vocab is an object or not, as taxonomy_vocabulary_load returns FALSE if it cannot load the object:
With that said, there is a discussion being had as to how much code is required to allow for the vetted git user access. The general consensus is that anything with less than 120 lines of code or less than 5 functions cannot be seriously reviewed. However, we can promote this single project manually to a full project or - if possible - you can try to add more functionality/code to this one. Possibly add the ability for certain users to bypass this restriction, or add the functionality to allow certain vocabularies to webforms if they are attached to specific content types, etc (these are just random ideas, whether or not they work or are usable is neither here nor there :)).
Comment #2
Jeffrey C. commentedAnother link you can check out: Coding Standards.
Comment #3
adamelleston commented