예제 #1
0
$_tool_shortcuts = ContentUtility::getToolShortcuts($content_row);
//if it has test and forum associated with it, still display it even if the content is empty
if ($content_row['text'] == '' && empty($content_test_ids)) {
    $msg->addInfo('NO_PAGE_CONTENT');
    $savant->assign('body', '');
} else {
    // find whether the body has alternatives defined
    list($has_text_alternative, $has_audio_alternative, $has_visual_alternative, $has_sign_lang_alternative) = ContentUtility::applyAlternatives($cid, $content_row['text'], true);
    // apply alternatives
    if (intval($_GET['alternative']) > 0) {
        $content = ContentUtility::applyAlternatives($cid, $content_row['text'], false, intval($_GET['alternative']));
    } else {
        $content = ContentUtility::applyAlternatives($cid, $content_row['text']);
    }
    $content = ContentUtility::formatContent($content, $content_row['formatting']);
    $content_array = ContentUtility::getContentTable($content, $content_row['formatting']);
    $savant->assign('content_table', $content_array[0]);
    $savant->assign('body', $content_array[1]);
    $savant->assign('has_text_alternative', $has_text_alternative);
    $savant->assign('has_audio_alternative', $has_audio_alternative);
    $savant->assign('has_visual_alternative', $has_visual_alternative);
    $savant->assign('has_sign_lang_alternative', $has_sign_lang_alternative);
    $savant->assign('cid', $cid);
    //assign test pages if there are tests associated with this content page
    if (!empty($content_test_ids)) {
        $savant->assign('test_message', $content_row['test_message']);
        $savant->assign('test_ids', $content_test_ids);
    } else {
        $savant->assign('test_message', '');
        $savant->assign('test_ids', array());
    }