Two new Drupal modules

Two new Drupal modules

Posted 06/06/2009 - 12:18 by State68

Edit: make sure to download version 2 of Tutor Allocate - the first version I uploaded inlcuded the firep() function, which is used with Drupal for Firebug but throws up error messages if Drupal for Firebug isn't installed. Version 2 has all references to firep() removed.

I've written four custom modules as part of the big Drupal site I'm working on. Two of these modules are very site-specific (one does a load of validation for the custom content types the site uses; the other one displays a hard-coded View which is really only relevant to the site it was written for). The other two might be useful for other projects, so here they are.

The first module is called Tutor Allocate. Imagine a Drupal site where you've got three user roles: teacher, student and administrator. Administrator should be able to allocate each student to a teacher when the student's user account is created. That's what this module does.

Once students have been allocated to teachers, teachers might want to create a piece of content which is in some way related to a specific student that has been allocated to them. For example, a school report. The module allows administrators to add a drop-down to any content type. That drop-down contains the names of the students that have been allocated to the currently logged in user.

Tutor Allocate is exposed to Views, so you can, for example, create a view which lists all the school reports created by a teacher. Each item in the view can include the student's name.

There are a number of Drupal modules that do similar things - the various friend and buddy list modules, for example - but none of these seem to allow for an administrator to easily create a relationship between two users, and they don't let you add the drop-down to the content creation form.

There's a lot of work to do on this module - the code is a bit messy, and I'd like to add bits of AHAH to the user creation form to make things a bit slicker - but it is functional. Once I get my Drupal CVS account I'll start work on tidying this up and making it more generally usable. I've got various ideas regarding how teh module can be improved, and I'll soon have time to work on it.

The second module I'm releasing is called Node Counter. It creates a block which contains a count of nodes of types selected by an administrator. At the moment it's pretty inflexible, but the code is so simple that it can easily be changed.

I envisage lots of cool ways that Node Counter could be developed (I think it might have a broader appeal than Tutor Allocate, despite the latter doing more actual stuff at the moment). Integration with Views, for example, so that a count could be made of any given View and then displayed in a block. Creation of multiple blocks. Integration with the Token module, so that it would be possible to create new tokens which represented the number of items in a given View.

Download, enjoy, tear to pieces, let me know.

AttachmentSize
tutor_allocate_2_v2.zip7.86 KB
nodecounter.zip1.66 KB
tutor_allocate_2.zip7.88 KB
how to set the dropdown list multiple selections

It's easy to use and useful for me, but how can I make the dropdown list multiple selections?
please tell me how to do, thank u.

Posted by Anonymous on Tue, 09/01/2009 - 05:25
Thank you for the hard work

I Read through our things and saw the is allot of effort that went into this project,

still needs a bit of streamlining but Iam sure this will be a great project!

Keep up the hard work!!! :)

regards
Vince

Posted by Anonymous on Wed, 06/17/2009 - 08:17
implement in Drupal 7

How can i implement in drupal 7.

thanx...

Posted by Anonymous on Sun, 08/07/2011 - 10:43
To get the module to work

To get the module to work with Drupal 7 it would need to be updated as per the instructions at

http://drupal.org/node/224333

I'm afraid I don't have time to work on this at the moment. It may be possible, however, to achieve the functionality you are looking for with already-existing Drupal 7 modules: the best place to find out would probably be

http://drupal.org/forum/22

Good luck!

Posted by State68 on Tue, 08/09/2011 - 00:29