NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
<?php // $Id$
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
// //
|
|
|
|
// NOTICE OF COPYRIGHT //
|
|
|
|
// //
|
|
|
|
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
|
|
|
|
// http://moodle.org //
|
|
|
|
// //
|
|
|
|
// Copyright (C) 2005 Martin Dougiamas http://dougiamas.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 //
|
|
|
|
// the Free Software Foundation; either version 2 of the License, or //
|
|
|
|
// (at your option) any later version. //
|
|
|
|
// //
|
|
|
|
// This program is distributed in the hope that it will be useful, //
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
|
|
// GNU General Public License for more details: //
|
|
|
|
// //
|
|
|
|
// http://www.gnu.org/copyleft/gpl.html //
|
|
|
|
// //
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
require_once('../../config.php');
|
|
|
|
require_once('lib.php');
|
|
|
|
|
|
|
|
require_login();
|
2006-02-28 02:51:31 +00:00
|
|
|
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
$id = optional_param('id', 0, PARAM_INT); // course module id
|
|
|
|
$d = optional_param('d', 0, PARAM_INT); // database id
|
|
|
|
$fid = optional_param('fid', 0 , PARAM_INT); //update field id
|
|
|
|
$newtype = optional_param('fieldmenu','',PARAM_ALPHA); //type of the new field
|
|
|
|
|
|
|
|
//action specifies what action is performed when data is submitted
|
|
|
|
$mode = optional_param('mode','',PARAM_ALPHA);
|
2006-03-22 08:07:26 +00:00
|
|
|
$displaynotice = ''; //str to print after an operation,
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
|
|
|
|
if ($id) {
|
|
|
|
if (! $cm = get_record('course_modules', 'id', $id)) {
|
|
|
|
error('Course Module ID was incorrect');
|
|
|
|
}
|
|
|
|
if (! $course = get_record('course', 'id', $cm->course)) {
|
|
|
|
error('Course is misconfigured');
|
|
|
|
}
|
|
|
|
if (! $data = get_record('data', 'id', $cm->instance)) {
|
|
|
|
error('Course module is incorrect');
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
if (! $data = get_record('data', 'id', $d)) {
|
|
|
|
error('Data ID is incorrect');
|
|
|
|
}
|
|
|
|
if (! $course = get_record('course', 'id', $data->course)) {
|
|
|
|
error('Course is misconfigured');
|
|
|
|
}
|
|
|
|
if (! $cm = get_coursemodule_from_instance('data', $data->id, $course->id)) {
|
|
|
|
error('Course Module ID was incorrect');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!isteacheredit($course->id)){
|
|
|
|
error(get_string('noaccess','data'));
|
|
|
|
}
|
|
|
|
|
2006-02-03 08:11:36 +00:00
|
|
|
$strdata = get_string('modulenameplural','data');
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
|
2006-03-22 08:07:26 +00:00
|
|
|
print_header_simple($data->name, '', "<a href='index.php?id=$course->id'>$strdata</a> -> $data->name",
|
|
|
|
'', '', true, '', navmenu($course, $cm));
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
|
|
|
|
print_heading(format_string($data->name));
|
|
|
|
|
|
|
|
|
|
|
|
/************************************
|
|
|
|
* Data Processing *
|
|
|
|
***********************************/
|
2006-03-22 08:07:26 +00:00
|
|
|
switch ($mode){
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
|
|
|
|
case 'add': ///add a new field
|
2006-03-22 08:07:26 +00:00
|
|
|
if (confirm_sesskey() and $fieldinput = data_submitted($CFG->wwwroot.'/mod/data/fields.php')){
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
|
2006-03-22 08:07:26 +00:00
|
|
|
/// Only store this new field if it doesn't already exist.
|
|
|
|
if (data_fieldname_exists($fieldinput->name, $data->id)) {
|
|
|
|
|
|
|
|
$displaynotice = get_string('invalidfieldname','data');
|
|
|
|
|
|
|
|
} else {
|
2006-02-06 09:13:37 +00:00
|
|
|
|
2006-03-22 08:07:26 +00:00
|
|
|
/// Check for arrays and convert to a comma-delimited string
|
|
|
|
data_convert_arrays_to_strings($fieldinput);
|
|
|
|
|
|
|
|
/// Create a field object to collect and store the data safely
|
|
|
|
$type = required_param('type', PARAM_FILE);
|
|
|
|
$field = data_get_field_new($type, $data);
|
|
|
|
|
|
|
|
$field->define_field($fieldinput);
|
|
|
|
$field->insert_field();
|
|
|
|
|
|
|
|
/// Update some templates
|
|
|
|
data_append_new_field_to_templates($data, $field->field->name);
|
2006-02-27 04:13:03 +00:00
|
|
|
|
2006-03-22 08:07:26 +00:00
|
|
|
add_to_log($course->id, 'data', 'fields add',
|
|
|
|
"fields.php?d=$data->id&mode=display&fid=$fid", $fid, $cm->id);
|
2006-02-06 09:13:37 +00:00
|
|
|
|
2006-03-22 08:07:26 +00:00
|
|
|
$displaynotice = get_string('fieldadded','data');
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
}
|
2006-03-22 08:07:26 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case 'update': ///update a field
|
|
|
|
if (confirm_sesskey() and $fieldinput = data_submitted($CFG->wwwroot.'/mod/data/fields.php')){
|
|
|
|
|
|
|
|
$fieldinput->name = optional_param('name','',PARAM_NOTAGS);
|
|
|
|
|
|
|
|
if (data_fieldname_exists($fieldinput->name, $data->id, $fid)) {
|
|
|
|
$displaynotice = get_string('invalidfieldname','data');
|
|
|
|
|
|
|
|
} else {
|
|
|
|
/// Check for arrays and convert to a comma-delimited string
|
|
|
|
data_convert_arrays_to_strings($fieldinput);
|
|
|
|
|
|
|
|
/// Create a field object to collect and store the data safely
|
|
|
|
$field = data_get_field_from_id($fid, $data);
|
|
|
|
$oldfieldname = $field->field->name;
|
|
|
|
$field->update_field($fieldinput);
|
|
|
|
|
|
|
|
/// Update the templates.
|
|
|
|
data_replace_field_in_templates($data, $oldfieldname, $field->field->name);
|
|
|
|
|
|
|
|
add_to_log($course->id, 'data', 'fields update',
|
|
|
|
"fields.php?d=$data->id&mode=display&fid=$fid", $fid, $cm->id);
|
|
|
|
|
|
|
|
$displaynotice = get_string('fieldupdated','data');
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2006-03-22 08:07:26 +00:00
|
|
|
|
2006-02-06 09:13:37 +00:00
|
|
|
case 'delete': // Delete a field
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
if (confirm_sesskey()){
|
2006-02-06 09:13:37 +00:00
|
|
|
if ($confirm = optional_param('confirm', 0, PARAM_INT)) {
|
|
|
|
|
2006-03-22 08:07:26 +00:00
|
|
|
// Delete the field completely
|
|
|
|
$field = data_get_field_from_id($fid, $data);
|
|
|
|
$field->delete_field();
|
2006-02-27 04:13:03 +00:00
|
|
|
|
2006-03-22 08:07:26 +00:00
|
|
|
// Update the templates.
|
|
|
|
data_replace_field_in_templates($data, $field->field->name, '');
|
2006-02-06 09:13:37 +00:00
|
|
|
|
2006-03-22 08:07:26 +00:00
|
|
|
add_to_log($course->id, 'data', 'fields delete',
|
|
|
|
"fields.php?d=$data->id", $field->field->name, $cm->id);
|
|
|
|
|
|
|
|
$displaynotice = get_string('fielddeleted', 'data');
|
|
|
|
|
|
|
|
} else {
|
2006-02-06 09:13:37 +00:00
|
|
|
// Print confirmation message.
|
2006-03-22 08:07:26 +00:00
|
|
|
$field = data_get_field_from_id($fid, $data);
|
|
|
|
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
print_simple_box_start('center', '60%');
|
|
|
|
echo '<div align="center">';
|
|
|
|
echo '<form action = "fields.php?d='.$data->id.'&mode=delete&fid='.$fid.'" method="post">';
|
|
|
|
echo '<input name="sesskey" value="'.sesskey().'" type="hidden" />';
|
|
|
|
echo '<input name="confirm" value="1" type="hidden" />';
|
2006-03-22 08:07:26 +00:00
|
|
|
echo '<strong>'.$field->field->name.'</strong> - '.get_string('confirmdeletefield','data');
|
|
|
|
echo '<p>';
|
2006-02-20 02:15:45 +00:00
|
|
|
echo '<input type="submit" value="'.get_string('ok').'" /> ';
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
echo '<input type="button" value="'.get_string('cancel').'" onclick="javascript:history.go(-1);" />';
|
2006-03-22 08:07:26 +00:00
|
|
|
echo '<p>';
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
echo '</form>';
|
|
|
|
echo '</div>';
|
|
|
|
print_simple_box_end();
|
|
|
|
echo '</td></tr></table>';
|
|
|
|
print_footer($course);
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Print the tabs
|
|
|
|
|
|
|
|
$currenttab = 'fields';
|
|
|
|
include('tabs.php');
|
|
|
|
|
|
|
|
/// Print the browsing interface
|
|
|
|
|
|
|
|
///get the list of possible fields (plugins)
|
|
|
|
$directories = get_list_of_plugins('mod/data/field/');
|
|
|
|
$menufield = array();
|
|
|
|
|
|
|
|
foreach ($directories as $directory){
|
|
|
|
$menufield[$directory] = get_string($directory,'data'); //get from language files
|
|
|
|
}
|
|
|
|
asort($menufield); //sort in alphabetical order
|
|
|
|
|
2006-03-22 08:07:26 +00:00
|
|
|
notify($displaynotice); //print message, if any
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
|
2006-03-22 08:07:26 +00:00
|
|
|
if (($mode == 'new') && confirm_sesskey()) { /// Adding a new field
|
|
|
|
$field = data_get_field_new($newtype, $data);
|
|
|
|
$field->display_edit_field();
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
|
2006-03-22 08:07:26 +00:00
|
|
|
} else if ($mode == 'display' && confirm_sesskey()) { /// Display/edit existing field
|
|
|
|
$field = data_get_field_from_id($fid, $data);
|
|
|
|
$field->display_edit_field();
|
|
|
|
|
|
|
|
} else { /// Display the main listing of all fields
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
|
2006-02-20 02:15:45 +00:00
|
|
|
echo '<form name="fieldform" action="fields.php" method="post">';
|
|
|
|
echo '<input name="d" type="hidden" value="'.$data->id.'" />';
|
|
|
|
echo '<input type="hidden" name="mode" value="" />';
|
|
|
|
echo '<input name="sesskey" value="'.sesskey().'" type="hidden" />';
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
print_simple_box_start('center','50%');
|
|
|
|
|
|
|
|
echo '<table width="100%"><tr>';
|
|
|
|
echo '<td>'.get_string('newfield','data').' ';
|
|
|
|
choose_from_menu($menufield,'fieldmenu','0','choose','fieldform.mode.value=\'new\';fieldform.submit();','0');
|
|
|
|
helpbutton('fields', get_string('addafield','data'), 'data');
|
|
|
|
echo '</td></tr>';
|
|
|
|
|
2006-03-22 08:07:26 +00:00
|
|
|
if (!record_exists('data_fields','dataid',$data->id)) {
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
echo '<tr><td colspan="2">'.get_string('nofieldindatabase','data').'</td></tr>'; // nothing in database
|
2006-03-22 08:07:26 +00:00
|
|
|
|
|
|
|
} else { //else print quiz style list of fields
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
echo '<tr><td>';
|
|
|
|
print_simple_box_start('center','90%');
|
|
|
|
echo '<table width="100%"><tr><td align="center"><b>'.get_string('action','data').
|
|
|
|
'</b></td><td><b>'.get_string('fieldname','data').
|
|
|
|
'</b></td><td align="center"><b>'.get_string('type','data').'</b></td></tr>';
|
|
|
|
|
2006-03-22 08:07:26 +00:00
|
|
|
if ($fff = get_records('data_fields','dataid',$data->id)){
|
|
|
|
foreach ($fff as $ff) {
|
|
|
|
$field = data_get_field($ff, $data);
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
|
|
|
|
///Print Action Column
|
|
|
|
|
|
|
|
echo '<tr><td align="center">';
|
2006-03-22 08:07:26 +00:00
|
|
|
echo '<a href="fields.php?d='.$data->id.'&mode=display&fid='.$field->field->id.'&sesskey='.sesskey().'">';
|
2006-02-20 02:15:45 +00:00
|
|
|
echo '<img src="'.$CFG->pixpath.'/t/edit.gif" height="11" width="11" border="0" alt="'.get_string('edit').'" /></a>';
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
echo ' ';
|
2006-03-22 08:07:26 +00:00
|
|
|
echo '<a href="fields.php?d='.$data->id.'&mode=delete&fid='.$field->field->id.'&sesskey='.sesskey().'">';
|
2006-02-20 02:15:45 +00:00
|
|
|
echo '<img src="'.$CFG->pixpath.'/t/delete.gif" height="11" width="11" border="0" alt="'.get_string('delete').'" /></a>';
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
echo '</td>';
|
|
|
|
|
|
|
|
///Print Fieldname Column
|
|
|
|
|
|
|
|
echo '<td>';
|
2006-03-03 06:13:27 +00:00
|
|
|
echo '<a href="fields.php?mode=display&d='.$data->id;
|
2006-03-22 08:07:26 +00:00
|
|
|
echo '&fid='.$field->field->id.'&sesskey='.sesskey().'">'.$field->field->name.'</a>';
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
echo '</td>';
|
|
|
|
|
|
|
|
///Print Type Column
|
|
|
|
|
|
|
|
echo '<td align="center">';
|
2006-03-22 08:07:26 +00:00
|
|
|
echo $field->image(); //print type icon
|
NEW MODULE FROM MOODLE.COM - DATABASE !
Finally, we have an early version good enough for everyone to
start banging on to help us polish it up and find bugs.
Please take a look and file bugs in the bug tracker under "Database module".
We urgently need
- new icons for existing field types
- testing on PostgreSQL install
Coming soon (?):
- Many more field types: calculation, checkbox, relation, date, datetime,
time, email, group, list, user, number, richtext
(Please let us know if you are interested in developing any of these)
- A way to save and restore "presets", which are field/template sets
- Backup/Restore support
- Groups Support
- RSS support
Many thanks to Yu for all the hard work under my whip.
2005-12-02 07:50:26 +00:00
|
|
|
echo '</td></tr>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo '</table>';
|
|
|
|
print_simple_box_end();
|
|
|
|
} //close else
|
|
|
|
|
|
|
|
echo '</td></tr></table>';
|
|
|
|
|
|
|
|
print_simple_box_end();
|
|
|
|
echo '</form>';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Finish the page
|
|
|
|
print_footer($course);
|
|
|
|
|
2006-03-22 08:07:26 +00:00
|
|
|
?>
|