示例#1
0
if (!$param->edit) {
    $navlinks[] = array('name' => $streditingcategories, 'link' => '', 'type' => 'title');
} else {
    $navlinks[] = array('name' => $streditingcategories, 'link' => $thispageurl->out(), 'type' => 'title');
    $navlinks[] = array('name' => get_string('editingcategory', 'question'), 'link' => '', 'type' => 'title');
}
$navigation = build_navigation($navlinks);
print_header_simple($streditingcategories, '', $navigation, "", "", true, $strupdatemodule);
// print tabs
if ($cm !== null) {
    $currenttab = 'edit';
    $mode = 'categories';
    ${$cm->modname} = $module;
    include $CFG->dirroot . "/mod/{$cm->modname}/tabs.php";
} else {
    $currenttab = 'categories';
    $context = $contexts->lowest();
    include 'tabs.php';
}
// display UI
if (!empty($param->edit)) {
    $qcobject->edit_single_category($param->edit);
} else {
    if ($questionstomove) {
        $qcobject->display_move_form($questionstomove, $category);
    } else {
        // display the user interface
        $qcobject->display_user_interface();
    }
}
print_footer($COURSE);
示例#2
0
                            $qcobject->publish_category(true, $param->publish);
                        } else {
                            if (!empty($param->addcategory)) {
                                $param->newparent = required_param('newparent', PARAM_INT);
                                $param->newcategory = required_param('newcategory', PARAM_NOTAGS);
                                $param->newinfo = required_param('newinfo', PARAM_NOTAGS);
                                $param->newpublish = required_param('newpublish', PARAM_INT);
                                $qcobject->add_category($param->newparent, $param->newcategory, $param->newinfo, $param->newpublish, $course->id);
                            } else {
                                if (!empty($param->edit)) {
                                    $qcobject->edit_single_category($param->edit, $param->page);
                                } else {
                                    if (!empty($param->updateid)) {
                                        $param->updateparent = required_param('updateparent', PARAM_INT);
                                        $param->updatename = required_param('updatename', PARAM_NOTAGS);
                                        $param->updateinfo = required_param('updateinfo', PARAM_NOTAGS);
                                        $param->updatepublish = required_param('updatepublish', PARAM_INT);
                                        $qcobject->update_category($param->updateid, $param->updateparent, $param->updatename, $param->updateinfo, $param->updatepublish, $course->id);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
// display the user interface
$qcobject->display_user_interface($param->page);
print_footer($course);