function commons_answers_views_pre_render in Drupal Commons 6.2
Implementation of hook_views_pre_render().
File
- modules/
features/ commons_answers/ commons_answers.module, line 89
Code
function commons_answers_views_pre_render(&$view) {
if (user_access('create answer content') && $view->name == 'question_answers') {
$question_nid = $view->args[0];
// Generate a simplified Answer submission form and prepopulate it
// with the question NID.
$view->attachment_after = drupal_get_form('commons_answers_add_answer_form', $question_nid);
}
if (user_access('create question content') && in_array($view->name, array(
'all_questions',
'user_questions',
'group_tab_questions',
))) {
if ($view->name == 'group_tab_questions') {
// @TODO: This should support questions that are members of multiple groups.
$group_nid = $view->args[0];
}
$view->attachment_after = drupal_get_form('commons_answers_add_question_form', $group_nid);
}
}