if (!empty($edit) || !empty($new)) {
if (!empty($edit)) {
$instance = repository::get_instance($edit);
- $instancetype = repository::get_type_by_id($instance->typeid);
+ $instancetype = repository::get_type_by_id($instance->options['typeid']);
$classname = 'repository_' . $instancetype->get_typename();
$configs = $instance->get_instance_option_names();
$plugin = $instancetype->get_typename();
- $typeid = $instance->typeid;
+ $typeid = $instance->options['typeid'];
} else {
$plugin = $new;
$typeid = $new;
);
public function __construct($repositoryid, $context = SITEID, $options = array()) {
parent::__construct($repositoryid, $context, $options);
- if (empty($this->root_path)) {
+ if (empty($this->options['root_path'])) {
return;
}
- $this->root_path = trim($this->root_path);
+ $this->root_path = trim($this->options['root_path']);
if (!empty($options['ajax'])) {
// if created from filepicker
if (empty($this->root_path)) {
$delete .= '<a href="' . $baseurl . '&type='.$typename.'&delete=' . $i->id . '">' . $deletestr . '</a>' . "\n";
}
- $type = repository::get_type_by_id($i->typeid);
+ $type = repository::get_type_by_id($i->options['typeid']);
$table->data[] = array($i->name, $type->get_readablename(), $delete, $settings);
//display a grey row if the type is defined as not visible
$result = $this->instance->instance_config_form($mform);
// and set the data if we have some.
foreach ($this->instance->get_instance_option_names() as $config) {
- if (!empty($this->instance->$config)) {
- $data[$config] = $this->instance->$config;
+ if (!empty($this->instance->options[$config])) {
+ $data[$config] = $this->instance->options[$config];
} else {
$data[$config] = '';
}