3 * tools/packages/import.php
5 * This file is part of ATutor, see http://www.atutor.ca
7 * Copyright (C) 2005 Matthai Kurian
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 define('AT_INCLUDE_PATH', '../../include/');
25 require_once(AT_INCLUDE_PATH.'vitals.inc.php');
27 define ('PACKAGE_TYPES', 'scorm-1.2');
29 if (isset ($_POST['type'])) {
30 require ($_POST['type'] . '/import.php');
33 require(AT_INCLUDE_PATH.'header.inc.php');
37 <div class="input-form">
38 <form name="form1" method="post"
39 action="<?php echo $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data"
40 onsubmit="openWindow('<?php echo AT_BASE_HREF; ?>tools/prog.php');">
42 <?php echo _AT('package_type_info')?>
44 <label for="type"><?php echo _AT('package_type')?></label>
49 $ptypes = explode (',', PACKAGE_TYPES);
50 foreach ($ptypes as $type) {
51 echo '<option value="' . $type . '">' . $type . '</option>';
57 <?php echo _AT('package_upload_file_info')?>
59 <label for="to_file"><?php echo _AT('package_upload_file'); ?></label>
61 <input type="file" name="file" id="to_file" />
64 <?php echo _AT('package_upload_url_info')?>
67 <?php echo _AT('package_upload_url'); ?>
69 <input type="text" name="url" value="http://" size="40" id="to_url" />
72 <div class="row buttons">
73 <input type="submit" name="submit" onClick="setClickSource('submit');" value="<?php echo _AT('import'); ?>" />
74 <input type="submit" name="cancel" onClick="setClickSource('cancel');" value="<?php echo _AT('cancel'); ?>" />
80 <script language="javascript" type="text/javascript">
83 function setClickSource(name) {
87 function openWindow(page) {
88 if (but_src != "cancel") {
89 newWindow = window.open(page, "progWin",
90 "width=400,height=200,toolbar=no,location=no"
97 <?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>