diff --git a/acp/portal_module.php b/acp/portal_module.php index 9166bba9..277416c8 100644 --- a/acp/portal_module.php +++ b/acp/portal_module.php @@ -448,7 +448,7 @@ class portal_module } // do not install if module already exists in that column - if (!$submit && $module_classname != 'custom') + if (!$submit && $module_classname != '\board3\portal\modules\custom') { trigger_error($this->user->lang['MODULE_ADD_ONCE'] . adm_back_link($this->u_action), E_USER_WARNING); } @@ -579,6 +579,27 @@ class portal_module 'S_MODULE_NAMES' => $options, 'S_HIDDEN_FIELDS' => $s_hidden_fields, )); + + if ($this->request->is_ajax()) + { + $this->template->assign_vars(array( + 'S_AJAX_REQUEST' => true, + 'U_ACTION' => str_replace('&', '&', $this->get_module_link('modules', $module_id)), + )); + $this->template->set_filenames(array( + 'body' => 'portal/acp_portal_modules.html') + ); + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'MESSAGE_BODY' => $this->template->assign_display('body'), + 'MESSAGE_TITLE' => $this->user->lang['ADD_MODULE'], + 'MESSAGE_TEXT' => $this->user->lang['ADD_MODULE'], + + 'YES_VALUE' => $this->user->lang['SUBMIT'], + 'S_CONFIRM_ACTION' => str_replace('&', '&', $this->get_module_link('modules', $module_id)), //inefficient, rewrite whole function + 'S_HIDDEN_FIELDS' => $s_hidden_fields + )); + } } else { diff --git a/adm/style/portal/acp_portal_modules.html b/adm/style/portal/acp_portal_modules.html index 3532a8e2..8f2cc80b 100644 --- a/adm/style/portal/acp_portal_modules.html +++ b/adm/style/portal/acp_portal_modules.html @@ -1,14 +1,31 @@ + +
+
+
+

{L_CHOOSE_MODULE_EXP}
+
+
+ +

+   + + {S_FORM_TOKEN}{S_HIDDEN_FIELDS} +

+
+
+ + +

{L_ACP_PORTAL_MODULES}

{L_ACP_PORTAL_MODULES_EXP}

- {L_GENERAL_OPTIONS}

{L_CHOOSE_MODULE_EXP}
@@ -27,7 +44,7 @@

{L_ACP_PORTAL_MODULES}

{L_ACP_PORTAL_MODULES_EXP}

- +
{L_ACP_PORTAL_MODULES} @@ -172,4 +189,5 @@ - \ No newline at end of file + + \ No newline at end of file