I'm using the Event module and I'm trying to disable some calendar views - when I click the calendar, I get a row of links with 'month', 'week', 'day' and 'list' (since I'm using 'table' view as default).

Is there a way to disable all calendar views except table?

Thanks in advance.

Comments

hip’s picture

I need it too. I looked for it. I (think) I found it:
http://drupal.org/node/54292#comment-83135

I haven't tried it yet. (too many coding hours today).

Good luck & enjoy,
hip

hip’s picture

If you want it 'really simple' you can comment out the following line (416) in the event.theme file

function theme_event_links($links, $view) {
  //return theme('links', $links);
}

This will remove the whole menu for the different views of the calendar. This way it will show up as the default view defined by you in the module configuration page. (In my case I set it up to 'list')

If you want some other view you could do some extra work on the $links var/array (dunno), or just harcode the links to the view options you want to offer, within the theme_event_links function. As I don't need it I didn't go any further.

(If you' want not to able the different views at all, even for users handwriting the URLs, you could 'empty up' the different view functions within the same file, but I believe that's a bit paranoic & makes no security improvement).

Have a good day,
hip

lias’s picture

I tried the mod. to event.theme but it didn't work for me so instead I did this:

Modified event.module lines 26-33 to get rid of calendar link on event pages:

from this-

if ($type == 'node') {
// node links
if (event_enabled_state($node->type) == 'all') {
$links[] = l(t('calendar'), 'event/'. format_date($node->event_start, 'custom', 'Y/m/d'));
}
elseif (event_enabled_state($node->type) == 'solo') {
$links[] = l(t('calendar'), 'event/'. format_date($node->event_start, 'custom', 'Y/m/d') .'/month/'. $node->type);
}

to this-

if ($type == 'node') {
// node links
if (event_enabled_state($node->type) == 'all') {
$links[] = l(t(''), 'event/'. format_date($node->event_start, 'custom', 'Y/m/d'));
}
elseif (event_enabled_state($node->type) == 'solo') {
$links[] = l(t(''), 'event/'. format_date($node->event_start, 'custom', 'Y/m/d') .'/month/'. $node->type);
}

Lsabug