MDL-15777 - updated most of the portfolio code to use files api.

Not done:

- forum (the rest of the module isn't using files api yet)
- database mod (touches other parts of the code (ods and excel libs)
- portfolio download plugin (needs discussion with petr about userfiles)

all of these have been disabled in the meantime.
This commit is contained in:
mjollnir_ 2008-08-09 14:24:58 +00:00
parent db79c1b960
commit d67bfc32a1
13 changed files with 178 additions and 126 deletions

View file

@ -53,11 +53,16 @@ class mod_data_export_form extends moodleform {
}
$this->add_checkbox_controller(1, null, null, 1);
require_once($CFG->libdir . '/portfoliolib.php');
if ($portfoliooptions = portfolio_instance_select(portfolio_instances(), call_user_func(array('data_portfolio_caller', 'supported_formats')), 'data_portfolio_caller', '', true, true)) {
$mform->addElement('header', 'notice', get_string('portfolionotfile', 'portfolio') . ':');
$portfoliooptions[0] = get_string('none');
ksort($portfoliooptions);
$mform->addElement('select', 'portfolio', get_string('portfolio', 'portfolio'), $portfoliooptions);
if (false) { // @todo penny replace with permissions check
if ($portfoliooptions = portfolio_instance_select(
portfolio_instances(),
call_user_func(array('data_portfolio_caller', 'supported_formats')),
'data_portfolio_caller', '', true, true)) {
$mform->addElement('header', 'notice', get_string('portfolionotfile', 'portfolio') . ':');
$portfoliooptions[0] = get_string('none');
ksort($portfoliooptions);
$mform->addElement('select', 'portfolio', get_string('portfolio', 'portfolio'), $portfoliooptions);
}
}
$this->add_action_buttons(true, get_string('exportdatabaserecords', 'data'));
}

View file

@ -2472,7 +2472,7 @@ class data_portfolio_caller extends portfolio_module_caller_base {
return sha1($str . ',' . $this->exporttype);
}
public function prepare_package($tempdir) {
public function prepare_package() {
global $DB;
$count = count($this->exportdata);
switch ($this->exporttype) {