mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
Merge branch 'MDL-33552' of git://github.com/danpoltawski/moodle
This commit is contained in:
commit
e04a0e32c7
8 changed files with 20 additions and 20 deletions
|
@ -199,13 +199,9 @@ final class portfolio_admin_form extends moodleform {
|
|||
|
||||
// let the plugin add the fields they want (either statically or not)
|
||||
if (portfolio_static_function($this->plugin, 'has_admin_config')) {
|
||||
if (!$this->instance) {
|
||||
require_once($CFG->libdir . '/portfolio/plugin.php');
|
||||
require_once($CFG->dirroot . '/portfolio/' . $this->plugin . '/lib.php');
|
||||
call_user_func(array('portfolio_plugin_' . $this->plugin, 'admin_config_form'), $mform);
|
||||
} else {
|
||||
$this->instance->admin_config_form($mform);
|
||||
}
|
||||
require_once($CFG->libdir . '/portfolio/plugin.php');
|
||||
require_once($CFG->dirroot . '/portfolio/' . $this->plugin . '/lib.php');
|
||||
call_user_func(array('portfolio_plugin_' . $this->plugin, 'admin_config_form'), $mform);
|
||||
}
|
||||
|
||||
// and set the data if we have some.
|
||||
|
@ -237,12 +233,7 @@ final class portfolio_admin_form extends moodleform {
|
|||
}
|
||||
|
||||
$pluginerrors = array();
|
||||
if ($this->instance) {
|
||||
$pluginerrors = $this->instance->admin_config_validation($data);
|
||||
}
|
||||
else {
|
||||
$pluginerrors = portfolio_static_function($this->plugin, 'admin_config_validation', $data);
|
||||
}
|
||||
$pluginerrors = portfolio_static_function($this->plugin, 'admin_config_validation', $data);
|
||||
if (is_array($pluginerrors)) {
|
||||
$errors = array_merge($errors, $pluginerrors);
|
||||
}
|
||||
|
|
|
@ -347,7 +347,7 @@ abstract class portfolio_plugin_base {
|
|||
*
|
||||
* @param moodleform $mform passed by reference, add elements to it.
|
||||
*/
|
||||
public function admin_config_form(&$mform) {}
|
||||
public static function admin_config_form(&$mform) {}
|
||||
|
||||
/**
|
||||
* Just like the moodle form validation function,
|
||||
|
@ -356,7 +356,7 @@ abstract class portfolio_plugin_base {
|
|||
*
|
||||
* @param array $data data from form.
|
||||
*/
|
||||
public function admin_config_validation($data) {}
|
||||
public static function admin_config_validation($data) {}
|
||||
|
||||
/**
|
||||
* mform to display to the user exporting data using this plugin.
|
||||
|
|
|
@ -106,7 +106,7 @@ class portfolio_plugin_boxnet extends portfolio_plugin_push_base {
|
|||
}
|
||||
}
|
||||
|
||||
public function admin_config_form(&$mform) {
|
||||
public static function admin_config_form(&$mform) {
|
||||
global $CFG;
|
||||
|
||||
$mform->addElement('text', 'apikey', get_string('apikey', 'portfolio_boxnet'));
|
||||
|
|
|
@ -96,7 +96,7 @@ class portfolio_plugin_flickr extends portfolio_plugin_push_base {
|
|||
return true;
|
||||
}
|
||||
|
||||
public function admin_config_form(&$mform) {
|
||||
public static function admin_config_form(&$mform) {
|
||||
global $CFG;
|
||||
|
||||
$strrequired = get_string('required');
|
||||
|
|
|
@ -100,7 +100,7 @@ class portfolio_plugin_googledocs extends portfolio_plugin_push_base {
|
|||
return array('clientid', 'secret');
|
||||
}
|
||||
|
||||
public function admin_config_form(&$mform) {
|
||||
public static function admin_config_form(&$mform) {
|
||||
$a = new stdClass;
|
||||
$a->docsurl = get_docs_url('Google_OAuth2_Setup');
|
||||
$a->callbackurl = google_oauth::callback_url()->out(false);
|
||||
|
|
|
@ -84,7 +84,7 @@ class portfolio_plugin_mahara extends portfolio_plugin_pull_base {
|
|||
return true;
|
||||
}
|
||||
|
||||
public function admin_config_form(&$mform) {
|
||||
public static function admin_config_form(&$mform) {
|
||||
$strrequired = get_string('required');
|
||||
$hosts = self::get_mnet_hosts(); // this is called by sanity check but it's ok because it's cached
|
||||
foreach ($hosts as $host) {
|
||||
|
|
|
@ -100,7 +100,7 @@ class portfolio_plugin_picasa extends portfolio_plugin_push_base {
|
|||
return array('clientid', 'secret');
|
||||
}
|
||||
|
||||
public function admin_config_form(&$mform) {
|
||||
public static function admin_config_form(&$mform) {
|
||||
$a = new stdClass;
|
||||
$a->docsurl = get_docs_url('Google_OAuth2_Setup');
|
||||
$a->callbackurl = google_oauth::callback_url()->out(false);
|
||||
|
|
9
portfolio/upgrade.txt
Normal file
9
portfolio/upgrade.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
This files describes API changes in /portfolio/ portfolio system,
|
||||
information provided here is intended especially for developers.
|
||||
|
||||
=== 2.3 ===
|
||||
|
||||
required changes:
|
||||
* The following methods must now be declared static for php5 compatibility:
|
||||
- admin_config_form
|
||||
- admin_config_validation
|
Loading…
Add table
Add a link
Reference in a new issue