diff --git a/htdocs/admin/users/addauthority.php b/htdocs/admin/users/addauthority.php index c719db7c404e62041141dae37cff1168cffe773b..8316832aeeb560032ef35eaa95d675569f26c5bb 100644 --- a/htdocs/admin/users/addauthority.php +++ b/htdocs/admin/users/addauthority.php @@ -14,15 +14,8 @@ require(dirname(dirname(dirname(__FILE__))) . '/init.php'); define('TITLE', get_string('institutions', 'admin')); require_once('pieforms/pieform.php'); require_once(get_config('docroot') . '/lib/htmloutput.php'); +define('MENUITEM', 'manageinstitutions/institutions'); -// CHECK FOR CANCEL BEFORE THE 'REQUIRED' PARAMS: -$cancel = param_boolean('c'); - -if ($cancel) { - execute_javascript_and_close(); -} - -// NOT CANCELLING? OK - OTHER PARAMS THEN: $institution = param_variable('i'); $plugin = param_variable('p'); $add = param_boolean('add'); @@ -80,7 +73,7 @@ if ($institution && $plugin) { $form['elements']['submit'] = array( 'type' => 'submitcancel', 'value' => array(get_string('submit'), get_string('cancel')), - 'goto' => 'addauthority.php?c=1' + 'goto' => get_config('wwwroot') . 'admin/users/institutions.php?i=' . $institution ); $form = pieform($form); @@ -112,21 +105,9 @@ function auth_config_submit(Pieform $form, $values) { $classname = 'PluginAuth' . ucfirst(strtolower($plugin)); safe_require('auth', strtolower($plugin)); - try { - $values = call_static_method($classname, 'save_instance_config_options', $values, $form); - } catch (Exception $e) { - log_info($e->getMessage()); - log_info($e->getTrace()); - $SESSION->add_error_msg("An error occurred while processing this form: " . $e->getMessage()); - redirect('/admin/users/addauthority.php?'. $_SERVER['QUERY_STRING']); - } + $values = call_static_method($classname, 'save_instance_config_options', $values, $form); - if (array_key_exists('create', $values) && $values['create']) { - execute_javascript_and_close('window.opener.addAuthority('.$values['instance'].', "'.addslashes($values['instancename']).'", "'.$values['authname'].'");'); - } else { - execute_javascript_and_close(); - } - exit; + redirect(get_config('wwwroot') . 'admin/users/institutions.php?i=' . $values['institution']); } $js = <<"; + return array($result); +} \ No newline at end of file diff --git a/htdocs/lib/htmloutput.php b/htdocs/lib/htmloutput.php index b7dada3de9fd5d0f687cdfbed0136a23c743de50..8bf22ef279a5ce4f25ecfa1bd8edb9199d707e39 100644 --- a/htdocs/lib/htmloutput.php +++ b/htdocs/lib/htmloutput.php @@ -107,22 +107,6 @@ function print_extractprogress_footer($message, $next) { - - You may close this window - - - This window should close automatically'. - "\n"; - exit; -} - function print_meta_redirect($url, $title = 'Mahara Redirect') { print ''; print "$title"; diff --git a/htdocs/lib/pieforms/static/core/pieforms.js b/htdocs/lib/pieforms/static/core/pieforms.js index 91c8e90db100c996630a2ff1119b9bd74ae37ee7..2d2e0bf6d88c3430e810fed22655f6b55c8d1cae 100644 --- a/htdocs/lib/pieforms/static/core/pieforms.js +++ b/htdocs/lib/pieforms/static/core/pieforms.js @@ -148,6 +148,10 @@ function Pieform(data) {//{{{ connect(self.data.name, 'onsubmit', self.processForm); self.connectSubmitButtons(); + + // Hook for pieform elements that need to execute Javascript + // *after* the Pieform has been initialized. + jQuery(document).triggerHandler('pieform_postinit', self); }//}}} this.processForm = function(e) {//{{{ diff --git a/htdocs/theme/raw/templates/admin/users/addauthority.tpl b/htdocs/theme/raw/templates/admin/users/addauthority.tpl index 7ca6b09f4360f418e108e9ceed94d55abd3f0706..f22f20df3dd77b8d9c1764c2ce0caf71e2fe7903 100644 --- a/htdocs/theme/raw/templates/admin/users/addauthority.tpl +++ b/htdocs/theme/raw/templates/admin/users/addauthority.tpl @@ -1,4 +1,4 @@ -{include file="microheader.tpl"} +{include file="header.tpl"}

{str tag="adminauthorities" section="admin"}

{$auth_imap_form|safe} -{include file="microfooter.tpl"} +{include file="footer.tpl"} diff --git a/htdocs/theme/raw/templates/admin/users/institutionsresults.tpl b/htdocs/theme/raw/templates/admin/users/institutionsresults.tpl index ad3641672bc5c8131bc6bba46e240cae796d0db1..bb795dfed6261374d49f2fef3a54b18446970cbd 100644 --- a/htdocs/theme/raw/templates/admin/users/institutionsresults.tpl +++ b/htdocs/theme/raw/templates/admin/users/institutionsresults.tpl @@ -23,7 +23,7 @@ {if !$institution->site}{/if} {if $institution->suspended}{str tag="suspendedinstitution" section=admin}{/if} -
+ diff --git a/htdocs/theme/raw/templates/form/authlist.tpl b/htdocs/theme/raw/templates/form/authlist.tpl index 42d0c5fd50b5d118b82e00c5ce156977b1b7b76a..804dffa9977fd0ae84eff74e9eddcb7cd6615e81 100644 --- a/htdocs/theme/raw/templates/form/authlist.tpl +++ b/htdocs/theme/raw/templates/form/authlist.tpl @@ -136,7 +136,7 @@ } if (requiresConfig(selectedPlugin) == 1) { - window.open('addauthority.php?add=1&i={{$institution}}&p=' + selectedPlugin, 'addinstance', 'height=600,width=800,screenx=250,screenY=200,scrollbars=1'); + window.location = 'addauthority.php?add=1&i={{$institution}}&p=' + selectedPlugin; return; } @@ -153,7 +153,7 @@ function editinstance(id, plugin) { if (requiresConfig(plugin)) { - window.open('addauthority.php?id='+id+'&edit=1&i={{$institution}}&p=' + plugin, 'editinstance', 'height=520,width=550,screenx=250,screenY=200,scrollbars=1'); + window.location = 'addauthority.php?id='+id+'&edit=1&i={{$institution}}&p=' + plugin; } else { alert({{$noauthpluginconfigoptions|safe}}); } @@ -171,10 +171,6 @@ } instanceArray.push(id); rebuildInstanceList(instanceArray); - if (typeof formchangemanager !== 'undefined') { - var form = jQuery('div#instanceList').closest('form')[0]; - formchangemanager.setFormState(form, FORM_CHANGED); - } replaceChildNodes('messages'); }