$post->courseid = $courseid; $post->type = $existing->type; $strAction = get_string('edit'); if ($type == 'link') { $post->url = $existing->url; } elseif ($type == 'file') { $post->attachment = $existing->attachment; $filearea = block_exabis_eportfolio_file_area_name($post); $ffurl = ''; if ($CFG->slasharguments) { $ffurl = "{$CFG->wwwroot}/blocks/exabis_eportfolio/portfoliofile.php/{$filearea}/{$post->attachment}"; } else { $ffurl = "{$CFG->wwwroot}/blocks/exabis_eportfolio/portfoliofile.php?file=/{$filearea}/{$post->attachment}"; } $extra_content = "<div class='block_eportfolio_center'>\n"; $extra_content .= print_box(block_exabis_eportfolio_print_file($ffurl, $post->attachment, $post->name), 'generalbox', '', true); $extra_content .= "</div>"; } break; default: print_error("unknownaction", "block_exabis_eportfolio"); } block_exabis_eportfolio_print_header("bookmarks" . block_exabis_eportfolio_get_plural_item_type($backtype), $action); $editform->set_data($post); echo $extra_content; $editform->display(); print_footer($course); /** * Update item in the database */ function block_exabis_eportfolio_do_edit($post, $blogeditform, $returnurl, $courseid)
$strAction = ""; // gui setup switch ($action) { case 'add': $post->action = $action; $post->courseid = $courseid; $post->assignmentid = $assignmentid; $post->filename = $checked_file->filename; $strAction = get_string('new'); break; default: print_error("unknownaction", "block_exabis_eportfolio"); } block_exabis_eportfolio_print_header("bookmarksfiles"); echo "<div class='block_eportfolio_center'>\n"; print_box(block_exabis_eportfolio_print_file($CFG->wwwroot . '/' . 'file.php?file=/' . $checked_file->fullpath, $checked_file->filename, $checked_file->filename)); echo "</div>"; $exteditform->set_data($post); $exteditform->display(); print_footer($course); die; /** * Update a file in the database */ function do_edit($post, $blogeditform, $returnurl, $courseid) { global $CFG, $USER; $post->timemodified = time(); if (update_record('block_exabeporitem', $post)) { add_to_log(SITEID, 'bookmark', 'update', 'add_file.php?courseid=' . $courseid . '&id=' . $post->id . '&action=edit', $post->name); } else {