You are here

function theme_modr8_message in modr8 6

Same name and namespace in other branches
  1. 5 modr8.module \theme_modr8_message()
  2. 7 modr8.module \theme_modr8_message()

Theming function for messages.

2 theme calls to theme_modr8_message()
modr8_form_alter in ./modr8.module
modr8_nodeapi in ./modr8.module
Implementation of hook_nodeapi().

File

./modr8.module, line 307
Easy dedicated content moderation

Code

function theme_modr8_message($teaser = FALSE, $nodetype = 'page', $op = 'view') {
  static $already_messaged = FALSE;

  // Don't add the message more than once per page load.
  if ($already_messaged) {
    return;
  }
  if ($teaser) {
    return ' <div class="marker">' . t('Pending moderation') . '</div>';
  }
  else {
    switch ($op) {
      case 'view':
        drupal_set_message(t("The post has been submitted for moderation and won't be listed publicly until it has been approved."), 'warning');
        break;
      case 'node_form':
        if (!user_access('bypass moderation queue')) {
          drupal_set_message(t('This %type will be submitted for moderation and will not be accessible to other users until it has been approved.', array(
            '%type' => node_get_types('name', $nodetype),
          )));
        }
        break;
    }
  }
  $already_messaged = TRUE;
}