http://atutor.ca/atutor/mantis/view.php?id=4574
[acontent.git] / docs / home / course / content.php
index 06edcda..fb09578 100644 (file)
@@ -256,18 +256,18 @@ if ($content_row['text'] == '' && empty($content_test_ids)){
        $msg->addInfo('NO_PAGE_CONTENT');
        $savant->assign('body', '');
 } else {
-       // find whether the body has alternatives defined
+    $content = ContentUtility::formatContent($content_row['text'], $content_row['formatting']);
+
+    // 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);
+       = ContentUtility::applyAlternatives($cid, $content, true);
 
        // apply alternatives
        if (intval($_GET['alternative']) > 0) {
-               $content = ContentUtility::applyAlternatives($cid, $content_row['text'], false, intval($_GET['alternative']));
+               $content = ContentUtility::applyAlternatives($cid, $content, false, intval($_GET['alternative']));
        } else {
-               $content = ContentUtility::applyAlternatives($cid, $content_row['text']);
+               $content = ContentUtility::applyAlternatives($cid, $content);
        }
-                
-       $content = ContentUtility::formatContent($content, $content_row['formatting']);
 
        $content_array = ContentUtility::getContentTable($content);