Justification plugin: add course link in index BT#16387

pull/3052/head
Julio 6 years ago
parent 26367fc196
commit c4f198c452
  1. 18
      index.php
  2. 5
      plugin/justification/lang/english.php
  3. 3
      plugin/justification/lang/french.php

@ -150,13 +150,27 @@ if (api_get_configuration_value('show_hot_sessions') === true) {
}
$controller->tpl->assign('hot_courses', $hotCourses);
$controller->tpl->assign('announcements_block', $announcements_block);
$allowJustification = api_get_plugin_setting('justification', 'tool_enable') === 'true';
$justification = '';
if ($allowJustification) {
$plugin = Justification::create();
$courseId = api_get_plugin_setting('justification', 'default_course_id');
if (!empty($courseId)) {
$courseInfo = api_get_course_info_by_id($courseId);
$link = Display::url($plugin->get_lang('SubscribeToASession'), $courseInfo['course_public_url']);
$justification = Display::return_message($link, 'info', false);
}
}
if ($includeFile) {
// If we are including a static page, then home_welcome is empty
$controller->tpl->assign('home_welcome', '');
$controller->tpl->assign('home_welcome', $justification);
$controller->tpl->assign('home_include', $controller->return_home_page($includeFile));
} else {
// If we are including the real homepage, then home_include is empty
$controller->tpl->assign('home_welcome', $controller->return_home_page(false));
$controller->tpl->assign('home_welcome', $justification.$controller->return_home_page(false));
$controller->tpl->assign('home_include', '');
}
$controller->tpl->assign('navigation_links', $controller->return_navigation_links());

@ -12,12 +12,11 @@ $strings['NoJustificationFound'] = "No justification found";
$strings['ValidityDate'] = "Validity date";
$strings['Justification'] = "Justification";
$strings['MyJustifications'] = "My justifications";
$strings['JustificationSaved'] = "Justification saved";
$strings['default_course_id'] = "Course id";
$strings['SetCourse'] = "Set course";
$strings['SubscribeToASession'] = "Subscribe to a session";

@ -2,5 +2,6 @@
$strings['plugin_title'] = "Justification Plugin";
$strings['plugin_comment'] = "";
$strings['tool_enable'] = "Activer le plugin";
$strings['SubscribeToASession'] = "S'inscrire à une session d'examen";

Loading…
Cancel
Save