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 //
|
|
|
|
// //
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
/// This file to be included so we can assume config.php has already been included.
|
|
|
|
/// We also assume that $user, $course, $currenttab have been set
|
|
|
|
|
|
|
|
|
|
|
|
if (empty($currenttab) or empty($data) or empty($course)) {
|
|
|
|
error('You cannot call this script in that way');
|
|
|
|
}
|
2006-08-08 05:13:06 +00:00
|
|
|
|
|
|
|
$cm = data_get_cm($data);
|
2006-08-09 13:45:49 +00:00
|
|
|
$context = get_context_instance(CONTEXT_MODULE, $cm->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
|
|
|
|
|
|
|
$inactive = NULL;
|
|
|
|
$row = array();
|
|
|
|
|
2006-03-30 07:45:40 +00:00
|
|
|
$row[] = new tabobject('list', $CFG->wwwroot.'/mod/data/view.php?d='.$data->id, get_string('list','data'), '', true);
|
2006-03-29 18:38:18 +00:00
|
|
|
|
2006-03-29 08:49:28 +00:00
|
|
|
if (isset($record)) {
|
2006-03-30 07:45:40 +00:00
|
|
|
$row[] = new tabobject('single', $CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&rid='.$record->id, get_string('single','data'), '', true);
|
2006-03-29 08:49:28 +00:00
|
|
|
} else {
|
2006-04-05 07:27:58 +00:00
|
|
|
$row[] = new tabobject('single', $CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&mode=single', get_string('single','data'), '', true);
|
2006-03-29 08:49:28 +00:00
|
|
|
}
|
2006-03-29 18:36:31 +00:00
|
|
|
|
2006-08-08 05:13:06 +00:00
|
|
|
if (isloggedin()) {
|
2006-08-14 05:55:40 +00:00
|
|
|
if (has_capability('mod/data:writeentry', $context)) { // took out participation list here!
|
2006-08-09 13:45:49 +00:00
|
|
|
$addstring = empty($editentry) ? get_string('add', 'data') : get_string('editentry', 'data');
|
2006-04-05 01:38:06 +00:00
|
|
|
$row[] = new tabobject('add', $CFG->wwwroot.'/mod/data/edit.php?d='.$data->id, $addstring, '', true);
|
|
|
|
}
|
2006-08-14 05:55:40 +00:00
|
|
|
if (has_capability('mod/data:managetemplates', $context)) {
|
2006-04-05 01:38:06 +00:00
|
|
|
if ($currenttab == 'list') {
|
|
|
|
$defaultemplate = 'listtemplate';
|
|
|
|
} else if ($currenttab == 'add') {
|
|
|
|
$defaultemplate = 'addtemplate';
|
|
|
|
} else {
|
|
|
|
$defaultemplate = 'singletemplate';
|
|
|
|
}
|
|
|
|
|
2006-08-15 08:42:06 +00:00
|
|
|
$row[] = new tabobject('templates', $CFG->wwwroot.'/mod/data/templates.php?d='.$data->id.'&mode='.$defaultemplate,
|
|
|
|
get_string('templates','data'));
|
2006-04-05 01:38:06 +00:00
|
|
|
$row[] = new tabobject('fields', $CFG->wwwroot.'/mod/data/field.php?d='.$data->id,
|
2006-08-15 08:42:06 +00:00
|
|
|
get_string('fields','data'), '', true);
|
|
|
|
$row[] = new tabobject('presets', $CFG->wwwroot.'/mod/data/preset.php?d='.$data->id,
|
|
|
|
get_string('presets', 'data'), '', true);
|
2006-03-25 14:56:27 +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
|
|
|
}
|
|
|
|
|
|
|
|
$tabs[] = $row;
|
|
|
|
/*****************************
|
|
|
|
* stolen code from quiz report
|
|
|
|
*****************************/
|
|
|
|
if ($currenttab == 'templates' and isset($mode)) {
|
|
|
|
$inactive[] = 'templates';
|
2006-08-17 09:26:06 +00:00
|
|
|
$templatelist = array ('listtemplate', 'singletemplate', 'addtemplate', 'rsstemplate', 'csstemplate', 'jstemplate');
|
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
|
|
|
|
|
|
|
$row = array();
|
|
|
|
$currenttab ='';
|
|
|
|
foreach ($templatelist as $template) {
|
2006-03-29 08:49:28 +00:00
|
|
|
$row[] = new tabobject($template, "templates.php?d=$data->id&mode=$template",
|
2006-03-29 18:00:58 +00:00
|
|
|
get_string($template, '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
|
|
|
if ($template == $mode) {
|
|
|
|
$currenttab = $template;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$tabs[] = $row;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Print out the tabs and continue!
|
|
|
|
|
|
|
|
print_tabs($tabs, $currenttab, $inactive);
|
2006-02-20 02:15:45 +00:00
|
|
|
|
2006-03-22 08:07:26 +00:00
|
|
|
?>
|