legal_list.php 2.0 KB

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