legal_list.php 2.0 KB

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