Thats too bad, this is a really useful module for adding data to taxonomy terms and vocubularies. There is a patch brewing, but its just not ready yet. I had a client that was using taxonomy to define seasons for products (for example "Fall 08", "Holiday 09", etc). The taxonomy part was working great, but how do you know when a season starts or ends? These aren't necessarily your standard spring/summer/fall/winter, they can be fairly arbitrary. It would be nice to be able to store that information about a term without having to write a whole custom module, but unfortunately no Taxonomy Enhancer.
So how hard is it to replicate the functinality from that module? Not too much trouble, just 2 hooks in fact.
hook_form_alter() checking for a $form_id of 'taxonomy_form_term' will let us add the fields to the page. In our case we only wanted this for terms in one vocabulary, so we also checked the vid and that the user had permission to edit the product seasons.
the second part is using hook_taxonomy() to save the date. This hook gets called anytime a term or vcabulary is inserted, updated, or deleted. So we check to make sure that
- its a term being modified (not a vocabulary) ($type == 'term')
- its in the the vocabulary we're interested in ($array['vid'] == SEASON_VID)
- the user has permission to edit this kind of data (user_access('administer seasons'))
If all of the above are true we store the data, and we're free to call it back later and make sure we're only showing the user the product seasons s/he is supposed to see!
Filed in:
drupal, tech Tagged with:
modules, hooks
Going to my second DrupalCon, in my hometown no less! Also, on the lookout for spare nodes :)
I'm happy to be able to be an individual sponsor of DrupalCon DC as well. Even though my company is also a sponsor and they pay my salary, Drupal has allowed me to make a living using software I enjoy over the last couple of years. I'm happy to provide something back.
recently I needed to add an imap extension to php, which uses the c-client library. normally this means recompiling php with --with-imap and --with-imap-ssl flags set, a major headache, but on ubuntu makes it easy.
karl@db1:~$ apt-cache search c-client
...
libc-client2007 - UW c-client library for mail protocols
libc-client2007-dev - UW c-client library for mail protocols (development)
...
karl@db1:~$ sudo apt-get install libc-client2007 libc-client2007-dev
[ubuntu fetches and installs library]
karl@db1:~$ apt-cache search php5-imap
php5-imap - IMAP module for php5
karl@db1:~$ sudo apt-get install php5-imap
[ubuntu installs imap extension]
karl@db1:~$ sudo /etc/init.d/apache2 restart
[apache restarts]
and now phpinfo() shows c-client running with imap and SSL support on, and I'm free to use imap_open() and all the other php imap functions I need to complete my email-to-unfudle-ticket script. Connecting to a gmail account especially requires the use of SSL, so I'm glad that was included.
[imap]
IMAP c-Client Version => 2004
SSL Support => enabled
Kerberos Support => enabled
thanks to chris fuller for helping me out!
Filed in:
tech Tagged with:
ubuntu, php, unfuddle, imap, gmail
Latest Comments