legal_list.php 1.8 KB

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