Minor - format code, add flash message

pull/2539/head
jmontoyaa 7 years ago
parent 1a7771da11
commit 0f465716f4
  1. 10
      main/dashboard/index.php
  2. 7
      main/lp/lp_controller.php

@ -36,7 +36,7 @@ if (isset($_GET['action']) && in_array($_GET['action'], $actions)) {
$htmlHeadXtra[] = DashboardManager::getStyleSheet();
// course description controller object
$dashboard_controller = new DashboardController();
$dashboardController = new DashboardController();
if (isset($_GET['path'])) {
$path = $_GET['path'];
@ -45,14 +45,14 @@ if (isset($_GET['path'])) {
// distpacher actions to controller
switch ($action) {
case 'listing':
$dashboard_controller->display();
$dashboardController->display();
break;
case 'store_user_block':
$dashboard_controller->store_user_block();
$dashboardController->store_user_block();
break;
case 'disable_block':
$dashboard_controller->close_user_block($path);
$dashboardController->close_user_block($path);
break;
default:
$dashboard_controller->display();
$dashboardController->display();
}

@ -883,9 +883,7 @@ switch ($action) {
} else {
Session::write('refresh', 1);
$_SESSION['oLP']->delete(null, $_GET['lp_id'], 'remove');
Skill::deleteSkillsFromItem($_GET['lp_id'], ITEM_TYPE_LEARNPATH);
Display::addFlash(Display::return_message(get_lang('Deleted')));
Session::erase('oLP');
require 'lp_list.php';
@ -897,7 +895,7 @@ switch ($action) {
}
learnpath::toggleCategoryVisibility($_REQUEST['id'], $_REQUEST['new_status']);
Display::addFlash(Display::return_message(get_lang('Updated')));
header('Location: '.api_get_self().'?'.api_get_cidreq());
exit;
case 'toggle_visible':
@ -910,6 +908,7 @@ switch ($action) {
require 'lp_list.php';
} else {
learnpath::toggle_visibility($_REQUEST['lp_id'], $_REQUEST['new_status']);
Display::addFlash(Display::return_message(get_lang('Updated')));
require 'lp_list.php';
}
break;
@ -919,6 +918,7 @@ switch ($action) {
}
learnpath::toggleCategoryPublish($_REQUEST['id'], $_REQUEST['new_status']);
Display::addFlash(Display::return_message(get_lang('Updated')));
require 'lp_list.php';
break;
case 'toggle_publish':
@ -930,6 +930,7 @@ switch ($action) {
require 'lp_list.php';
} else {
learnpath::toggle_publish($_REQUEST['lp_id'], $_REQUEST['new_status']);
Display::addFlash(Display::return_message(get_lang('Updated')));
require 'lp_list.php';
}
break;

Loading…
Cancel
Save