2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2010 */
6 /* Inclusive Design Institute */
8 /* This program is free software. You can redistribute it and/or */
9 /* modify it under the terms of the GNU General Public License */
10 /* as published by the Free Software Foundation. */
11 /************************************************************************/
13 define('TR_INCLUDE_PATH', '../../include/');
14 require_once(TR_INCLUDE_PATH.'vitals.inc.php');
16 global $_course_id, $_content_id;
18 Utility::authenticate(TR_PRIV_ISAUTHOR);
20 require(TR_INCLUDE_PATH.'header.inc.php');
21 if (!isset($_main_menu)) {
22 $_main_menu = $contentManager->getContent();
25 function print_menu_sections(&$menu, $only_print_content_folder = false, $parent_content_id = 0, $depth = 0, $ordering = '') {
26 $my_children = $menu[$parent_content_id];
29 if (!is_array($my_children)) {
32 foreach ($my_children as $children) {
33 /* test content association, we don't want to display the test pages
34 * as part of the menu section. If test, skip it.
36 if (isset($children['test_id'])){
39 if ($only_print_content_folder && $children['content_type'] != CONTENT_TYPE_FOLDER) {
43 echo '<option value="'.$children['content_id'].'"';
44 if ($cid == $children['content_id']) {
45 echo ' selected="selected"';
48 echo str_pad('', $depth, '-') . ' ';
49 if ($parent_content_id == 0) {
50 $new_ordering = $children['ordering'];
51 echo $children['ordering'];
53 $new_ordering = $ordering.'.'.$children['ordering'];
54 echo $ordering . '.'. $children['ordering'];
56 echo ' '.$children['title'].'</option>';
58 print_menu_sections($menu, $only_print_content_folder, $children['content_id'], $depth+1, $new_ordering);
63 <form name="exportForm" method="post" action="home/ims/ims_export.php">
64 <div class="input-form">
65 <input type="hidden" name="_course_id" value="<?php echo $_course_id; ?>" />
66 <fieldset class="group_form"><legend class="group_form"><?php echo _AT('export_content'); ?></legend>
68 <p><?php echo _AT('export_content_info'); ?></p>
71 <?php if ($_main_menu[0]): ?>
73 <label for="select_cid"><?php echo _AT('export_content_package_what'); ?></label><br />
74 <select name="cid" id="select_cid">
75 <option value="0"><?php echo _AT('export_entire_course_or_chap'); ?></option>
76 <option value="0"></option>
78 print_menu_sections($_main_menu);
84 <input type="radio" name="export_as" id="to_cp" value="1" checked="checked" onclick="changeFormAction('cp');" />
85 <label for="to_cp"><?php echo _AT('content_package'); ?></label> <br />
86 <input type="radio" name="export_as" id="to_cc" value="1" onclick="changeFormAction('cc');" />
87 <label for="to_cc"><?php echo _AT('common_cartridge'); ?> </label>
90 <input type="checkbox" name="to_a4a" id="to_a4a" value="1" />
91 <label for="to_a4a"><?php echo _AT('a4a_export'); ?></label>
94 <div class="row buttons">
95 <input type="submit" name="submit" value="<?php echo _AT('export'); ?>" />
96 <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" />
101 <strong><?php echo _AT('none_found'); ?></strong>
108 <form name="form1" method="post" action="home/ims/ims_import.php" enctype="multipart/form-data" onsubmit="openWindow('<?php echo TR_BASE_HREF; ?>home/prog.php');">
109 <div class="input-form">
110 <input type="hidden" name="_course_id" value="<?php echo $_course_id; ?>" />
111 <fieldset class="group_form"><legend class="group_form"><?php echo _AT('import_content'); ?></legend>
114 <p><?php echo _AT('import_content_info'); ?></p>
118 <label for="select_cid2"><?php echo _AT('import_content_package_where'); ?></label><br />
119 <select name="cid" id="select_cid2">
120 <option value="0"><?php echo _AT('import_content_package_bottom_subcontent'); ?></option>
121 <option value="0"></option>
123 print_menu_sections($_main_menu, true);
129 <input type="checkbox" name="allow_test_import" id="allow_test_import" checked="checked" />
130 <label for="allow_test_import"><?php echo _AT('test_import_package'); ?></label> <br />
131 <input type="checkbox" name="allow_a4a_import" id="allow_a4a_import" checked="checked" />
132 <label for="allow_a4a_import"><?php echo _AT('a4a_import_package'); ?></label><br />
133 <input type="checkbox" name="ignore_validation" id="ignore_validation" value="1" />
134 <label for="ignore_validation"><?php echo _AT('ignore_validation'); ?></label> <br />
138 <label for="to_file"><?php echo _AT('upload_content_package'); ?></label><br />
139 <input type="file" name="file" id="to_file" />
143 <label for="to_url"><?php echo _AT('specify_url_to_content_package'); ?></label><br />
144 <input type="text" name="url" value="http://" size="40" id="to_url" />
147 <div class="row buttons">
148 <input type="submit" name="submit" onclick="setClickSource('submit');" value="<?php echo _AT('import'); ?>" />
149 <input type="submit" name="cancel" onclick="document.form1.enctype='';setClickSource('cancel');" value="<?php echo _AT('cancel'); ?>" />
154 <script language="javascript" type="text/javascript">
157 function setClickSource(name) {
161 function openWindow(page) {
162 if (but_src != "cancel") {
163 newWindow = window.open(page, "progWin", "width=400,height=200,toolbar=no,location=no");
169 function changeFormAction(type){
170 var obj = document.exportForm;
172 obj.action = "home/imscc/ims_export.php";
173 } else if (type=="cp"){
174 obj.action = "home/ims/ims_export.php";
180 <?php require (TR_INCLUDE_PATH.'footer.inc.php'); ?>