'delete' => $strdelete
);
- $actionchoicesforinsane = array(
- 'hide' => $strhide,
- 'delete' => $strdelete
- );
-
$output = $OUTPUT->box_start('generalbox');
$plugins = get_plugin_list('portfolio');
$insane = portfolio_plugin_sanity_check($plugins);
$insaneinstances = portfolio_instance_sanity_check($instances);
- $output .= portfolio_report_insane($insane, null, true);
- $output .= portfolio_report_insane($insaneinstances, $instances, true);
-
$table = new html_table();
$table->head = array(get_string('plugin', 'portfolio'), '', '');
$table->data = array();
foreach ($instances as $i) {
$settings = '<a href="' . $this->baseurl . '&action=edit&pf=' . $i->get('id') . '">' . $strsettings .'</a>';
+ // Set some commonly used variables
+ $pluginid = $i->get('id');
+ $plugin = $i->get('plugin');
+ $pluginname = $i->get('name');
// Check if the instance is misconfigured
- if (array_key_exists($i->get('plugin'), $insane) || array_key_exists($i->get('id'), $insaneinstances)) {
- $select = new single_select($this->portfolio_action_url($i->get('id'), 'pf'), 'action', $actionchoicesforinsane, 'hide', null, 'applyto' . $i->get('id'));
- $table->data[] = array($i->get('name') . " <strong>(" . get_string('portfoliomisconfigured', 'portfolio') . ")</strong>", $OUTPUT->render($select), $settings);
+ if (array_key_exists($plugin, $insane) || array_key_exists($pluginid, $insaneinstances)) {
+ if (!empty($insane[$plugin])) {
+ $information = $insane[$plugin];
+ } else if (!empty($insaneinstances[$pluginid])) {
+ $information = $insaneinstances[$pluginid];
+ }
+ $table->data[] = array($pluginname, $strdelete . " " . $OUTPUT->help_icon($information, 'portfolio_' . $plugin), $settings);
} else {
if ($i->get('visible')) {
$currentaction = 'show';
} else {
$currentaction = 'hide';
}
- $select = new single_select($this->portfolio_action_url($i->get('id'), 'pf'), 'action', $actionchoicesforexisting, $currentaction, null, 'applyto' . $i->get('id'));
- $table->data[] = array($i->get('name'), $OUTPUT->render($select), $settings);
+ $select = new single_select($this->portfolio_action_url($pluginid, 'pf'), 'action', $actionchoicesforexisting, $currentaction, null, 'applyto' . $pluginid);
+ $table->data[] = array($pluginname, $OUTPUT->render($select), $settings);
}
- if (!in_array($i->get('plugin'), $usedplugins)) {
- $usedplugins[] = $i->get('plugin');
+ if (!in_array($plugin, $usedplugins)) {
+ $usedplugins[] = $plugin;
}
}
+ // Create insane plugin array
+ $insaneplugins = array();
if (!empty($plugins)) {
foreach ($plugins as $p) {
// Check if it can not have multiple instances and has already been used
if (!portfolio_static_function($p, 'allows_multiple_instances') && in_array($p, $usedplugins)) {
continue;
}
- // Check if it is misconfigured
+
+ // Check if it is misconfigured - if so store in array then display later
if (array_key_exists($p, $insane)) {
- continue;
+ $insaneplugins[] = $p;
+ } else {
+ $select = new single_select($this->portfolio_action_url($p, 'pf'), 'action', $actionchoicesfornew, 'delete', null, 'applyto' . $p);
+ $table->data[] = array(portfolio_static_function($p, 'get_name'), $OUTPUT->render($select), '');
}
- $select = new single_select($this->portfolio_action_url($p, 'pf'), 'action', $actionchoicesfornew, 'delete', null, 'applyto' . $p);
- $table->data[] = array(portfolio_static_function($p, 'get_name'), $OUTPUT->render($select), '');
+ }
+ }
+
+ // Loop through all the insane plugins
+ if (!empty($insaneplugins)) {
+ foreach ($insaneplugins as $p) {
+ $table->data[] = array(portfolio_static_function($p, 'get_name'), $strdelete . " " . $OUTPUT->help_icon($insane[$p], 'portfolio_' . $p), '');
}
}
*/
$string['enableleap2a'] = 'Enable Leap2a Portfolio support (requires Mahara 1.3)';
-$string['err_invalidhost'] = 'This plugin is misconfigured to point to an invalid (or deleted) mnet host. This plugin relies on Moodle Networking peers with SSO IDP published, SSO_SP subscribed, and portfolio subscribed <b>and</b> published.';
-$string['err_networkingoff'] = 'Moodle Networking is off entirely. Please enable it before trying to configure this pugin. Any instances of this plugin have been set to not visible until this is fixed - you will need to set them to visible again manully. They cannot be used until this happens';
-$string['err_nomnetauth'] = 'The mnet authentication plugin is disabled, but is required for this service';
-$string['err_nomnethosts'] = 'This plugin relies on Moodle Networking peers with SSO IDP published, SSO SP subscribed, Portfolio services published <b>and</b> subscribed as well as the mnet authentication plugin. Any instances of this plugin has been set to not visible until this is fixed - you will need to set them to visible again manually. They cannot be used before this happens.';
+$string['err_invalidhost'] = 'Invalid mnet host';
+$string['err_invalidhost_help'] = 'This plugin is misconfigured to point to an invalid (or deleted) mnet host. This plugin relies on Moodle Networking peers with SSO IDP published, SSO_SP subscribed, and portfolio subscribed <b>and</b> published.';
+$string['err_networkingoff'] = 'Moodle Networking is off';
+$string['err_networkingoff_help'] = 'Moodle Networking is off entirely. Please enable it before trying to configure this pugin. Any instances of this plugin have been set to not visible until this is fixed - you will need to set them to visible again manully. They cannot be used until this happens';
+$string['err_nomnetauth'] = 'The mnet authentication plugin is disabled';
+$string['err_nomnetauth_help'] = 'The mnet authentication plugin is disabled, but is required for this service';
+$string['err_nomnethosts'] = 'Relies on Moodle Networking';
+$string['err_nomnethosts_help'] = 'This plugin relies on Moodle Networking peers with SSO IDP published, SSO SP subscribed, Portfolio services published <b>and</b> subscribed as well as the mnet authentication plugin. Any instances of this plugin has been set to not visible until this is fixed - you will need to set them to visible again manually. They cannot be used before this happens.';
$string['failedtojump'] = 'Failed to start communication with remote server';
$string['failedtoping'] = 'Failed to start communication with remote server: {$a}';
$string['mnethost'] = 'MNet Host';