Exemplo n.º 1
0
    $formheader = get_string('rununittests', $langfile);
}
// Print the form for adjusting options.
echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter');
echo $OUTPUT->heading($formheader);
echo '<form method="get" action="index.php">';
echo '<fieldset class="invisiblefieldset">';
echo '<p>';
echo $OUTPUT->checkbox(html_select_option::make_checkbox(1, $showpasses, get_string('showpasses', $langfile)), 'showpasses');
echo '</p>';
echo '<p>';
echo $OUTPUT->checkbox(html_select_option::make_checkbox(1, $showsearch, get_string('showsearch', $langfile)), 'showsearch');
echo '</p>';
if (moodle_coverage_recorder::can_run_codecoverage()) {
    echo '<p>';
    echo $OUTPUT->checkbox(html_select_option::make_checkbox(1, $codecoverage, get_string('codecoverageanalysis', 'simpletest')), 'codecoverage');
    echo '</p>';
} else {
    echo '<p>';
    print_string('codecoveragedisabled', 'simpletest');
    echo '<input type="hidden" name="codecoverage" value="0" /></p>';
}
echo '<p>';
echo '<label for="path">', get_string('onlytest', $langfile), '</label> ';
echo '<input type="text" id="path" name="path" value="', $displaypath, '" size="40" />';
echo '</p>';
echo '<input type="submit" value="' . get_string('runtests', $langfile) . '" />';
echo '</fieldset>';
echo '</form>';
echo $OUTPUT->box_end();
echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter');
Exemplo n.º 2
0
/**
 * Called by course/reset.php and shows the formdata by coursereset.
 * it prints checkboxes for each feedback available at the given course
 * there are two checkboxes: 1) delete userdata and keep the feedback 2) delete userdata and drop the feedback
 *
 * @global object
 * @uses FEEDBACK_RESETFORM_RESET
 * @uses FEEDBACK_RESETFORM_DROP
 * @param object $course
 * @return void
 */
function feedback_reset_course_form($course)
{
    global $DB, $OUTPUT;
    echo get_string('resetting_feedbacks', 'feedback');
    echo ':<br />';
    if (!($feedbacks = $DB->get_records('feedback', array('course' => $course->id), 'name'))) {
        return;
    }
    foreach ($feedbacks as $feedback) {
        echo '<p>';
        echo get_string('name', 'feedback') . ': ' . $feedback->name . '<br />';
        echo $OUTPUT->checkbox(html_select_option::make_checkbox(1, true, get_string('resetting_data', 'feedback')), FEEDBACK_RESETFORM_RESET . $feedback->id);
        echo '<br />';
        echo $OUTPUT->checkbox(html_select_option::make_checkbox(1, false, get_string('drop_feedback', 'feedback')), FEEDBACK_RESETFORM_DROP . $feedback->id);
        echo '</p>';
    }
}
Exemplo n.º 3
0
} else {
    echo '<p>';
    print_string('codecoveragedisabled', 'simpletest');
    echo '<input type="hidden" name="codecoverage" value="0" /></p>';
}
echo '<p><strong>' . "Databases:" . '</strong></p>';
echo '<ul>';
foreach ($dbinfos as $i => $dbinfo) {
    $name = $dbinfo['name'];
    if ($dbinfo['installed']) {
        if (!$dbinfo['configured']) {
            $name = "{$name} (misconfigured)";
            // TODO: localise
        }
        echo '<li>';
        echo $OUTPUT->checkbox(html_select_option::make_checkbox(1, intval(!empty($selected[$i])), $name), 'selected[' . $i . ']');
        echo '</li>';
    } else {
        echo '<li>' . "{$name}: driver not installed" . '</li>';
        // TODO: localise
    }
}
echo '</ul>';
echo '<p>External databases are configured in config.php, add lines:</p>
<pre>
$CFG->func_test_db_1 = array("adodb", "postgres7", "localhost", "moodleuser", "password", "moodle", "test", null);
$CFG->func_test_db_2 = array("adodb", "mssql", "localhost", "moodleuser", "password", "moodle", "test", null);
</pre>
<p>where order of parameters is: dblibrary, dbtype, dbhost, dbuser, dbpass, dbname, prefix, dboptions</p>';
echo '<p><input type="submit" value="' . get_string('runtests', 'simpletest') . '" /></p>';
echo '</div>';
Exemplo n.º 4
0
function authorize_print_action_button($orderid, $do, $suborderid = 0, $confirm = false, $unenrol = false, $nobutton = false, $extrahtml = '')
{
    global $CFG;
    global $authstrs;
    $ret = '<form action="' . $CFG->wwwroot . '/enrol/authorize/index.php' . '" method="post"><div>' . '<input type="hidden" name="order" value="' . $orderid . '" />' . '<input type="hidden" name="do" value="' . $do . '" />' . '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
    if (!empty($suborderid)) {
        $ret .= '<input type="hidden" name="suborder" value="' . $suborderid . '" />';
    }
    if (!empty($confirm)) {
        $ret .= '<input type="hidden" name="confirm" value="1" />';
    }
    if (!empty($unenrol)) {
        $ret .= $OUTPUT->checkbox(html_select_option::make_checkbox(1, false, $unenrol), 'unenrol') . '<br />';
    }
    $ret .= $extrahtml;
    $ret .= '<input type="submit" value="' . $authstrs->{$do} . '" />' . '</div></form>';
    if (!empty($nobutton)) {
        $ret .= '<form method="get" action="index.php"><div><input type="hidden" name="order" value="' . $orderid . '" /><input type="submit" value="' . $nobutton . '" /></div></form>';
    }
    return $ret;
}
Exemplo n.º 5
0
/**
 * Display an standard html checkbox with an optional label
 *
 * @deprecated since Moodle 2.0
 *
 * @staticvar int $idcounter
 * @param string $name    The name of the checkbox
 * @param string $value   The valus that the checkbox will pass when checked
 * @param bool $checked The flag to tell the checkbox initial state
 * @param string $label   The label to be showed near the checkbox
 * @param string $alt     The info to be inserted in the alt tag
 * @param string $script If not '', then this is added to the checkbox element
 *                       as an onchange handler.
 * @param bool $return Whether this function should return a string or output
 *                     it (defaults to false)
 * @return string|void If $return=true returns string, else echo's and returns void
 */
function print_checkbox($name, $value, $checked = true, $label = '', $alt = '', $script = '', $return = false)
{
    // debugging('print_checkbox() has been deprecated. Please change your code to use $OUTPUT->checkbox($checkbox).');
    global $OUTPUT;
    if (!empty($script)) {
        debugging('The use of the $script param in print_checkbox has not been migrated into $OUTPUT->checkbox. Please use $checkbox->add_action().', DEBUG_DEVELOPER);
    }
    $output = $OUTPUT->checkbox(html_select_option::make_checkbox($value, $checked, $label, $alt), $name);
    if (empty($return)) {
        echo $output;
    } else {
        return $output;
    }
}
Exemplo n.º 6
0
print_string("mailstudents");
?>
</td>
</tr>

<tr valign="top">
    <td align="right">enrol_mailteachers:</td>
    <td><?php 
echo $OUTPUT->checkbox(html_select_option::make_checkbox('1', !empty($frm->enrol_mailteachers)), 'enrol_mailteachers');
?>
<br />
        <?php 
print_string("mailteachers");
?>
</td>
</tr>

<tr valign="top">
    <td align="right">enrol_mailadmins:</td>
    <td><?php 
echo $OUTPUT->checkbox(html_select_option::make_checkbox('1', !empty($frm->enrol_mailadmins)), 'enrol_mailadmins');
?>
<br />
        <?php 
print_string("mailadmins");
?>
</td>
</tr>

</table>