dokeos-admin
[ class tree: dokeos-admin ] [ index: dokeos-admin ] [ all elements ]

Source for file class_add.php

Documentation is available at class_add.php

  1. <?php
  2. // $Id: class_add.php 10215 2006-11-27 13:57:17Z pcool $
  3. /*
  4. ==============================================================================
  5.     Dokeos - elearning and course management software
  6.  
  7.     Copyright (c) 2004 Dokeos S.A.
  8.     Copyright (c) 2003 Ghent University (UGent)
  9.     Copyright (c) 2001 Universite catholique de Louvain (UCL)
  10.     Copyright (c) Olivier Brouckaert
  11.     Copyright (c) Bart Mollet, Hogeschool Gent
  12.  
  13.     For a full list of contributors, see "credits.txt".
  14.     The full license can be read in "license.txt".
  15.  
  16.     This program is free software; you can redistribute it and/or
  17.     modify it under the terms of the GNU General Public License
  18.     as published by the Free Software Foundation; either version 2
  19.     of the License, or (at your option) any later version.
  20.  
  21.     See the GNU General Public License for more details.
  22.  
  23.     Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
  24. ==============================================================================
  25. */
  26. /**
  27. ==============================================================================
  28. *    @package dokeos.admin
  29. ==============================================================================
  30. */
  31.  
  32. // name of the language file that needs to be included 
  33. $language_file 'admin';
  34.  
  35. // resetting the course id
  36. $cidReset true;
  37.  
  38. // including some necessary dokeos files
  39. require_once('../inc/global.inc.php');
  40. require_once (api_get_path(LIBRARY_PATH).'classmanager.lib.php');
  41. require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
  42.  
  43. // setting the section (for the tabs)
  44. $this_section SECTION_PLATFORM_ADMIN;
  45.  
  46. // Access restrictions
  47.  
  48. // setting breadcrumbs
  49. $interbreadcrumb[array('url' => 'index.php''name' => get_lang('PlatformAdmin'));
  50.  
  51. // setting the name of the tool
  52. $tool_name get_lang("AddClasses");
  53.  
  54. $form new FormValidator('add_class');
  55. $form->add_textfield('name',get_lang('ClassName'));
  56. $form->addElement('submit','submit',get_lang('Ok'));
  57. if($form->validate())
  58. {
  59.     $values $form->exportValues();
  60.     ClassManager :: create_class($values['name']);
  61.     header('Location: class_list.php');
  62. }
  63.  
  64. // Displaying the header
  65. Display :: display_header($tool_name);
  66.  
  67. // Displaying the form
  68. $form->display();
  69. /*
  70. ==============================================================================
  71.         FOOTER 
  72. ==============================================================================
  73. */
  74. ?>

Documentation generated on Thu, 12 Jun 2008 13:07:29 -0500 by phpDocumentor 1.4.1