// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.org //
// //
-// Copyright (C) 2005 Martin Dougiamas http://dougiamas.com //
+// Copyright (C) 1990-onwards Moodle Pty Ltd http://moodle.com //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
}
require_course_login($course);
+
add_to_log($course->id, "data", "view all", "index.php?id=$course->id", "");
$strweek = get_string('week');
$strdata = get_string('modulename','data');
if (! $datas = get_all_instances_in_course("data", $course)) {
- notice("There are no databases", "../../course/view.php?id=$course->id");
+ notice("There are no databases", "$CFG->wwwroot/course/view.php?id=$course->id");
}
- print_header_simple($strdata, "", $strdata, "", "", true, "", navmenu($course));
+ print_header_simple($strdata, '', $strdata, '', '', true, "", navmenu($course));
$timenow = time();
$strname = get_string('name');
function data_append_new_field_to_templates($data, $newfieldname) {
$newdata->id = $data->id;
+ $change = false;
if (!empty($data->singletemplate)) {
$newdata->singletemplate = addslashes($data->singletemplate.' [[' . $newfieldname .']]');
+ $change = true;
}
if (!empty($data->addtemplate)) {
$newdata->addtemplate = addslashes($data->addtemplate.' [[' . $newfieldname . ']]');
+ $change = true;
}
if (!empty($data->rsstemplate)) {
$newdata->rsstemplate = addslashes($data->singletemplate.' [[' . $newfieldname . ']]');
+ $change = true;
+ }
+ if ($change) {
+ update_record('data', $newdata);
}
- update_record('data', $newdata);
}
}
if (isteacher($course->id)) {
- if (!count_records('data_fields','dataid',$data->id)) { // Brand new database!
+ if (!record_exists('data_fields','dataid',$data->id)) { // Brand new database!
redirect($CFG->wwwroot.'/mod/data/fields.php?d='.$data->id); // Redirect to field entry
}
}
}
$d = $data->id;//set this so tabs can work properly
+
add_to_log($course->id, 'data', 'view', "view.php?id=$cm->id", $data->id, $cm->id);
print_heading(format_string($data->name));
-
// Do we need to show a link to the RSS feed for the records?
if (isset($CFG->enablerssfeeds) && isset($CFG->data_enablerssfeeds) && $data->rssarticles > 0) {
echo '<div style="float:right;">';
- rss_print_link($course->id, $USER->id, 'data', $data->id, $tooltiptext='RSS feed for entries');
+ rss_print_link($course->id, $USER->id, 'data', $data->id, get_string('rsstype'));
echo '</div>';
echo '<div style="clear:both;"></div>';
}
/// Check to see if groups are being used here
if ($groupmode = groupmode($course, $cm)) { // Groups are being used
- $currentgroup = setup_and_print_groups($course, $groupmode, 'view.php?d='.$data->id.'&search='.s($search).'&sort='.s($sort).'&order='.s($order).'&');
+ $currentgroup = setup_and_print_groups($course, $groupmode,
+ 'view.php?d='.$data->id.'&search='.s($search).'&sort='.s($sort).
+ '&order='.s($order).'&');
} else {
$currentgroup = 0;
}
if (optional_param('approved','0',PARAM_INT)) {
print_heading(get_string('recordapproved','data'));
}
+
/***************************
* code to delete a record *
***************************/