[development] Theme subscription's links from notifications

Jørn Fauske jfauske at gmail.com
Tue Feb 9 07:41:50 UTC 2010


Hi,

If I understand your issue correctly maybe "wrapping" your code with this
would do the trick?


foreach($links as $module => $link) {
    if (strstr($module, 'notifications')) {
      //your stuff here
    }
  }

Best regards,

Jørn Fauske

On Mon, Feb 8, 2010 at 11:33 PM, Salvatore De Paolis <iwkse at gmx.com> wrote:

> Hi,
> i'd like to theme the links created by the notifications module, like
> subscribe
> to content, type, author, ecc.
> For doing that i'm try to hook the link_alter and overwrite the link in the
> way:
>
> global $user;
> $options = notifications_ui_subscribe_options($user, 'node', $user);
> $i = 0;
> foreach ($options as $index => $option) {
>        $notify = 'notifications_' . $i;
>        if ($option['type'] == 'thread') {
>                $links[$notify]['title'] = "New title";
>                $links[$notify]['attributes']['title'] = "New attribute
> title";
>        }
>        if ($option['type'] == 'nodetype') {
>                $links[$notify]['title'] = "New title";
>                $links[$notify]['attributes']['title'] = "New attribute
> title";
>        }
>        ...
>        $i++;
> }
>
> I have two issues with this code. First, the notifications_ class is also
> used
> with the taxonomy module, and this means when i do this change the Tags is
> affected too.
> Second, $option['type'] == 'nodetype' would match all types (profile,
> group,
> ecc) and I can't really switch from that.
>
> Anyone know a better way or some more info to make this code to work?
>
> Thanks in advance
> Sal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20100209/3c1f00d4/attachment.html 


More information about the development mailing list