legal_list.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. use Chamilo\CoreBundle\Framework\Container;
  4. /**
  5. * Sessions list script
  6. * @package chamilo.admin
  7. */
  8. $cidReset = true;
  9. $this_section = SECTION_PLATFORM_ADMIN;
  10. api_protect_admin_script();
  11. $interbreadcrumb[] = array ('url' => Container::getRouter()->generate('administration') , "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">'.Display::return_icon('edit.gif',get_lang('EditTermsAndConditions'),'').get_lang('EditTermsAndConditions').'</a>&nbsp;&nbsp;';
  18. echo '</div>';
  19. // Actions
  20. $legal_count = LegalManager::count();
  21. $languages = api_get_languages();
  22. $available_languages = count($languages);
  23. if ($legal_count != $available_languages) {
  24. Display::display_warning_message(get_lang('YouShouldCreateTermAndConditionsForAllAvailableLanguages'));
  25. }
  26. //if ($legal_count < )
  27. $table = new SortableTable('conditions', 'count_mask', 'get_legal_data_mask',2);
  28. $table->set_additional_parameters($parameters);
  29. $table->set_header(0, get_lang('Version'), false, 'width="15px"');
  30. $table->set_header(1, get_lang('Language'), false, 'width="30px"');
  31. $table->set_header(2, get_lang('Content'),false);
  32. $table->set_header(3, get_lang('Changes'), false, 'width="60px"');
  33. $table->set_header(4, get_lang('Type'), false, 'width="60px"');
  34. $table->set_header(5, get_lang('Date'), false, 'width="50px"');
  35. $table->display();
  36. // this 2 "mask" function are here just because the SortableTable
  37. function get_legal_data_mask($id, $params = null, $row = null)
  38. {
  39. return LegalManager::get_legal_data($id, $params, $row);
  40. }
  41. function count_mask()
  42. {
  43. return LegalManager::count();
  44. }
  45. Display :: display_footer();