コード例 #1
0
if (!get_user_preferences('message_usehtmleditor', 0)) {
    $CFG->htmleditor = '';
}
$msgform = new user_message_form('user_bulk_message.php');
if ($msgform->is_cancelled()) {
    redirect($return);
} else {
    if ($formdata = $msgform->get_data()) {
        $options = new object();
        $options->para = false;
        $options->newlines = true;
        $options->smiley = false;
        $msg = format_text($formdata->messagebody, $formdata->format, $options);
        $in = implode(',', $SESSION->bulk_users);
        $userlist = $DB->get_records_select_menu('user', "id IN ({$in})", null, 'fullname', 'id,' . $DB->sql_fullname() . ' AS fullname');
        $usernames = implode(', ', $userlist);
        $optionsyes = array();
        $optionsyes['confirm'] = 1;
        $optionsyes['sesskey'] = sesskey();
        $optionsyes['msg'] = $msg;
        admin_externalpage_print_header();
        print_heading(get_string('confirmation', 'admin'));
        print_box($msg, 'boxwidthnarrow boxaligncenter generalbox', 'preview');
        notice_yesno(get_string('confirmmessage', 'bulkusers', $usernames), 'user_bulk_message.php', 'user_bulk.php', $optionsyes, NULL, 'post', 'get');
        admin_externalpage_print_footer();
        die;
    }
}
admin_externalpage_print_header();
$msgform->display();
admin_externalpage_print_footer();
コード例 #2
0
        } else {
            if (file_exists("{$choose}/README.txt")) {
                print_simple_box_start("center");
                $file = file("{$choose}/README.txt");
                echo format_text(implode('', $file), FORMAT_MOODLE);
                print_simple_box_end();
            }
        }
        print_continue("{$CFG->wwwroot}/");
        admin_externalpage_print_footer();
        exit;
    } else {
        error("Could not set the theme!");
    }
}
admin_externalpage_print_header('themeselector');
print_heading($strthemes);
$themes = get_list_of_plugins("theme");
$sesskey = !empty($USER->id) ? $USER->sesskey : '';
echo "<table style=\"margin-left:auto;margin-right:auto;\" cellpadding=\"7\" cellspacing=\"5\">\n";
if (!$USER->screenreader) {
    echo "\t<tr class=\"generaltableheader\">\n\t\t<th scope=\"col\">{$strtheme}</th>\n";
    echo "\t\t<th scope=\"col\">{$strinfo}</th>\n\t</tr>\n";
}
$original_theme = fullclone($THEME);
foreach ($themes as $theme) {
    unset($THEME);
    if (!file_exists($CFG->themedir . '/' . $theme . '/config.php')) {
        // bad folder
        continue;
    }
コード例 #3
0
ファイル: index.php プロジェクト: veritech/pare-project
                notify("No logs found!");
                print_footer($course);
            }
            exit;
        case 'downloadasexcel':
            if (!print_log_xls($course, $user, $date, 'l.time DESC', $modname, $modid, $modaction, $group)) {
                notify("No logs found!");
                print_footer($course);
            }
            exit;
    }
} else {
    if ($hostid != $CFG->mnet_localhost_id || $hostid == $CFG->mnet_localhost_id && $course->id == SITEID) {
        $adminroot = admin_get_root();
        admin_externalpage_setup('reportlog', $adminroot);
        admin_externalpage_print_header($adminroot);
    } else {
        print_header($course->shortname . ': ' . $strlogs, $course->fullname, "<a href=\"{$CFG->wwwroot}/course/view.php?id={$course->id}\">{$course->shortname}</a> -> \n                      <a href=\"{$CFG->wwwroot}/course/report.php?id={$course->id}\">{$strreports}</a> ->\n                      {$strlogs}", '');
    }
    print_heading(get_string('chooselogs') . ':');
    print_log_selector_form($course, $user, $date, $modname, $modid, $modaction, $group, $showcourses, $showusers, $logformat);
    echo '<br />';
    print_heading(get_string('chooselivelogs') . ':');
    echo '<center><h3>';
    link_to_popup_window('/course/report/log/live.php?id=' . $course->id, 'livelog', get_string('livelogs'), 500, 800);
    echo '</h3></center>';
}
if ($hostid != $CFG->mnet_localhost_id || $course->id == SITEID) {
    admin_externalpage_print_footer($adminroot);
} else {
    print_footer($course);
コード例 #4
0
$focus = '';
if (empty($adminroot->errors) and $newsettingshtml === '') {
    // there must be either redirect without message or continue button or else upgrade would be sometimes broken
    if ($return == 'site') {
        redirect("{$CFG->wwwroot}/");
    } else {
        redirect("{$CFG->wwwroot}/{$CFG->admin}/index.php");
    }
}
if (!empty($adminroot->errors)) {
    $firsterror = reset($adminroot->errors);
    $focus = $firsterror->id;
}
// and finally, if we get here, then there are new settings and we have to print a form
// to modify them
admin_externalpage_print_header($focus);
if (!empty($SITE->fullname) and !empty($SITE->shortname)) {
    echo $OUTPUT->box(get_string('upgradesettingsintro', 'admin'), 'generalbox');
}
echo '<form action="upgradesettings.php" method="post" id="adminsettings">';
echo '<div>';
echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
echo '<input type="hidden" name="return" value="' . $return . '" />';
echo '<fieldset>';
echo '<div class="clearer"><!-- --></div>';
echo $newsettingshtml;
echo '</fieldset>';
echo '<div class="form-buttons"><input class="form-submit" type="submit" value="' . get_string('savechanges', 'admin') . '" /></div>';
echo '</div>';
echo '</form>';
echo $OUTPUT->footer();
コード例 #5
0
function html_header($course, $wdir, $pagetitle = "", $formfield = "")
{
    global $CFG, $ME, $choose, $COURSE, $OUTPUT, $PAGE;
    $coursecontext = get_context_instance(CONTEXT_COURSE, $COURSE->id);
    $navlinks = array();
    // $navlinks[] = array('name' => $course->shortname, 'link' => "../course/view.php?id=$course->id", 'type' => 'misc');
    $strfiles = get_string("morslefiles", 'block_morsle');
    $dirs = explode("/", $wdir);
    $numdirs = count($dirs);
    $link = "";
    if (has_capability('moodle/course:update', $coursecontext)) {
        $navlinks[] = array('name' => $strfiles, 'link' => $ME . "?id={$course->id}&amp;wdir=/&amp;choose={$choose}", 'type' => 'misc');
    }
    for ($i = 1; $i < $numdirs - 1; $i++) {
        $link .= "/" . urlencode($dirs[$i]);
        $navlinks[] = array('name' => $dirs[$i], 'link' => $ME . "?id={$course->id}&amp;wdir={$link}&amp;choose={$choose}", 'type' => 'misc');
    }
    $navlinks[] = array('name' => $dirs[$numdirs - 1], 'link' => null, 'type' => 'misc');
    $navigation = build_navigation($navlinks);
    if ($choose) {
        print_header();
        $chooseparts = explode('.', $choose);
        if (count($chooseparts) == 2) {
            ?>
		<script type="text/javascript">
		//<![CDATA[
		function set_value(txt) {
			opener.document.forms['<?php 
            echo $chooseparts[0] . "']." . $chooseparts[1];
            ?>
.value = txt;
			window.close();
		}
		//]]>
		</script>

		<?php 
        } elseif (count($chooseparts) == 1) {
            ?>
		<script type="text/javascript">
		//<![CDATA[
		function set_value(txt) {
			opener.document.getElementById('<?php 
            echo $chooseparts[0];
            ?>
').value = txt;
			window.close();
		}
		//]]>
		</script>

		<?php 
        }
        $fullnav = '';
        $i = 0;
        foreach ($navlinks as $navlink) {
            // If this is the last link do not link
            if ($i == count($navlinks) - 1) {
                $fullnav .= $navlink['name'];
            } else {
                $fullnav .= '<a href="' . $navlink['link'] . '">' . $navlink['name'] . '</a>';
            }
            $fullnav .= ' -> ';
            $i++;
        }
        $fullnav = substr($fullnav, 0, -4);
        $fullnav = str_replace('->', '&raquo;', format_string($course->shortname) . " -> " . $fullnav);
        echo '<div id="nav-bar">' . $fullnav . '</div>';
        if ($course->id == SITEID and $wdir != "/backupdata") {
            print_heading(get_string("publicsitefileswarning3"), "center", 2);
        }
    } else {
        if ($course->id == SITEID) {
            if ($wdir == "/backupdata") {
                admin_externalpage_setup('frontpagerestore');
                admin_externalpage_print_header();
            } else {
                admin_externalpage_setup('sitefiles');
                admin_externalpage_print_header();
                print_heading(get_string("publicsitefileswarning3"), "center", 2);
            }
        } else {
            echo $OUTPUT->header();
            //			print_header($pagetitle, $course->fullname, $navigation,  $formfield);
        }
    }
    echo "<table border=\"0\" style=\"margin-left:auto;margin-right:auto;min-width:100%\" cellspacing=\"3\" cellpadding=\"3\" >";
    echo "<tr>";
    echo "<td colspan=\"2\">";
    die;
}
コード例 #6
0
ファイル: definelib.php プロジェクト: JackCanada/moodle-hacks
function profile_edit_field($id, $datatype, $redirect)
{
    global $CFG;
    if (!($field = get_record('user_info_field', 'id', $id))) {
        $field = new object();
        $field->datatype = $datatype;
    }
    require_once 'index_field_form.php';
    $fieldform = new field_form(null, $field->datatype);
    $fieldform->set_data($field);
    if ($fieldform->is_cancelled()) {
        redirect($redirect);
    } else {
        if ($data = $fieldform->get_data()) {
            require_once $CFG->dirroot . '/user/profile/field/' . $datatype . '/define.class.php';
            $newfield = 'profile_define_' . $datatype;
            $formfield = new $newfield();
            $formfield->define_save($data);
            profile_reorder_fields();
            profile_reorder_categories();
            redirect($redirect);
        }
        $datatypes = profile_list_datatypes();
        if (empty($id)) {
            $strheading = get_string('profilecreatenewfield', 'admin', $datatypes[$datatype]);
        } else {
            $strheading = get_string('profileeditfield', 'admin', $field->name);
        }
        /// Print the page
        admin_externalpage_print_header();
        print_heading($strheading);
        $fieldform->display();
        admin_externalpage_print_footer();
        die;
    }
}
コード例 #7
0
ファイル: index.php プロジェクト: NextEinstein/riverhills
function html_header($course, $wdir, $formfield = "")
{
    # HU, CS Repository plugin support
    global $CFG, $ME, $choose, $repository, $scheme;
    $navlinks = array();
    if ($course->id == SITEID) {
        $strfiles = get_string("sitefiles");
    } else {
        $strfiles = get_string("files");
    }
    if ($wdir == "/") {
        $navlinks[] = array('name' => $strfiles, 'link' => null, 'type' => 'misc');
    } else {
        $dirs = explode("/", $wdir);
        $numdirs = count($dirs);
        $link = "";
        $navlinks[] = array('name' => $strfiles, 'link' => $ME . "?id={$course->id}&amp;wdir=/&amp;choose={$choose}" . $repository->get_arg(), 'type' => 'misc');
        for ($i = 1; $i < $numdirs - 1; $i++) {
            $link .= "/" . urlencode($dirs[$i]);
            $navlinks[] = array('name' => $dirs[$i], 'link' => $ME . "?id={$course->id}&amp;wdir={$link}&amp;choose={$choose}" . $repository->get_arg(), 'type' => 'misc');
        }
        $navlinks[] = array('name' => $dirs[$numdirs - 1], 'link' => null, 'type' => 'misc');
    }
    $navigation = build_navigation($navlinks);
    # HU, CS Repository plugin support
    $page = podcaster_page::create_page($c = null);
    $csslink = $page->get_stylesheet();
    if ($choose) {
        # HU, CS Repository plugin support
        print_header('', '', '', '', $csslink);
        $chooseparts = explode('.', $choose);
        if (count($chooseparts) == 2) {
            ?>
            <script type="text/javascript">
            //<![CDATA[
            function set_value(txt) {
                opener.document.forms['<?php 
            echo $chooseparts[0] . "']." . $chooseparts[1];
            ?>
.value = txt;
                window.close();
            }
            //]]>
            </script>

            <?php 
        } elseif (count($chooseparts) == 1) {
            ?>
            <script type="text/javascript">
            //<![CDATA[
            function set_value(txt) {
                opener.document.getElementById('<?php 
            echo $chooseparts[0];
            ?>
').value = txt;
                window.close();
            }
            //]]>
            </script>

            <?php 
        }
        $fullnav = '';
        $i = 0;
        foreach ($navlinks as $navlink) {
            // If this is the last link do not link
            if ($i == count($navlinks) - 1) {
                $fullnav .= $navlink['name'];
            } else {
                $fullnav .= '<a href="' . $navlink['link'] . '">' . $navlink['name'] . '</a>';
            }
            $fullnav .= ' -> ';
            $i++;
        }
        $fullnav = substr($fullnav, 0, -4);
        $fullnav = str_replace('->', '&raquo;', format_string($course->shortname) . " -> " . $fullnav);
        # HU, CS Repository plugin support
        echo '<div id="nav-bar"><img src="' . $CFG->pixpath . '/mod/podcaster/icon.gif" alt="podcaster">&nbsp;' . $fullnav . '</div>';
        if ($course->id == SITEID and $wdir != "/backupdata") {
            print_heading(get_string("publicsitefileswarning"), "center", 2);
        }
    } else {
        if ($course->id == SITEID) {
            if ($wdir == "/backupdata") {
                admin_externalpage_setup('frontpagerestore');
                admin_externalpage_print_header();
            } else {
                admin_externalpage_setup('sitefiles');
                admin_externalpage_print_header();
                print_heading(get_string("publicsitefileswarning"), "center", 2);
            }
        } else {
            print_header("{$course->shortname}: {$strfiles}", $course->fullname, "<a href=\"../../../course/view.php?id={$course->id}\">{$course->shortname}" . "</a> -> {$fullnav}", $formfield, $csslink);
        }
    }
    echo "<table border=\"0\" style=\"margin-left:auto;margin-right:auto\" cellspacing=\"3\" cellpadding=\"3\" width=\"640\">";
    echo "<tr>";
    echo "<td colspan=\"2\">";
    # HU, CS Repository plugin support
    echo '<div id="mod-podcaster-upload-headline">' . podcaster_util::get_string('repository_' . $repository->name . '_desc') . '</div>';
    echo '</tr><tr><td colspan="2">';
}
コード例 #8
0
ファイル: index.php プロジェクト: nadavkav/MoodleTAO
function print_category_edit_header()
{
    global $CFG;
    global $SITE;
    require_once $CFG->libdir . '/adminlib.php';
    admin_externalpage_setup('coursemgmt', update_category_button());
    admin_externalpage_print_header();
}
コード例 #9
0
function html_header($course, $wdir, $formfield = "")
{
    global $CFG, $ME, $choose;
    if ($course->id == SITEID) {
        $strfiles = get_string("sitefiles");
    } else {
        $strfiles = get_string("files");
    }
    if ($wdir == "/") {
        $fullnav = "{$strfiles}";
    } else {
        $dirs = explode("/", $wdir);
        $numdirs = count($dirs);
        $link = "";
        $navigation = "";
        for ($i = 1; $i < $numdirs - 1; $i++) {
            $navigation .= " -> ";
            $link .= "/" . urlencode($dirs[$i]);
            $navigation .= "<a href=\"" . $ME . "?id={$course->id}&amp;wdir={$link}&amp;choose={$choose}\">" . $dirs[$i] . "</a>";
        }
        $fullnav = "<a href=\"" . $ME . "?id={$course->id}&amp;wdir=/&amp;choose={$choose}\">{$strfiles}</a> {$navigation} -> " . $dirs[$numdirs - 1];
    }
    if ($choose) {
        print_header();
        $chooseparts = explode('.', $choose);
        if (count($chooseparts) == 2) {
            ?>
            <script type="text/javascript">
            //<![CDATA[
            function set_value(txt) {
                opener.document.forms['<?php 
            echo $chooseparts[0] . "']." . $chooseparts[1];
            ?>
.value = txt;
                window.close();
            }
            //]]>
            </script>

            <?php 
        } elseif (count($chooseparts) == 1) {
            ?>
            <script type="text/javascript">
            //<![CDATA[
            function set_value(txt) {
                opener.document.getElementById('<?php 
            echo $chooseparts[0];
            ?>
').value = txt;
                window.close();
            }
            //]]>
            </script>

            <?php 
        }
        $fullnav = str_replace('->', '&raquo;', format_string($course->shortname) . " -> {$fullnav}");
        echo '<div id="nav-bar">' . $fullnav . '</div>';
        if ($course->id == SITEID and $wdir != "/backupdata") {
            print_heading(get_string("publicsitefileswarning"), "center", 2);
        }
    } else {
        if ($course->id == SITEID) {
            if ($wdir == "/backupdata") {
                $adminroot = admin_get_root();
                admin_externalpage_setup('frontpagerestore', $adminroot);
                admin_externalpage_print_header($adminroot);
            } else {
                $adminroot = admin_get_root();
                admin_externalpage_setup('sitefiles', $adminroot);
                admin_externalpage_print_header($adminroot);
                print_heading(get_string("publicsitefileswarning"), "center", 2);
            }
        } else {
            print_header("{$course->shortname}: {$strfiles}", $course->fullname, "<a href=\"../course/view.php?id={$course->id}\">{$course->shortname}" . "</a> -> {$fullnav}", $formfield);
        }
    }
    echo "<table border=\"0\" style=\"margin-left:auto;margin-right:auto\" cellspacing=\"3\" cellpadding=\"3\" width=\"640\">";
    echo "<tr>";
    echo "<td colspan=\"2\">";
}
コード例 #10
0
ファイル: index.php プロジェクト: r007/PMoodle
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());
    }
}