2 /****************************************************************/
4 /****************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
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');
17 authenticate(AT_PRIV_CONTENT);
18 require(AT_INCLUDE_PATH.'header.inc.php');
20 if (!isset($_main_menu)) {
21 $_main_menu = $contentManager->getContent();
24 // The length of the content/folder title to display.
25 // This is to fix the issue that, when any one of the content title is too long,
26 // the dropdown box for the export selection stretches out of the "export" fieldset border.
27 $len_of_title_to_display = 65;
29 function print_menu_sections(&$menu, $only_print_content_folder = false, $parent_content_id = 0, $depth = 0, $ordering = '') {
30 global $len_of_title_to_display;
32 $my_children = $menu[$parent_content_id];
35 if (!is_array($my_children)) {
38 foreach ($my_children as $children) {
39 /* test content association, we don't want to display the test pages
40 * as part of the menu section. If test, skip it.
42 if (isset($children['test_id'])){
45 if ($only_print_content_folder && $children['content_type'] != CONTENT_TYPE_FOLDER) {
49 echo '<option value="'.$children['content_id'].'"';
50 if ($cid == $children['content_id']) {
51 echo ' selected="selected"';
54 echo str_pad('', $depth, '-') . ' ';
55 if ($parent_content_id == 0) {
56 $new_ordering = $children['ordering'];
57 echo $children['ordering'];
59 $new_ordering = $ordering.'.'.$children['ordering'];
60 echo $ordering . '.'. $children['ordering'];
62 if (strlen($children['title']) > $len_of_title_to_display) {
63 $title = substr($children['title'], 0, $len_of_title_to_display).' ...';
65 $title = $children['title'];
68 echo ' '.$title.'</option>';
70 print_menu_sections($menu, $only_print_content_folder, $children['content_id'], $depth+1, $new_ordering);
74 if (!authenticate(AT_PRIV_CONTENT, AT_PRIV_RETURN) && ($_SESSION['packaging'] == 'none')) {
75 echo '<p>'._AT('content_packaging_disabled').'</p>';
76 require (AT_INCLUDE_PATH.'footer.inc.php');
78 } else if (!authenticate(AT_PRIV_CONTENT, AT_PRIV_RETURN) && ($_SESSION['packaging'] == 'top')) {
79 $_main_menu = array($_main_menu[0]);
82 <form name="exportForm" method="post" action="mods/_core/imscp/ims_export.php">
83 <div class="input-form">
84 <fieldset class="group_form"><legend class="group_form"><?php echo _AT('export_content'); ?></legend>
86 <p><?php echo _AT('export_content_info'); ?></p>
89 <?php if ($_main_menu[0]): ?>
91 <label for="select_cid"><?php echo _AT('export_content_package_what'); ?></label><br />
92 <select name="cid" id="select_cid">
93 <option value="0"><?php echo _AT('export_entire_course_or_chap'); ?></option>
94 <option value="0"></option>
96 print_menu_sections($_main_menu);
101 <?php if (authenticate(AT_PRIV_ADMIN, AT_PRIV_RETURN)): ?>
103 <input type="radio" name="export_as" id="to_cp" value="1" checked="checked" onclick="changeFormAction('cp');" />
104 <label for="to_cp"><?php echo _AT('content_package'); ?></label> <br />
105 <input type="radio" name="export_as" id="to_cc" value="1" onclick="changeFormAction('cc');" />
106 <label for="to_cc"><?php echo _AT('common_cartridge'); ?> </label>
109 <input type="checkbox" name="to_tile" id="to_tile" value="1" />
110 <label for="to_tile"><?php echo _AT('tile_export'); ?></label> <br />
111 <input type="checkbox" name="to_a4a" id="to_a4a" value="1" />
112 <label for="to_a4a"><?php echo _AT('a4a_export'); ?></label>
116 <div class="row buttons">
117 <input type="submit" name="submit" value="<?php echo _AT('export'); ?>" />
118 <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" />
123 <strong><?php echo _AT('none_found'); ?></strong>
130 <?php if (!authenticate(AT_PRIV_CONTENT, AT_PRIV_RETURN)) {
131 require (AT_INCLUDE_PATH.'footer.inc.php');
138 <form name="form1" method="post" action="mods/_core/imscp/ims_import.php" enctype="multipart/form-data" onsubmit="openWindow('<?php echo AT_BASE_HREF; ?>tools/prog.php');">
139 <div class="input-form">
140 <fieldset class="group_form"><legend class="group_form"><?php echo _AT('import_content'); ?></legend>
143 <p><?php echo _AT('import_content_info'); ?></p>
147 <label for="select_cid2"><?php echo _AT('import_content_package_where'); ?></label><br />
148 <select name="cid" id="select_cid2">
149 <option value="0"><?php echo _AT('import_content_package_bottom_subcontent'); ?></option>
150 <option value="0"></option>
152 print_menu_sections($_main_menu, true);
158 <input type="checkbox" name="allow_test_import" id="allow_test_import" checked="checked" />
159 <label for="allow_test_import"><?php echo _AT('test_import_package'); ?></label> <br />
160 <input type="checkbox" name="allow_a4a_import" id="allow_a4a_import" checked="checked" />
161 <label for="allow_a4a_import"><?php echo _AT('a4a_import_package'); ?></label> <br />
162 <input type="checkbox" name="ignore_validation" id="ignore_validation" value="1" />
163 <label for="ignore_validation"><?php echo _AT('ignore_validation'); ?></label> <br />
167 <label for="to_file"><?php echo _AT('upload_content_package'); ?></label><br />
168 <input type="file" name="file" id="to_file" />
172 <label for="to_url"><?php echo _AT('specify_url_to_content_package'); ?></label><br />
173 <input type="text" name="url" value="http://" size="40" id="to_url" />
176 <div class="row buttons">
177 <input type="submit" name="submit" onclick="setClickSource('submit');" value="<?php echo _AT('import'); ?>" />
178 <input type="submit" name="cancel" onclick="document.form1.enctype='';setClickSource('cancel');" value="<?php echo _AT('cancel'); ?>" />
183 <script language="javascript" type="text/javascript">
186 function setClickSource(name) {
190 function openWindow(page) {
191 if (but_src != "cancel") {
192 newWindow = window.open(page, "progWin", "width=400,height=200,toolbar=no,location=no");
198 function changeFormAction(type){
199 var obj = document.exportForm;
201 obj.action = "mods/_core/imscc/ims_export.php";
202 } else if (type=="cp"){
203 obj.action = "mods/_core/imscp/ims_export.php";
209 <?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>