From 384ba38af426b50eda537829c219c461242aa9df Mon Sep 17 00:00:00 2001 From: Penelope Leach Date: Mon, 16 Nov 2009 12:57:59 +0000 Subject: [PATCH] portfolio - MDL-19356 - rename allows_multiple to allows_multiple_instances this disambiguates, so we can have a function called allows_multiple_exports --- lang/en_utf8/portfolio.php | 2 +- lib/adminlib.php | 2 +- lib/portfolio/plugin.php | 6 +++--- portfolio/type/boxnet/lib.php | 2 +- portfolio/type/download/lib.php | 2 +- portfolio/type/flickr/lib.php | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lang/en_utf8/portfolio.php b/lang/en_utf8/portfolio.php index 58f63de096..bff3bdc8b5 100644 --- a/lang/en_utf8/portfolio.php +++ b/lang/en_utf8/portfolio.php @@ -95,7 +95,7 @@ $string['moderatefilesizethreshold'] = 'Moderate transfer filesize'; $string['moderatefilesizethresholddesc'] = 'Filesizes over this threshold will be considered to take a moderate amount of time to transfer'; $string['moderatedbsizethreshold'] = 'Moderate transfer dbsize'; $string['moderatedbsizethresholddesc'] = 'Number of db records over which will be considered to take a moderate amount of time to transfer'; -$string['multipledisallowed'] = 'Trying to create another instance of a plugin that has disallowed multiple instances ($a)'; +$string['multipleinstancesdisallowed'] = 'Trying to create another instance of a plugin that has disallowed multiple instances ($a)'; $string['mustsetcallbackoptions'] = 'You must set the callback options either in the portfolio_add_button constructor or using the set_callback_options method'; $string['noavailableplugins'] = 'Sorry, but there are no available portfolios for you to export to'; $string['nocallbackfile'] = 'Something in the module you\'re trying to export from is broken - couldn\'t find a required file ($a)'; diff --git a/lib/adminlib.php b/lib/adminlib.php index 5e0562987f..e9bb4a4167 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -5142,7 +5142,7 @@ class admin_setting_manageportfolio extends admin_setting { $instancehtml = '

' . get_string('addnewportfolio', 'portfolio') . ':

'; $addable = 0; foreach ($plugins as $p) { - if (!portfolio_static_function($p, 'allows_multiple') && in_array($p, $alreadyplugins)) { + if (!portfolio_static_function($p, 'allows_multiple_instances') && in_array($p, $alreadyplugins)) { continue; } if (array_key_exists($p, $insane)) { diff --git a/lib/portfolio/plugin.php b/lib/portfolio/plugin.php index 44c1cb5085..10679ea96a 100644 --- a/lib/portfolio/plugin.php +++ b/lib/portfolio/plugin.php @@ -378,7 +378,7 @@ abstract class portfolio_plugin_base { * * @return boolean */ - public static function allows_multiple() { + public static function allows_multiple_instances() { return true; } @@ -436,10 +436,10 @@ abstract class portfolio_plugin_base { 'plugin' => $plugin, 'name' => $name, ); - if (!portfolio_static_function($plugin, 'allows_multiple')) { + if (!portfolio_static_function($plugin, 'allows_multiple_instances')) { // check we don't have one already if ($DB->record_exists('portfolio_instance', array('plugin' => $plugin))) { - throw new portfolio_exception('multipledisallowed', 'portfolio', '', $plugin); + throw new portfolio_exception('multipleinstancesdisallowed', 'portfolio', '', $plugin); } } $newid = $DB->insert_record('portfolio_instance', $new); diff --git a/portfolio/type/boxnet/lib.php b/portfolio/type/boxnet/lib.php index 0763c9f525..f03278c419 100644 --- a/portfolio/type/boxnet/lib.php +++ b/portfolio/type/boxnet/lib.php @@ -240,7 +240,7 @@ class portfolio_plugin_boxnet extends portfolio_plugin_push_base { //@TODO see if we can verify the api key without actually getting an authentication token } - public static function allows_multiple() { + public static function allows_multiple_instances() { return false; } diff --git a/portfolio/type/download/lib.php b/portfolio/type/download/lib.php index 10978f6e38..1f175c952b 100644 --- a/portfolio/type/download/lib.php +++ b/portfolio/type/download/lib.php @@ -10,7 +10,7 @@ class portfolio_plugin_download extends portfolio_plugin_pull_base { return get_string('pluginname', 'portfolio_download'); } - public static function allows_multiple() { + public static function allows_multiple_instances() { return false; } diff --git a/portfolio/type/flickr/lib.php b/portfolio/type/flickr/lib.php index dff7aaa08b..2ce4df1817 100755 --- a/portfolio/type/flickr/lib.php +++ b/portfolio/type/flickr/lib.php @@ -51,7 +51,7 @@ class portfolio_plugin_flickr extends portfolio_plugin_push_base { } } - public static function allows_multiple() { + public static function allows_multiple_instances() { return false; } -- 2.39.5