Example #1
0
            break;
        case 'qanda':
            $buttonadd = get_string('addanewquestion', 'twf');
            break;
        default:
            $buttonadd = get_string('addanewdiscussion', 'twf');
            break;
    }
    echo '<input type="submit" value="' . $buttonadd . '" />';
    echo '</div>';
    echo '</form>';
    echo "</div>\n";
}
if ($ismember || $assessed || has_capability('mod/teamwork:editsettings', $PAGE->context)) {
    //Ouput team phrase assessments here
    $countsubmissions = count($DB->get_records('twf_discussions', array('twf' => $associate->twf, 'teamwork' => $w, 'instance' => $instanceid, 'phase' => $phase)));
    $perpage = get_user_preferences('teamwork_perpage', 10);
    $pagingbar = new paging_bar($countsubmissions, $page, $perpage, $PAGE->url, 'page');
    $discussions = $teamwork->get_phase_discussions($associate->twf, $instanceid, $phase, $page * $perpage, $perpage);
    $shownames = has_capability('mod/teamwork:viewauthornames', $teamwork->context);
    echo $output->render($pagingbar);
    foreach ($discussions as $discussion) {
        $discussion->authorid = $discussion->authoridx;
        echo $output->render($teamwork->prepare_discussion_summary($discussion, $shownames));
    }
    echo $output->render($pagingbar);
    echo $output->perpage_selector($perpage);
}
echo $output->box_end();
print_collapsible_region_end();
echo $output->footer();