diff --git a/main/lp/lp_subscribe_users.php b/main/lp/lp_subscribe_users.php index f7e6da416d..79571f150a 100644 --- a/main/lp/lp_subscribe_users.php +++ b/main/lp/lp_subscribe_users.php @@ -152,16 +152,12 @@ $groupMultiSelect = $form->addElement( // submit button $form->addButtonSave(get_lang('Save')); -Display::addFlash(Display::return_message(get_lang('UserLpSubscriptionDescription'))); - $defaults = array(); if (!empty($selectedGroupChoices)) { $defaults['groups'] = $selectedGroupChoices; } $form->setDefaults($defaults); -$tpl = new Template(); - $currentUser = api_get_user_entity(api_get_user_id()); if ($form->validate()) { @@ -202,13 +198,13 @@ if ($form->validate()) { header("Location: $url"); exit; } else { + Display::addFlash(Display::return_message(get_lang('UserLpSubscriptionDescription'))); $headers = [ get_lang('SubscribeUsersToLp'), get_lang('SubscribeGroupsToLp') ]; + $tpl = new Template(); $tabs = Display::tabs($headers, [$formUsers->toHtml(), $form->toHtml()]); - $tpl->assign('tabs', $tabs); + $tpl->assign('content', $tabs); + $tpl->display_one_col_template(); } - -$layout = $tpl->get_template('learnpath/subscribe_users.tpl'); -$tpl->display($layout); diff --git a/main/template/default/learnpath/subscribe_users.tpl b/main/template/default/learnpath/subscribe_users.tpl deleted file mode 100644 index d48597d16c..0000000000 --- a/main/template/default/learnpath/subscribe_users.tpl +++ /dev/null @@ -1,6 +0,0 @@ -{% extends template ~ "/layout/layout_1_col.tpl" %} -{% block content %} - - {{ tabs }} - -{% endblock %}