usergroup_export.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * @package chamilo.admin
  5. */
  6. /**
  7. * Code
  8. */
  9. // name of the language file that needs to be included
  10. $language_file = 'admin';
  11. $cidReset = true;
  12. ////require_once '../inc/global.inc.php';
  13. $this_section = SECTION_PLATFORM_ADMIN;
  14. api_protect_admin_script();
  15. $tool_name = get_lang('Export');
  16. $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
  17. $interbreadcrumb[] = array ('url' => 'usergroups.php', 'name' => get_lang('Classes'));
  18. set_time_limit(0);
  19. $form = new FormValidator('export_users');
  20. $form->addElement('header', $tool_name);
  21. $form->addElement('style_submit_button', 'submit',get_lang('Export'),'class="save"');
  22. if ($form->validate()) {
  23. $user_group = new UserGroup;
  24. $header = array(array('name', 'description'));
  25. $data = $user_group->get_all_for_export();
  26. $data = array_merge($header, $data);
  27. $filename = 'export_classes_'.api_get_local_time();
  28. Export::export_table_csv($data,$filename);
  29. exit;
  30. }
  31. Display :: display_header($tool_name);
  32. $form->display();
  33. Display :: display_footer();