2 /****************************************************************/
4 /****************************************************************/
5 /* Copyright (c) 2002-2008 by Greg Gay & Joel Kronenberg */
6 /* Adaptive Technology Resource Centre / University of Toronto */
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. */
12 /****************************************************************/
15 define('AT_INCLUDE_PATH', '../../include/');
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
18 require(AT_INCLUDE_PATH.'header.inc.php');
20 if (!isset($_main_menu)) {
21 $_main_menu = $contentManager->getContent();
24 function print_menu_sections(&$menu, $parent_content_id = 0, $depth = 0, $ordering = '') {
25 $my_children = $menu[$parent_content_id];
28 if (!is_array($my_children)) {
31 foreach ($my_children as $children) {
32 /* test content association, we don't want to display the test pages
33 * as part of the menu section. If test, skip it.
35 if (isset($children['test_id'])){
39 echo '<option value="'.$children['content_id'].'"';
40 if ($cid == $children['content_id']) {
41 echo ' selected="selected"';
44 echo str_pad('', $depth, '-') . ' ';
45 if ($parent_content_id == 0) {
46 $new_ordering = $children['ordering'];
47 echo $children['ordering'];
49 $new_ordering = $ordering.'.'.$children['ordering'];
50 echo $ordering . '.'. $children['ordering'];
52 echo ' '.$children['title'].'</option>';
54 print_menu_sections($menu, $children['content_id'], $depth+1, $new_ordering);
58 if (!authenticate(AT_PRIV_CONTENT, AT_PRIV_RETURN) && ($_SESSION['packaging'] == 'none')) {
59 echo '<p>'._AT('content_packaging_disabled').'</p>';
60 require (AT_INCLUDE_PATH.'footer.inc.php');
62 } else if (!authenticate(AT_PRIV_CONTENT, AT_PRIV_RETURN) && ($_SESSION['packaging'] == 'top')) {
63 $_main_menu = array($_main_menu[0]);
66 <form name="exportForm" method="post" action="tools/ims/ims_export.php">
67 <div class="input-form">
68 <fieldset class="group_form"><legend class="group_form"><?php echo _AT('export_content'); ?></legend>
70 <p><?php echo _AT('export_content_info'); ?></p>
73 <?php if ($_main_menu[0]): ?>
75 <label for="select_cid"><?php echo _AT('export_content_package_what'); ?></label><br />
76 <select name="cid" id="select_cid">
77 <option value="0"><?php echo _AT('export_entire_course_or_chap'); ?></option>
78 <option value="0"></option>
80 print_menu_sections($_main_menu);
85 <?php if (authenticate(AT_PRIV_ADMIN, AT_PRIV_RETURN)): ?>
87 <input type="radio" name="export_as" id="to_cp" value="1" checked="checked" onclick="changeFormAction('cp');" />
88 <label for="to_cp"><?php echo _AT('content_package'); ?></label> <br />
89 <input type="radio" name="export_as" id="to_cc" value="1" onclick="changeFormAction('cc');" />
90 <label for="to_cc"><?php echo _AT('common_cartridge'); ?> </label>
93 <!--<input type="checkbox" name="to_tile" id="to_tile" value="1" />
94 <label for="to_tile"><?php echo _AT('tile_export'); ?></label> <br /> -->
95 <input type="checkbox" name="to_a4a" id="to_a4a" value="1" />
96 <label for="to_a4a"><?php echo _AT('a4a_export'); ?></label>
100 <div class="row buttons">
101 <input type="submit" name="submit" value="<?php echo _AT('export'); ?>" />
102 <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" />
107 <strong><?php echo _AT('none_found'); ?></strong>
114 <?php if (!authenticate(AT_PRIV_CONTENT, AT_PRIV_RETURN)) {
115 require (AT_INCLUDE_PATH.'footer.inc.php');
122 <form name="form1" method="post" action="tools/ims/ims_import.php" enctype="multipart/form-data" onsubmit="openWindow('<?php echo AT_BASE_HREF; ?>tools/prog.php');">
123 <div class="input-form">
124 <fieldset class="group_form"><legend class="group_form"><?php echo _AT('import_content'); ?></legend>
127 <p><?php echo _AT('import_content_info'); ?></p>
131 <label for="select_cid2"><?php echo _AT('import_content_package_where'); ?></label><br />
132 <select name="cid" id="select_cid2">
133 <option value="0"><?php echo _AT('import_content_package_bottom_subcontent'); ?></option>
134 <option value="0"></option>
136 print_menu_sections($_main_menu);
142 <input type="checkbox" name="allow_test_import" id="allow_test_import" checked="checked" />
143 <label for="allow_test_import"><?php echo _AT('test_import_package'); ?></label> <br />
144 <input type="checkbox" name="allow_a4a_import" id="allow_a4a_import" checked="checked" />
145 <label for="allow_a4a_import"><?php echo _AT('a4a_import_package'); ?></label>
149 <label for="to_file"><?php echo _AT('upload_content_package'); ?></label><br />
150 <input type="file" name="file" id="to_file" />
154 <label for="to_url"><?php echo _AT('specify_url_to_content_package'); ?></label><br />
155 <input type="text" name="url" value="http://" size="40" id="to_url" />
158 <div class="row buttons">
159 <input type="submit" name="submit" onclick="setClickSource('submit');" value="<?php echo _AT('import'); ?>" />
160 <input type="submit" name="cancel" onclick="document.form1.enctype='';setClickSource('cancel');" value="<?php echo _AT('cancel'); ?>" />
165 <script language="javascript" type="text/javascript">
168 function setClickSource(name) {
172 function openWindow(page) {
173 if (but_src != "cancel") {
174 newWindow = window.open(page, "progWin", "width=400,height=200,toolbar=no,location=no");
180 function changeFormAction(type){
181 var obj = document.exportForm;
183 obj.action = "tools/imscc/ims_export.php";
184 } else if (type=="cp"){
185 obj.action = "tools/ims/ims_export.php";
191 <?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>