Example #1
0
<?php 
    }
    makeTopMenu();
    echo "<div id=\"headercourse\" class=\"pagetitle\"><h2>{$curname}</h2></div>\n";
    if (count($items) > 0) {
        if ($quickview == 'on' && isset($teacherid)) {
            echo '<style type="text/css">.drag {color:red; background-color:#fcc;} .icon {cursor: pointer;}</style>';
            echo "<script>var AHAHsaveurl = '{$imasroot}/course/savequickreorder.php?cid={$cid}';";
            echo 'var unsavedmsg = "' . _("You have unrecorded changes.  Are you sure you want to abandon your changes?") . '";';
            echo "</script>";
            echo "<script src=\"{$imasroot}/javascript/mootools.js\"></script>";
            echo "<script src=\"{$imasroot}/javascript/nested1.js?v=070214\"></script>";
            echo '<p><button type="button" onclick="quickviewexpandAll()">' . _("Expand All") . '</button> ';
            echo '<button type="button" onclick="quickviewcollapseAll()">' . _("Collapse All") . '</button></p>';
            echo '<ul id=qviewtree class=qview>';
            quickview($items, 0);
            echo '</ul>';
            echo '<p>&nbsp;</p>';
        } else {
            showitems($items, $_GET['folder']);
        }
    } else {
        if (isset($teacherid) && $quickview != 'on') {
            if ($_GET['folder'] == '0') {
                echo '<p><b>Welcome to your course!</b></p>';
                echo '<p>To start by copying from another course, use the <a href="copyitems.php?cid=' . $cid . '">Course Items: Copy</a> ';
                echo 'link along the left side of the screen.</p><p>If you want to build from scratch, use the "Add An Item" pulldown below to get started.</p><p>&nbsp;</p>';
            }
            echo generateadditem($_GET['folder'], 't');
        }
    }
            if ($pos === false) {
                $block['items'] = array();
            } else {
                $subarr = additems($pts[1]);
                $block['items'] = $subarr;
            }
            $outarr[] = $block;
        } else {
            //regular item
            $outarr[] = $it;
        }
    }
    return $outarr;
}
echo "OK";
require "courseshowitems.php";
$openblocks = array(0);
$prevloadedblocks = array(0);
if (isset($_COOKIE['openblocks-' . $cid]) && $_COOKIE['openblocks-' . $cid] != '') {
    $openblocks = explode(',', $_COOKIE['openblocks-' . $cid]);
    $firstload = false;
} else {
    $firstload = true;
}
if (isset($_COOKIE['prevloadedblocks-' . $cid]) && $_COOKIE['prevloadedblocks-' . $cid] != '') {
    $prevloadedblocks = explode(',', $_COOKIE['prevloadedblocks-' . $cid]);
}
$plblist = implode(',', $prevloadedblocks);
$oblist = implode(',', $openblocks);
quickview($newitems, 0);