legal_list.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /* For licensing terms, see /dokeos_license.txt */
  3. $language_file = 'admin';
  4. $cidReset = true;
  5. require_once '../inc/global.inc.php';
  6. $this_section = SECTION_PLATFORM_ADMIN;
  7. api_protect_admin_script();
  8. $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
  9. $tool_name = get_lang('TermsAndConditions');
  10. Display :: display_header($tool_name);
  11. $parameters['sec_token'] = Security::get_token();
  12. // action menu
  13. echo '<div class="actions">';
  14. echo '<a href="'.api_get_path(WEB_CODE_PATH).'admin/legal_add.php">'.Display::return_icon('edit.gif',get_lang('EditTermsAndConditions'),'').get_lang('EditTermsAndConditions').'</a>&nbsp;&nbsp;';
  15. echo '</div>';
  16. // Actions
  17. if (isset ($_GET['action'])) {
  18. if ($_GET['action'] == 'show_message')
  19. Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message'])));
  20. Security::clear_token();
  21. }
  22. $legal_count = LegalManager::count();
  23. $languages = api_get_languages();
  24. $available_languages = count($languages['folder']);
  25. if ($legal_count != $available_languages) {
  26. Display::display_warning_message(get_lang('YouShouldCreateTermAndConditionsForAllAvailableLanguages'));
  27. }
  28. //if ($legal_count < )
  29. $table = new SortableTable('conditions', 'count_mask', 'get_legal_data_mask',2);
  30. $table->set_additional_parameters($parameters);
  31. $table->set_header(0, get_lang('Version'), false, 'width="15px"');
  32. $table->set_header(1, get_lang('Language'), false, 'width="30px"');
  33. $table->set_header(2, get_lang('Content'),false);
  34. $table->set_header(3, get_lang('Changes'), false, 'width="60px"');
  35. $table->set_header(4, get_lang('Type'), false, 'width="60px"');
  36. $table->set_header(5, get_lang('Date'), false, 'width="50px"');
  37. $table->display();
  38. // this 2 "mask" function are here just because the SortableTable
  39. function get_legal_data_mask($id, $params=null, $row=null) {
  40. return LegalManager::get_legal_data($id, $params, $row);
  41. }
  42. function count_mask() {
  43. return LegalManager::count();
  44. }
  45. Display :: display_footer();