Fixing silly stuff

This commit is contained in:
moodler
2006-03-22 08:44:26 +00:00
parent 3be86ca6b3
commit 423bd918b5
5 changed files with 28 additions and 31 deletions
+6 -9
View File
@@ -104,16 +104,12 @@
include('tabs.php');
/********************************************
* code to handle form processing *
* add individual data_content *
********************************************/
$entrysaved = false; //flag for displaying entry saved msg
$ignorenames = array('MAX_FILE_SIZE','sesskey','d','rid'); // strings to be ignored in input data
/// Process incoming data for adding/updating records
if ($datarecord = data_submitted($CFG->wwwroot.'/mod/data/add.php') and confirm_sesskey()) {
$ignorenames = array('MAX_FILE_SIZE','sesskey','d','rid'); // strings to be ignored in input data
if ($rid) { /// Update some records
/// All student edits are marked unapproved by default
@@ -200,8 +196,9 @@
} // End of form processing
///Check if maximum number of entry as specified by this database is reached
///Of course, you can't be stopped if you are an editting teacher! =)
/// Check if maximum number of entry as specified by this database is reached
/// Of course, you can't be stopped if you are an editting teacher! =)
if (data_atmaxentries($data) and !isteacheredit($course->id)){
notify (get_string('atmaxentry','data'));
print_footer($course);
+4 -5
View File
@@ -30,7 +30,6 @@ class data_field_checkbox extends data_field_base {
parent::data_field_base($field, $data);
}
function display_add_field($recordid=0) {
global $CFG;
@@ -41,11 +40,11 @@ class data_field_checkbox extends data_field_base {
$content = explode('##', $content);
}
$str = '<div title="'.$field->description.'">';
$str = '<div title="'.$this->field->description.'">';
foreach (explode("\n", $field->param1) as $checkbox) {
$checkbox = ltrim(rtrim($checkbox));
$str .= '<input type="checkbox" name="field_' . $field->id . '[]" ';
foreach (explode("\n", $this->field->param1) as $checkbox) {
$checkbox = trim($checkbox);
$str .= '<input type="checkbox" name="field_' . $this->field->id . '[]" ';
$str .= 'value="' . $checkbox . '" ';
if (array_search($checkbox, $content) !== false) {
+1
View File
@@ -39,6 +39,7 @@ class data_field_picture extends data_field_file {
global $CFG;
$filepath = '';
$filename = '';
$description = '';
if ($recordid){
+8 -7
View File
@@ -34,16 +34,17 @@ class data_field_textarea extends data_field_base {
function display_add_field($recordid=0) {
global $CFG;
$text = '';
$format = 0;
if ($recordid){
$content = get_record('data_content', 'fieldid', $this->field->id, 'recordid', $recordid);
$text = $content->content;
$format = $content->content1;
} else {
$text = '';
$format = '';
if ($content = get_record('data_content', 'fieldid', $this->field->id, 'recordid', $recordid)) {
$text = $content->content;
$format = $content->content1;
}
}
$str = '<div title="'.$thisfield->description.'">';
$str = '<div title="'.$this->field->description.'">';
if (can_use_richtext_editor()) {
// Show a rich text html editor.
+9 -10
View File
@@ -27,13 +27,12 @@
require_login();
$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);
$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
$mode = optional_param('mode','',PARAM_ALPHA);
$displaynotice = ''; //str to print after an operation,
if ($id) {
@@ -235,7 +234,7 @@
foreach ($fff as $ff) {
$field = data_get_field($ff, $data);
///Print Action Column
/// Print Action Column
echo '<tr><td align="center">';
echo '<a href="fields.php?d='.$data->id.'&amp;mode=display&amp;fid='.$field->field->id.'&amp;sesskey='.sesskey().'">';
@@ -245,14 +244,14 @@
echo '<img src="'.$CFG->pixpath.'/t/delete.gif" height="11" width="11" border="0" alt="'.get_string('delete').'" /></a>';
echo '</td>';
///Print Fieldname Column
/// Print Fieldname Column
echo '<td>';
echo '<a href="fields.php?mode=display&amp;d='.$data->id;
echo '&amp;fid='.$field->field->id.'&amp;sesskey='.sesskey().'">'.$field->field->name.'</a>';
echo '</td>';
///Print Type Column
/// Print Type Column
echo '<td align="center">';
echo $field->image(); //print type icon