|
11 | 11 | $this_section = SECTION_PLATFORM_ADMIN; |
12 | 12 |
|
13 | 13 | api_protect_admin_script(); |
14 | | - |
15 | | -if (api_get_setting('allow_skills_tool') != 'true') { |
16 | | - api_not_allowed(); |
17 | | -} |
| 14 | +Skill::isAllow(); |
18 | 15 |
|
19 | 16 | //Adds the JS needed to use the jqgrid |
20 | 17 | $htmlHeadXtra[] = api_get_jqgrid_js(); |
21 | 18 |
|
22 | 19 | $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'display'; |
23 | 20 |
|
24 | | - |
25 | 21 | // setting breadcrumbs |
26 | | - |
27 | 22 | $tool_name = get_lang('SkillsAndGradebooks'); |
28 | 23 | $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
29 | 24 | if ($action == 'add_skill') { |
30 | 25 | $interbreadcrumb[] = array('url' => 'skills_gradebook.php', 'name' => get_lang('SkillsAndGradebooks')); |
31 | 26 | $tool_name = get_lang('Add'); |
32 | 27 | } |
33 | 28 |
|
34 | | - |
35 | 29 | Display::display_header($tool_name); |
36 | 30 |
|
37 | 31 | //jqgrid will use this URL to do the selects |
38 | | - |
39 | 32 | $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_gradebooks'; |
40 | 33 |
|
41 | 34 | //The order is important you need to check the the $column variable in the model.ajax.php file |
|
84 | 77 |
|
85 | 78 | //With this function we can add actions to the jgrid (edit, delete, etc) |
86 | 79 | $action_links = 'function action_formatter(cellvalue, options, rowObject) { |
87 | | - //certificates |
88 | | - if (rowObject[4] == 1) { |
89 | | - return \'<a href="?action=add_skill&id=\'+options.rowId+\'">'.Display::return_icon('add.png', get_lang('AddSkill'), '', ICON_SIZE_SMALL).'</a>'.'\'; |
90 | | - } else { |
91 | | - return \''.Display::return_icon('add_na.png', get_lang('YourGradebookFirstNeedsACertificateInOrderToBeLinkedToASkill'), '', ICON_SIZE_SMALL).''.'\'; |
92 | | - } |
93 | | - }'; |
| 80 | + //certificates |
| 81 | + if (rowObject[4] == 1) { |
| 82 | + return \'<a href="?action=add_skill&id=\'+options.rowId+\'">'.Display::return_icon('add.png', get_lang('AddSkill'), '', ICON_SIZE_SMALL).'</a>'.'\'; |
| 83 | + } else { |
| 84 | + return \''.Display::return_icon('add_na.png', get_lang('YourGradebookFirstNeedsACertificateInOrderToBeLinkedToASkill'), '', ICON_SIZE_SMALL).''.'\'; |
| 85 | + } |
| 86 | +}'; |
94 | 87 | ?> |
95 | 88 | <script> |
96 | 89 | $(function() { |
|
120 | 113 | } |
121 | 114 | } |
122 | 115 | $form->display(); |
123 | | - //echo Display::tag('h2',$gradebook_info['name']); |
124 | 116 | break; |
125 | 117 | } |
126 | 118 | Display::display_footer(); |
0 commit comments