filler.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Index of the admin tools
  5. *
  6. * @package chamilo.admin
  7. */
  8. // resetting the course id
  9. $cidReset = true;
  10. // including some necessary chamilo files
  11. require_once '../inc/global.inc.php';
  12. // setting the section (for the tabs)
  13. $this_section = SECTION_PLATFORM_ADMIN;
  14. // Access restrictions
  15. api_protect_admin_script(true);
  16. $nameTools = get_lang('PlatformAdmin');
  17. // setting breadcrumbs
  18. $interbreadcrumb[] = array ("url" => 'index.php', "name" => $nameTools);
  19. // setting the name of the tool
  20. $nameTools = get_lang('DataFiller');
  21. $output = array();
  22. if (!empty($_GET['fill'])) {
  23. switch ($_GET['fill']) {
  24. case 'users':
  25. require api_get_path(SYS_TEST_PATH).'datafiller/fill_users.php';
  26. $output = fill_users();
  27. break;
  28. case 'courses':
  29. require api_get_path(SYS_TEST_PATH).'datafiller/fill_courses.php';
  30. $output = fill_courses();
  31. break;
  32. default:
  33. break;
  34. }
  35. }
  36. // Displaying the header
  37. Display::display_header($nameTools);
  38. $result = '';
  39. if (count($output)>0) {
  40. $result = '<div class="filler-report">'."\n";
  41. $result .= '<h3>'.$output[0]['title'].'</h3>'."\n";
  42. $result .= '<table>';
  43. foreach ($output as $line) {
  44. $result .= '<tr>';
  45. $result .= '<td class="filler-report-data-init">'.$line['line-init'].' </td><td class="filler-report-data">'.$line['line-info'].'</td>';
  46. $result .= '</tr>';
  47. }
  48. $result .= '</table>';
  49. $result .= '</div>';
  50. Display::display_normal_message($result,false);
  51. }
  52. ?>
  53. <div id="datafiller" class="actions">
  54. <h4><?php echo Display::return_icon('bug.png',get_lang('DataFiller'),null,ICON_SIZE_MEDIUM).' '.get_lang('DataFiller')?></h4>
  55. <div class="description"><?php echo get_lang('ThisSectionIsOnlyVisibleOnSourceInstalls');?></div>
  56. <ul class="fillers">
  57. <li><a href="filler.php?fill=users"><?php echo Display::return_icon('user.png',get_lang('FillUsers'),null,ICON_SIZE_SMALL).' '.get_lang('FillUsers');?></a></li>
  58. <li><a href="filler.php?fill=courses"><?php echo Display::return_icon('new-course.png',get_lang('FillCourses'),null,ICON_SIZE_SMALL).' '.get_lang('FillCourses');?></a></li>
  59. </ul>
  60. </div>
  61. <?php
  62. /* FOOTER */
  63. Display::display_footer();