Ejemplo n.º 1
0
echo '</table>';
echo '<div class="buttons">';
/// Print link to create a new course
if (has_capability('moodle/course:create', $context)) {
    unset($options);
    if (!empty($category->id)) {
        $options['category'] = $category->id;
        print_single_button('edit.php', $options, get_string('addnewcourse'), 'get');
    }
}
if (has_capability('moodle/site:approvecourse', $sysctx) and !empty($CFG->enablecourserequests)) {
    print_single_button('pending.php', NULL, get_string('coursespending'), 'get');
}
// admin page does not allow custom buttons in the navigation bar
echo '<div class="singlebutton">';
echo update_categories_button();
echo '</div></div>';
print_footer();
function print_category_edit($category, $displaylist, $parentslist, $depth = -1, $up = false, $down = false)
{
    /// Recursive function to print all the categories ready for editing
    global $CFG, $USER;
    static $str = '';
    if (empty($str)) {
        $str->delete = get_string('delete');
        $str->moveup = get_string('moveup');
        $str->movedown = get_string('movedown');
        $str->edit = get_string('editthiscategory');
        $str->hide = get_string('hide');
        $str->show = get_string('show');
    }
Ejemplo n.º 2
0
function print_category_edit_header()
{
    global $CFG;
    global $SITE;
    if (has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
        require_once $CFG->libdir . '/adminlib.php';
        admin_externalpage_setup('coursemgmt');
        admin_externalpage_print_header();
    } else {
        print_header("{$SITE->shortname}:" . get_string('categories'), get_string('courses'), build_navigation(array(array('name' => get_string('categories'), 'link' => '', 'type' => 'misc'))), '', '', true, update_categories_button());
    }
}