mirror of
https://github.com/moodle/moodle.git
synced 2025-02-22 02:49:53 +01:00
Removed hard coded message strings from scripts and moved them to the language file. Fixed a display bug in multimenu field. Removed rounded help buttons from fields, made the fields use html title to display the descriptions instead.
344 lines
13 KiB
HTML
344 lines
13 KiB
HTML
<?php // $Id$
|
|
|
|
require_once($CFG->dirroot.'/mod/data/lib.php');
|
|
|
|
if (!isset($form->name)) {
|
|
$form->name = '';
|
|
}
|
|
if (!isset($form->intro)) {
|
|
$form->intro = '';
|
|
}
|
|
if (!isset($form->keepdays)) {
|
|
$form->keepdays = 30;
|
|
}
|
|
if (!isset($form->studentlogs)) {
|
|
$form->studentlogs = 0;
|
|
}
|
|
if (!isset($form->timeavailablefrom)) {
|
|
$form->timeavailablefrom = 0;
|
|
}
|
|
if (!isset($form->timeavailableto)) {
|
|
$form->timeavailableto = 0;
|
|
}
|
|
if (!isset($form->timeviewfrom)) {
|
|
$form->timeviewfrom = 0;
|
|
}
|
|
if (!isset($form->timeviewto)) {
|
|
$form->timeviewto = 0;
|
|
}
|
|
if (!isset($form->schedule)) {
|
|
$form->schedule = 0;
|
|
}
|
|
if (!isset($form->participants)) {
|
|
$form->participants = PARTICIPANTS_TS;
|
|
}
|
|
if (!isset($form->requiredentries)) {
|
|
$form->requiredentries = 0;
|
|
}
|
|
if (!isset($form->requiredentriestoview)) {
|
|
$form->requiredentriestoview = 0;
|
|
}
|
|
if (!isset($form->maxentries)) {
|
|
$form->maxentries = 0;
|
|
}
|
|
if (!isset($form->rssarticles)) {
|
|
$form->rssarticles = 0;
|
|
}
|
|
if (!isset($form->comments)) {
|
|
$form->comments = 0;
|
|
}
|
|
if (!isset($form->ratings)) {
|
|
$form->ratings = 0;
|
|
}
|
|
if (!isset($form->approval)) {
|
|
$form->approval = 0;
|
|
}
|
|
if (!isset($form->scale)) {
|
|
$form->scale = 0;
|
|
}
|
|
if (!isset($form->assessed)) {
|
|
$form->assessed = 1;
|
|
}
|
|
if (!isset($form->assesspublic)) {
|
|
$form->assesspublic = 1;
|
|
}
|
|
?>
|
|
|
|
<script type="text/javascript" language="javascript">
|
|
var availablefromitems = ['availablefromday','availablefrommonth','availablefromyear','availablefromhour', 'availablefromminute'];
|
|
var availabletoitems = ['availabletoday','availabletomonth','availabletoyear','availabletohour', 'availabletominute'];
|
|
var viewfromitems = ['viewfromday','viewfrommonth','viewfromyear','viewfromhour', 'viewfromminute'];
|
|
var viewtoitems = ['viewtoday','viewtomonth','viewtoyear','viewtohour', 'viewtominute'];
|
|
</script>
|
|
|
|
|
|
|
|
<form name="form" method="post" action="mod.php">
|
|
<table cellpadding="5">
|
|
<tr valign="top">
|
|
<td align="right"><?php print_string('name')?>:</b></td>
|
|
<td>
|
|
<input type="text" name="name" size="30" value="<?php p($form->name) ?>" alt="<?php print_string('name') ?>" />
|
|
</td>
|
|
</tr>
|
|
<tr valign="top">
|
|
<td align="right"><?php print_string('intro', 'data')?>:</b><br /><br />
|
|
<?php
|
|
helpbutton('writing', get_string('helpwriting'), 'moodle', true, true);
|
|
echo '<br />';
|
|
helpbutton('questions', get_string('helpquestions'), 'moodle', true, true);
|
|
echo '<br />';
|
|
emoticonhelpbutton('form', 'intro');
|
|
echo '<br />';
|
|
?>
|
|
</td>
|
|
<td>
|
|
<?php print_textarea($usehtmleditor, 20, 50, 680, 400, 'intro', $form->intro); ?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string('availablefromdate','data') ?>:</b></td>
|
|
<td>
|
|
<input name="availablefromenable" type="checkbox" value="1" alt="<?php print_string('availablefromdate', 'data') ?>" onclick="return lockoptions('form', 'availablefromenable', availablefromitems)" <?php if ($form->timeavailablefrom) echo 'checked="checked"' ?> />
|
|
<?php
|
|
print_date_selector("availablefromday", "availablefrommonth", "availablefromyear", $form->timeavailablefrom);
|
|
echo " - ";
|
|
print_time_selector("availablefromhour", "availablefromminute", $form->timeavailablefrom);
|
|
?>
|
|
<input type="hidden" name="havailablefromday" value="0" />
|
|
<input type="hidden" name="havailablefrommonth" value="0" />
|
|
<input type="hidden" name="havailablefromyear" value="0" />
|
|
<input type="hidden" name="havailablefromhour" value="0" />
|
|
<input type="hidden" name="havailablefromminute" value="0" />
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string('availabletodate','data') ?>:</b></td>
|
|
<td>
|
|
<input name="availabletoenable" type="checkbox" value="1" alt="<?php print_string('availabletodate', 'data') ?>" onclick="return lockoptions('form', 'availabletoenable', availabletoitems)" <?php if ($form->timeavailableto) echo 'checked="checked"' ?> />
|
|
<?php
|
|
print_date_selector("availabletoday", "availabletomonth", "availabletoyear", $form->timeavailableto);
|
|
echo " - ";
|
|
print_time_selector("availabletohour", "availabletominute", $form->timeavailableto);
|
|
?>
|
|
<input type="hidden" name="havailabletoday" value="0" />
|
|
<input type="hidden" name="havailabletomonth" value="0" />
|
|
<input type="hidden" name="havailabletoyear" value="0" />
|
|
<input type="hidden" name="havailabletohour" value="0" />
|
|
<input type="hidden" name="havailabletominute" value="0" />
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string('viewfromdate','data') ?>:</b></td>
|
|
<td>
|
|
<input name="viewfromenable" type="checkbox" value="1" alt="<?php print_string('viewfromdate', 'data') ?>" onclick="return lockoptions('form', 'viewfromenable', viewfromitems)" <?php if ($form->timeviewfrom) echo 'checked="checked"' ?> />
|
|
<?php
|
|
print_date_selector("viewfromday", "viewfrommonth", "viewfromyear", $form->timeviewfrom);
|
|
echo " - ";
|
|
print_time_selector("viewfromhour", "viewfromminute", $form->timeviewfrom);
|
|
?>
|
|
<input type="hidden" name="hviewfromday" value="0" />
|
|
<input type="hidden" name="hviewfrommonth" value="0" />
|
|
<input type="hidden" name="hviewfromyear" value="0" />
|
|
<input type="hidden" name="hviewfromhour" value="0" />
|
|
<input type="hidden" name="hviewfromminute" value="0" />
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string('viewtodate','data') ?>:</b></td>
|
|
<td>
|
|
<input name="viewtoenable" type="checkbox" value="1" alt="<?php print_string('viewtodate', 'data') ?>" onclick="return lockoptions('form', 'viewtoenable', viewtoitems)" <?php if ($form->timeviewto) echo 'checked="checked"' ?> />
|
|
<?php
|
|
print_date_selector("viewtoday", "viewtomonth", "viewtoyear", $form->timeviewto);
|
|
echo " - ";
|
|
print_time_selector("viewtohour", "viewtominute", $form->timeviewto);
|
|
?>
|
|
<input type="hidden" name="hviewtoday" value="0" />
|
|
<input type="hidden" name="hviewtomonth" value="0" />
|
|
<input type="hidden" name="hviewtoyear" value="0" />
|
|
<input type="hidden" name="hviewtohour" value="0" />
|
|
<input type="hidden" name="hviewtominute" value="0" />
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string('participants', 'data') ?>:</b></td>
|
|
<td>
|
|
<?php
|
|
$a->teachers = $course->teachers;
|
|
$a->students = $course->students;
|
|
$options = array(PARTICIPANTS_T => $a->teachers,
|
|
PARTICIPANTS_TS => get_string('teachersandstudents', 'data', $a));
|
|
choose_from_menu($options, 'participants', $form->participants, '');
|
|
helpbutton('participants', get_string('participants', 'data'), 'data');
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string('requiredentries', 'data') ?>:</b></td>
|
|
<td>
|
|
<?php
|
|
$countoptions = array();
|
|
for($count=1;$count<=DATAMAXENTRIES;$count++) $countoptions[$count] = $count;
|
|
choose_from_menu($countoptions, 'requiredentries', $form->requiredentries, get_string('none'));
|
|
helpbutton('requiredentries', get_string('requiredentries', 'data'), 'data');
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td> </td>
|
|
<td><b><?php print_string('requiredentriestoview', 'data') ?>: </b>
|
|
<?php
|
|
choose_from_menu($countoptions, 'requiredentriestoview', $form->requiredentriestoview, get_string('none'));
|
|
helpbutton('requiredentriestoview', get_string('requiredentriestoview', 'data'), 'data');
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string('rss', 'data') ?>:</b></td>
|
|
<td>
|
|
<?php
|
|
echo '<input name="rssarticles" type="text" style="width:50px;" />';
|
|
helpbutton('rss', get_string('rss', 'data'), 'data');
|
|
echo ' ' . get_string('rssshowhowmany', 'data');
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string('maxentries', 'data') ?>:</b></td>
|
|
<td>
|
|
<?php
|
|
choose_from_menu($countoptions, 'maxentries', $form->maxentries, get_string('nomaximum', 'data'));
|
|
helpbutton('maxentries', get_string('maxentries', 'data'), 'data');
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string('comments', 'data') ?>:</b></td>
|
|
<td>
|
|
<?php
|
|
$ynoptions = array( 0 => get_string('no'), 1 => get_string('yes'));
|
|
choose_from_menu($ynoptions, 'comments', $form->comments, '');
|
|
helpbutton('comments', get_string('comments', 'data'), 'data');
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string('requireapproval', 'data') ?>:</b></td>
|
|
<td>
|
|
<?php
|
|
$ynoptions = array( 0 => get_string('no'), 1 => get_string('yes'));
|
|
choose_from_menu($ynoptions, 'approval', $form->approval, '');
|
|
helpbutton('requireapproval', get_string('requireapproval', 'data'), 'data');
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
<?php if (!empty($CFG->data_enablerssfeeds) and !empty($CFG->enablerssfeeds)) { ?>
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string('numberrssarticles', 'data') ?>:</b></td>
|
|
<td><?php choose_from_menu($countoptions, 'rssarticles', $form->rssarticles, get_string('none')) ?>
|
|
</td>
|
|
</tr>
|
|
<?php } ?>
|
|
|
|
<tr>
|
|
<td align="right" valign="top"><b><?php print_string("allowratings", "forum") ?>:</b></td>
|
|
<td>
|
|
<table cellpadding="1">
|
|
<tr>
|
|
<td colspan="2">
|
|
<?php
|
|
echo '<script type="text/javascript">';
|
|
echo " var subitemsall = ['assessed', 'assesspublic', 'scale'];";
|
|
echo '</script>';
|
|
|
|
echo '<input name="ratings" type="checkbox" alt="'.get_string('ratingsuse', 'forum').'" value="1" ';
|
|
echo " onclick=\"return lockoptions('form','ratings', subitemsall)\" ";
|
|
if ($form->ratings) {
|
|
echo ' checked="checked" ';
|
|
}
|
|
echo ' />';
|
|
echo ' '.get_string('ratingsuse', 'forum').':';
|
|
echo '</td></tr>';
|
|
|
|
echo '<tr><td>';
|
|
// The odd order below was to maintain backward compatibility
|
|
unset($options);
|
|
$options[2] = get_string('ratingonlyteachers', 'forum', moodle_strtolower($course->teachers));
|
|
$options[1] = get_string('ratingeveryone', 'forum');
|
|
echo get_string('users').': ';
|
|
echo '</td><td>';
|
|
choose_from_menu($options, 'assessed', $form->assessed, '');
|
|
echo '</td></tr>';
|
|
|
|
echo '<tr><td>';
|
|
unset($options);
|
|
$options[0] = get_string('ratingpublicnot', 'forum', $course->students);
|
|
$options[1] = get_string('ratingpublic', 'forum', $course->students);
|
|
echo get_string('view').': ';
|
|
echo '</td><td>';
|
|
choose_from_menu($options, 'assesspublic', $form->assesspublic, '');
|
|
echo '</td></tr>';
|
|
|
|
echo '<tr><td>';
|
|
echo get_string('grade').': ';
|
|
echo '</td><td>';
|
|
print_grade_menu($course->id, 'scale', $form->scale, false);
|
|
echo '</td></tr>';
|
|
|
|
echo '</td></tr></table>';
|
|
|
|
echo '<input type="hidden" name="hassessed" value="0" />';
|
|
echo '<input type="hidden" name="hassesspublic" value="0" />';
|
|
echo '<input type="hidden" name="hscale" value="0" />';
|
|
|
|
echo '<script type="text/javascript">';
|
|
echo "lockoptions('form','ratings', subitemsall);";
|
|
echo '</script>';
|
|
|
|
?>
|
|
</td>
|
|
</tr>
|
|
<?php print_standard_coursemodule_settings($form); ?>
|
|
|
|
</table>
|
|
<center>
|
|
<input type="hidden" name="course" value="<?php p($form->course) ?>" />
|
|
<input type="hidden" name="sesskey" value="<?php p($form->sesskey) ?>" />
|
|
<input type="hidden" name="coursemodule" value="<?php p($form->coursemodule) ?>" />
|
|
<input type="hidden" name="section" value="<?php p($form->section) ?>" />
|
|
<input type="hidden" name="module" value="<?php p($form->module) ?>" />
|
|
<input type="hidden" name="modulename" value="<?php p($form->modulename) ?>" />
|
|
<input type="hidden" name="instance" value="<?php p($form->instance) ?>" />
|
|
<input type="hidden" name="mode" value="<?php p($form->mode) ?>" />
|
|
<input type="submit" value="<?php print_string('savechanges') ?>" />
|
|
<input type="submit" name="cancel" value="<?php print_string('cancel') ?>" />
|
|
</center>
|
|
</form>
|
|
|
|
<script type="text/javascript">
|
|
<?php
|
|
if (!$form->timeavailablefrom) echo "lockoptions('form','availablefromenable', availablefromitems);";
|
|
if (!$form->timeavailableto) echo "lockoptions('form','availabletoenable', availabletoitems);";
|
|
if (!$form->timeviewfrom) echo "lockoptions('form','viewfromenable', viewfromitems);";
|
|
if (!$form->timeviewto) echo "lockoptions('form','viewtoenable', viewtoitems);";
|
|
?>
|
|
</script>
|
|
|