|
3 | 3 |
|
4 | 4 | require_once __DIR__.'/../../main/inc/global.inc.php'; |
5 | 5 |
|
6 | | -api_protect_admin_script(); |
| 6 | +$allowSessionAdmins = api_get_plugin_setting('justification', 'access_for_session_admin') === 'true'; |
| 7 | +api_protect_admin_script($allowSessionAdmins); |
7 | 8 |
|
8 | 9 | $tool = 'justification'; |
9 | 10 | $plugin = Justification::create(); |
|
31 | 32 | break; |
32 | 33 | } |
33 | 34 |
|
34 | | -$actionLinks .= Display::toolbarButton( |
35 | | - $plugin->get_lang('Add'), |
36 | | - api_get_path(WEB_PLUGIN_PATH).'justification/add.php', |
37 | | - 'plus', |
38 | | - 'primary' |
39 | | -); |
| 35 | +if (api_is_platform_admin()) { |
| 36 | + $actionLinks .= Display::toolbarButton( |
| 37 | + $plugin->get_lang('Add'), |
| 38 | + api_get_path(WEB_PLUGIN_PATH).'justification/add.php', |
| 39 | + 'plus', |
| 40 | + 'primary' |
| 41 | + ); |
| 42 | +} |
| 43 | + |
40 | 44 | $actionLinks .= Display::toolbarButton( |
41 | 45 | $plugin->get_lang('Users'), |
42 | 46 | api_get_path(WEB_PLUGIN_PATH).'justification/justification_by_user.php', |
43 | 47 | 'user', |
44 | 48 | 'primary' |
45 | 49 | ); |
46 | 50 |
|
47 | | -$actionLinks .= Display::toolbarButton( |
48 | | - $plugin->get_lang('SetNewCourse'), |
49 | | - api_get_path(WEB_PLUGIN_PATH).'justification/set_course.php', |
50 | | - 'book', |
51 | | - 'primary' |
52 | | -); |
| 51 | +if (api_is_platform_admin()) { |
| 52 | + $actionLinks .= Display::toolbarButton( |
| 53 | + $plugin->get_lang('SetNewCourse'), |
| 54 | + api_get_path(WEB_PLUGIN_PATH).'justification/set_course.php', |
| 55 | + 'book', |
| 56 | + 'primary' |
| 57 | + ); |
| 58 | +} |
53 | 59 |
|
54 | 60 | $tpl->assign( |
55 | 61 | 'actions', |
|
0 commit comments