usergroup_export.php 874 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * @package chamilo.admin
  5. */
  6. $cidReset = true;
  7. require_once __DIR__.'/../inc/global.inc.php';
  8. $this_section = SECTION_PLATFORM_ADMIN;
  9. $userGroup = new UserGroup();
  10. $userGroup->protectScript();
  11. $tool_name = get_lang('Export');
  12. $interbreadcrumb[] = ['url' => 'usergroups.php', 'name' => get_lang('Classes')];
  13. set_time_limit(0);
  14. $form = new FormValidator('export_users');
  15. $form->addElement('header', $tool_name);
  16. $form->addButtonExport(get_lang('Export'));
  17. if ($form->validate()) {
  18. $header = [['id', 'name', 'description', 'users']];
  19. $data = $userGroup->getDataToExport();
  20. $data = array_merge($header, $data);
  21. $filename = 'export_classes_'.api_get_local_time();
  22. Export::arrayToCsv($data, $filename);
  23. exit;
  24. }
  25. Display::display_header($tool_name);
  26. $form->display();
  27. Display::display_footer();