You are here

function faq_ask_block_view in FAQ_Ask 7

Implements hook_block_view().

File

./faq_ask.module, line 2007
This module is an add-on to the FAQ module that allows users with the 'ask question' permission to create a question which will be queued for an 'expert' to answer.

Code

function faq_ask_block_view($delta = '') {
  global $user;
  $block = array();
  switch ($delta) {
    case 'unanswered':

      // Unanswered Questions.
      $block['subject'] = t('Unanswered questions');
      $block['content'] = _faq_ask_list_unanswered(variable_get('faq_unanswered_count', 3));
      break;
    case 'ask_a_question':

      // Ask a question block.
      if (user_access('ask question')) {

        // #827426: Senpai
        $block['subject'] = t('Ask a Question');
        $block['content'] = faq_ask_a_question_blockform();
      }
  }

  // end switch($delta).
  return $block;
}