Fivestar modul field-jéhez egyedi hozzáférés vagy megjelenítés

burney képe

Sziasztok!

A fivestar modullal egy node-onkénti szavazást valósítottam meg. Minden node tartalmára lehet szavazni egy 1-10-es skálán. Szeretnék egy egyedi logikát alkalmazni aszerint, hogy mely node-okra lehet szavazni és melyekre nem. Első körben azzal próbálkoztam, hogy a fivestar egy saját hook-ját hívom meg egy saját modulban.

Az alkalmazott hook:

  1. /**
  2.  * Implementation of hook_fivestar_access().
  3.  *
  4.  * This hook is called before every vote is cast through Fivestar. It allows
  5.  * modules to allow or deny voting on any type of entity, such as nodes, users, or
  6.  * comments.
  7.  *
  8.  * @param $entity_type
  9.  * Type entity.
  10.  * @param $id
  11.  * Identifier within the type.
  12.  * @param $tag
  13.  * The VotingAPI tag string.
  14.  * @param $uid
  15.  * The user ID trying to cast the vote.
  16.  *
  17.  * @return boolean or NULL
  18.  * Returns TRUE if voting is supported on this object.
  19.  * Returns NULL if voting is not supported on this object by this module.
  20.  * If needing to absolutely deny all voting on this object, regardless
  21.  * of permissions defined in other modules, return FALSE. Note if all
  22.  * modules return NULL, stating no preference, then access will be denied.
  23.  *
  24.  * @see fivestar_validate_target()
  25.  * @see fivestar_fivestar_access()
  26.  */
  27. function hook_fivestar_access($entity_type, $id, $tag, $uid) {
  28. if ($uid == 1) {
  29. // We are never going to allow the admin user case a fivestar vote.
  30. return FALSE;
  31. }
  32. }

A modulom nevét a hook helyére írtam, de semmire sem reagál, bármi is a return.

Azt szeretném kérdezni, hogy milyen más módszert alkalmazhatnék (vagy ebben mit rontok el) annak érdekében, hogy a fivestar field-je vagy tűnjön el, vagy inaktív legyen. (Próbáltam mint field-et eltüntetni, de nem jutottam sikerre.) Ezt lehetőleg a modulban kell elvégeznem, mert a hozzátartozó logika is ott került megvalósításra.

Előre is köszönöm!

Melyik modulhoz, modulokhoz kapcsolódik a téma?: 
Drupal verzió: