(no commit message)
authorcindy li <cli@ocad.ca>
Thu, 10 Jun 2010 20:27:31 +0000 (20:27 -0000)
committercindy li <cli@ocad.ca>
Thu, 10 Jun 2010 20:27:31 +0000 (20:27 -0000)
docs/mods/_core/editor/editor_tab_functions.inc.php
docs/mods/_core/editor/editor_tabs/alternatives.inc.php
docs/mods/_core/imscp/ims_import.php
docs/mods/_standard/tile_search/import.php
docs/mods/_standard/tile_search/module.php
docs/themes/default/images/Thumbs.db
docs/themes/default/tile_search/index.tmpl.php

index acc5b89..c5558e0 100644 (file)
@@ -163,8 +163,9 @@ function save_changes($redir, $current_tab) {
                        $_POST['cid']    = $cid;
                        $_REQUEST['cid'] = $cid;
                }
-       }
-
+       } 
+       else return;
+       
        /* insert glossary terms */
        if (is_array($_POST['glossary_defs']) && ($num_terms = count($_POST['glossary_defs']))) {
                global $glossary, $glossary_ids, $msg;
index 17d4c87..8441eba 100644 (file)
 
 if (!defined('AT_INCLUDE_PATH')) { exit; }
 
+if ($cid == 0) {
+       $msg->printErrors('SAVE_BEFORE_PROCEED');
+       require_once(AT_INCLUDE_PATH.'footer.inc.php');
+       exit;
+}
+
 /**
  * This function returns the preview link of the given file
  * @param  $file     the file location in "file manager"
index 8b47970..9cf0253 100644 (file)
@@ -47,7 +47,6 @@ $skip_ims_validation = false;
 $added_dt = array();   //the mapping of discussion tools that are added
 $avail_dt = array();   //list of discussion tools that have not been handled
 
-
 /*
  * return the error messages represented by the given array 
  * @author     Mike A.
@@ -663,7 +662,6 @@ $cid = intval($_POST['cid']);
 
 if (isset($_POST['url']) && ($_POST['url'] != 'http://') ) {
        if ($content = @file_get_contents($_POST['url'])) {
-
                // save file to /content/
                $filename = substr(time(), -6). '.zip';
                $full_filename = AT_CONTENT_DIR . $filename;
@@ -1359,7 +1357,7 @@ foreach($items as $idetails){
 }
 clr_dir(AT_CONTENT_DIR . 'import/'.$_SESSION['course_id']);
 
-if (isset($_POST['url'])) {
+if (file_exists($full_filename)) {
        @unlink($full_filename);
 }
 
index c2f876b..f79421d 100644 (file)
@@ -48,12 +48,11 @@ function print_menu_sections(&$menu, $parent_content_id = 0, $depth = 0, $orderi
                print_menu_sections($menu, $children['content_id'], $depth+1, $new_ordering);
        }
 }
-
-
 ?>
 
 <form name="form1" method="post" action="mods/_core/imscp/ims_import.php?tile=1" onsubmit="openWindow('<?php echo AT_BASE_HREF; ?>tools/prog.php?tile=1');">
-       <input type="hidden" name="url" value="<?php echo AT_TILE_EXPORT_URL.$_GET['tile_course_id']; ?>" />
+       <input type="hidden" name="url" value="<?php echo AT_TILE_EXPORT_CC_URL.$_GET['tile_course_id']; ?>" />
+       <input type="hidden" name="allow_a4a_import" value="1" />
 <br />
 <div class="input-form">
 
@@ -62,13 +61,12 @@ function print_menu_sections(&$menu, $parent_content_id = 0, $depth = 0, $orderi
        </div>
 
        <div class="row">
-       <strong><?php echo _AT('import_content_package_where'); ?>:</strong> <select name="cid">
-                                                       <option value="0"><?php echo _AT('import_content_package_bottom_subcontent'); ?></option>
-                                                       <option>--------------------------</option>
-                                                       <?php
-                                                               print_menu_sections($_main_menu);
-                                                       ?>
-                                                       </select>
+       <strong><?php echo _AT('import_content_package_where'); ?>:</strong> 
+       <select name="cid">
+               <option value="0"><?php echo _AT('import_content_package_bottom_subcontent'); ?></option>
+               <option>--------------------------</option>
+               <?php print_menu_sections($_main_menu); ?>
+       </select>
        </div>
 
        <div class="row">
index dc937a3..eeed40f 100644 (file)
@@ -48,8 +48,11 @@ define('AT_TILE_SEARCH_URL', $_config['transformable_uri'].'search.php');
 // The URL to view the transformable course\r
 define('AT_TILE_VIEW_COURSE_URL', $_config['transformable_uri'].'home/course/index.php?_course_id=');\r
 \r
+// The URL to export content package from transformable\r
+define('AT_TILE_EXPORT_CP_URL', $_config['transformable_uri'].'home/ims/ims_export.php?course_id=');\r
+\r
 // The URL to export common cartridge from transformable\r
-define('AT_TILE_EXPORT_URL', $_config['transformable_uri'].'home/imscc/ims_export.php?course_id=');\r
+define('AT_TILE_EXPORT_CC_URL', $_config['transformable_uri'].'home/imscc/ims_export.php?to_a4a=1&course_id=');\r
 \r
 // The URL to import common cartridge into transformable\r
 define('AT_TILE_IMPORT_URL', $_config['transformable_uri'].'home/ims/ims_import.php');\r
index 07bc01e..85557bc 100644 (file)
Binary files a/docs/themes/default/images/Thumbs.db and b/docs/themes/default/images/Thumbs.db differ
index 833fc0f..cc0dfa0 100644 (file)
@@ -80,8 +80,8 @@ if (isset($this->result_list))
        <dl class="browse-result">\r
 <?php if (isset($this->instructor_role)) { ?>\r
                <dt class="tr_results_tools">\r
-          <a href="<?php echo AT_TILE_EXPORT_URL.$result['courseID']; ?>">\r
-            <img src="<?php echo AT_BASE_HREF. 'images/download.png'?>" alt="<?php echo _AT('download_common_cartridge'); ?>" title="<?php echo _AT("download_common_cartridge").' '.$result['title']; ?>; ?>" border="0">\r
+          <a href="<?php echo AT_TILE_EXPORT_CP_URL.$result['courseID']; ?>">\r
+            <img src="<?php echo AT_BASE_HREF. 'images/download.png'?>" alt="<?php echo _AT('download_content_package'); ?>" title="<?php echo _AT("download_content_package").' '.$result['title']; ?>" border="0">\r
           </a>&nbsp;\r
           <a href="mods/_standard/tile_search/import.php?tile_course_id=<?php echo $result['courseID']; ?>&title=<?php echo urlencode($result['title']); ?>">\r
             <img src="<?php echo AT_BASE_HREF. 'images/archive.gif'?>" alt="<?php echo _AT('import'); ?>" title="<?php echo _AT("import").' '.$result['title']; ?>" border="0">\r