usergroup_export.php 975 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * @package chamilo.admin
  5. */
  6. $cidReset = true;
  7. require_once '../inc/global.inc.php';
  8. $this_section = SECTION_PLATFORM_ADMIN;
  9. api_protect_admin_script();
  10. $tool_name = get_lang('Export');
  11. $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
  12. $interbreadcrumb[] = array ('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. $userGroup = new UserGroup();
  19. $header = array(array('id', 'name', 'description', 'users'));
  20. $data = $userGroup->getDataToExport();
  21. $data = array_merge($header, $data);
  22. $filename = 'export_classes_'.api_get_local_time();
  23. Export::arrayToCsv($data, $filename);
  24. exit;
  25. }
  26. Display :: display_header($tool_name);
  27. $form->display();
  28. Display::display_footer();