legal_list.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /* For licensing terms, see /dokeos_license.txt */
  3. $language_file = 'admin';
  4. $cidReset = true;
  5. require ('../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. require_once (api_get_path(LIBRARY_PATH).'sortabletable.class.php');
  12. require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
  13. require_once (api_get_path(LIBRARY_PATH).'security.lib.php');
  14. require_once (api_get_path(LIBRARY_PATH).'legal.lib.php');
  15. $parameters['sec_token'] = Security::get_token();
  16. // action menu
  17. echo '<div class="actions" style="height:22px;">';
  18. echo '<div style="float:right;">
  19. <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;
  20. </div><br />';
  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. $table = new SortableTable('conditions', 'count_mask', 'get_legal_data_mask',2);
  29. $table->set_additional_parameters($parameters);
  30. $table->set_header(0, get_lang('Version'), false, 'width="15px"');
  31. $table->set_header(1, get_lang('Language'), false, 'width="30px"');
  32. $table->set_header(2, get_lang('Content'),false);
  33. $table->set_header(3, get_lang('Changes'), false, 'width="60px"');
  34. $table->set_header(4, get_lang('Type'), false, 'width="60px"');
  35. $table->set_header(5, get_lang('Date'), false, 'width="50px"');
  36. $table->display();
  37. // this 2 "mask" function are here just because the SortableTable
  38. function get_legal_data_mask($id, $params=null, $row=null) {
  39. return LegalManager::get_legal_data($id, $params, $row);
  40. }
  41. function count_mask() {
  42. return LegalManager::count();
  43. }
  44. /*
  45. ==============================================================================
  46. FOOTER
  47. ==============================================================================
  48. */
  49. Display :: display_footer();
  50. ?>