portfolio - MDL-19356 - rename allows_multiple to allows_multiple_instances
this disambiguates, so we can have a function called allows_multiple_exports
This commit is contained in:
@@ -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)';
|
||||
|
||||
+1
-1
@@ -5142,7 +5142,7 @@ class admin_setting_manageportfolio extends admin_setting {
|
||||
$instancehtml = '<br /><br />' . get_string('addnewportfolio', 'portfolio') . ': <br /><br />';
|
||||
$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)) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user