本文整理汇总了PHP中workshop::previewform_url方法的典型用法代码示例。如果您正苦于以下问题:PHP workshop::previewform_url方法的具体用法?PHP workshop::previewform_url怎么用?PHP workshop::previewform_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类workshop
的用法示例。
在下文中一共展示了workshop::previewform_url方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redirect
// load the form to edit the grading strategy dimensions
$mform = $strategy->get_edit_strategy_form($PAGE->url);
if ($mform->is_cancelled()) {
redirect($workshop->view_url());
} elseif ($data = $mform->get_data()) {
if (($data->workshopid != $workshop->id) or ($data->strategy != $workshop->strategy)) {
// this may happen if someone changes the workshop setting while the user had the
// editing form opened
throw new invalid_parameter_exception('Invalid workshop ID or the grading strategy has changed.');
}
$strategy->save_edit_strategy_form($data);
if (isset($data->saveandclose)) {
redirect($workshop->view_url());
} elseif (isset($data->saveandpreview)) {
redirect($workshop->previewform_url());
} else {
// save and continue - redirect to self to prevent data being re-posted by pressing "Reload"
redirect($PAGE->url);
}
}
// Output starts here
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('pluginname', 'workshopform_' . $workshop->strategy));
$mform->display();
echo $OUTPUT->footer();
示例2: dirname
* @copyright 2009 David Mudrak <david.mudrak@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once dirname(dirname(dirname(__FILE__))) . '/config.php';
require_once dirname(__FILE__) . '/locallib.php';
$cmid = required_param('cmid', PARAM_INT);
$cm = get_coursemodule_from_id('workshop', $cmid, 0, false, MUST_EXIST);
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
$workshop = $DB->get_record('workshop', array('id' => $cm->instance), '*', MUST_EXIST);
require_login($course, false, $cm);
if (isguestuser()) {
print_error('guestsarenotallowed');
}
$workshop = new workshop($workshop, $cm, $course);
require_capability('mod/workshop:editdimensions', $workshop->context);
$PAGE->set_url($workshop->previewform_url());
$PAGE->set_title($workshop->name);
$PAGE->set_heading($course->fullname);
$PAGE->navbar->add(get_string('editingassessmentform', 'workshop'), $workshop->editform_url(), navigation_node::TYPE_CUSTOM);
$PAGE->navbar->add(get_string('previewassessmentform', 'workshop'));
$currenttab = 'editform';
// load the grading strategy logic
$strategy = $workshop->grading_strategy_instance();
// load the assessment form
$mform = $strategy->get_assessment_form($workshop->editform_url(), 'preview');
// output starts here
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($workshop->name));
echo $OUTPUT->heading(get_string('assessmentform', 'workshop'), 3);
$mform->display();
echo $OUTPUT->footer();