Skip to content

Commit

Permalink
Tidying up.
Browse files Browse the repository at this point in the history
  • Loading branch information
ikawhero committed Feb 6, 2006
1 parent bbccd61 commit 6f4e039
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 8 additions & 5 deletions mod/data/add.php
Expand Up @@ -125,9 +125,10 @@

//this creates a new field subclass object
if ($name != 'MAX_FILE_SIZE' && $name != 'sesskey'){
$currentfield = data_get_field_from_name($name);
//use native subclass method to store field data
$currentfield->update_data_content($currentfield->id, $rid, $value, $name);
if (($currentfield = data_get_field_from_name($name)) !== false) {
//use native subclass method to store field data
$currentfield->update_data_content($currentfield->id, $rid, $value, $name);
}
}
}
redirect($CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&rid='.$rid);
Expand Down Expand Up @@ -200,8 +201,10 @@
$replacement = array(); //html to replace those yucky tags

//form goes here first in case add template is empty
echo '<form enctype="multipart/form-data" action="add.php?d='.$data->id.'&amp;rid='.$rid.'" method="post">';
echo '<input name="sesskey" value="'.sesskey().'" type="hidden">';
echo '<form enctype="multipart/form-data" action="add.php" method="post">';
echo '<input name="d" value="'.$data->id.'" type="hidden" />';
echo '<input name="rid" value="'.$rid.'" type="hidden" />';
echo '<input name="sesskey" value="'.sesskey().'" type="hidden"/>';
print_simple_box_start('center','80%');

if (!$rid){
Expand Down
2 changes: 2 additions & 0 deletions mod/data/lib.php
Expand Up @@ -326,6 +326,8 @@ function data_get_field_from_name($name){

if ($field){
return data_get_field($field);
} else {
return false;
}

}
Expand Down

0 comments on commit 6f4e039

Please sign in to comment.