You are here

function vud_denied_vote in Vote Up/Down 6.2

Same name and namespace in other branches
  1. 6.3 vud.module \vud_denied_vote()
  2. 7.2 vud.module \vud_denied_vote()
  3. 7 vud.module \vud_denied_vote()

Menu callback; show widget message.

1 string reference to 'vud_denied_vote'
vud_menu in ./vud.module
Implementation of hook_menu().

File

./vud.module, line 192

Code

function vud_denied_vote($js = FALSE, $code = VUD_WIDGET_MESSAGE_ERROR) {
  $widget_message_codes = array(
    VUD_WIDGET_MESSAGE_ERROR => t('Sorry, there was problem on the vote.'),
    VUD_WIDGET_MESSAGE_DENIED => t('You are not allowed to vote.'),
  );
  drupal_alter('vud_widget_message_codes', $widget_message_codes);
  if ($js) {
    ctools_include('ajax');
    ctools_include('modal');
    ctools_modal_render('', $widget_message_codes[$code]);
  }
  else {
    return $widget_message_codes[$code];
  }
}