fix bugs from merging atutor changes.
authorCindy Li <cli@ocad.ca>
Fri, 8 Oct 2010 20:06:16 +0000 (20:06 -0000)
committerCindy Li <cli@ocad.ca>
Fri, 8 Oct 2010 20:06:16 +0000 (20:06 -0000)
docs/home/classes/ContentUtility.class.php
docs/home/course/content.php
docs/home/editor/edit_content.php
docs/home/editor/editor_tab_functions.inc.php
docs/home/editor/import_export_content.php

index f90f236..72bff9c 100644 (file)
@@ -212,7 +212,7 @@ class ContentUtility {
                                        clip: { autoPlay: false },              \r
                                plugins:  { \r
                                        controls: { \r
-                                           all: false,  \r
+                                           buttons:true, \r
                                            play: true,  \r
                                            scrubber: true \r
                                        }         \r
@@ -233,7 +233,7 @@ class ContentUtility {
      *          For instance: http://www.youtube.com/watch?v=a0ryB0m0MiM\r
      *          Otherwise, return the original send-in parameter.\r
      */\r
-    function convertYoutubePlayURLToWatchURL($youtube_playURL) {\r
+    public function convertYoutubePlayURLToWatchURL($youtube_playURL) {\r
         return preg_replace("/(http:\/\/[a-z0-9\.]*)?youtube.com\/v\/(.*)/",\r
                             "\\1youtube.com/watch?v=\\2", $youtube_playURL);\r
     }\r
@@ -247,7 +247,7 @@ class ContentUtility {
      *          For instance, http://www.youtube.com/v/a0ryB0m0MiM\r
      *          Otherwise, return the original send-in parameter.\r
      */\r
-    function convertYoutubeWatchURLToPlayURL($youtube_watchURL) {\r
+    public function convertYoutubeWatchURLToPlayURL($youtube_watchURL) {\r
         return preg_replace("/(http:\/\/[a-z0-9\.]*)?youtube.com\/watch\?v=(.*)/",\r
                             "\\1youtube.com/v/\\2", $youtube_watchURL);\r
     }\r
@@ -805,7 +805,7 @@ class ContentUtility {
                        $sql .= " AND srt.type_id=".$only_on_secondary_type;\r
                }\r
                $sql .= " ORDER BY pr.primary_resource_id, prt.type_id";\r
-               \r
+                       \r
                $rows = $dao->execute($sql);\r
        \r
                if (!is_array($rows)) {\r
index fb09578..b38de92 100644 (file)
@@ -187,68 +187,7 @@ if (isset($_SESSION['user_id'])) ContentUtility::saveLastCid($cid);
 if (isset($top_num) && $top_num != (int) $top_num) {
        $top_num = substr($top_num, 0, strpos($top_num, '.'));
 }
-/*
-$shortcuts = array();
-if (((!$content_row['content_parent_id'] && ($_SESSION['packaging'] == 'top'))
-      || ($_SESSION['packaging'] == 'all'))
-         || (isset($_current_user) && $_current_user->isAuthor($_course_id))) {
 
-       $shortcuts[] = array('title' => _AT('export_content'), 'url' => $_base_href . 'tools/ims/ims_export.php?cid='.$cid);
-}
-
-if (isset($_current_user) && $_current_user->isAuthor($_course_id)) {
-       $shortcuts[] = array('title' => _AT('edit_this_page'),   'url' => $_base_href . 'home/editor/edit_content.php?_cid='.$cid);
-//     $shortcuts[] = array('title' => _AT('add_top_folder'),   'url' => $_base_href . 'home/editor/edit_content_folder.php?_course_id='.$_course_id);
-
-       if ($contentManager->_menu_info[$cid]['content_parent_id']) {
-               $shortcuts[] = array('title' => _AT('add_sibling_folder'), 'url' => $_base_href .
-                       'home/editor/edit_content_folder.php?pid='.$contentManager->_menu_info[$cid]['content_parent_id'].SEP.'_course_id='.$_course_id);
-       }
-//     $shortcuts[] = array('title' => _AT('add_top_page'),     'url' => $_base_href . 'home/editor/edit_content.php?_course_id='.$_course_id);
-       if ($contentManager->_menu_info[$cid]['content_parent_id']) {
-               $shortcuts[] = array('title' => _AT('add_sibling_page'), 'url' => $_base_href .
-                       'home/editor/edit_content.php?pid='.$contentManager->_menu_info[$cid]['content_parent_id'].SEP.'_course_id='.$_course_id);
-       }
-       $shortcuts[] = array('title' => _AT('delete_this_page'), 'url' => $_base_href . 'home/editor/delete_content.php?_cid='.$cid);
-}
-$savant->assign('shortcuts', $shortcuts);
-*/
-
-/*if (((!$content_row['content_parent_id'] && ($_SESSION['packaging'] == 'top'))
-      || ($_SESSION['packaging'] == 'all'))
-         || (isset($_current_user) && $_current_user->isAuthor($_course_id))) {
-
-       $_tool_shortcuts[] = array(
-                 'title' => _AT('export_content'), 
-                 'url' => $_base_href . 'home/imscc/ims_export.php?_cid='.$cid,
-                 'icon' => $_base_href . 'images/download.png');
-}
-
-if (isset($_current_user) && $_current_user->isAuthor($_course_id)) {
-       $_tool_shortcuts[] = array(
-                 'title' => _AT('edit_this_page'),   
-                  'url' => $_base_href . 'home/editor/edit_content.php?_cid='.$cid,
-                 'icon' => $_base_href . 'images/medit.gif');
-
-       if ($contentManager->_menu_info[$cid]['content_parent_id']) {
-                 $_tool_shortcuts[] = array(
-                 'title' => _AT('add_sibling_folder'), 
-                 'url' => $_base_href .
-                       'home/editor/edit_content_folder.php?pid='.$contentManager->_menu_info[$cid]['content_parent_id'].SEP.'_course_id='.$_course_id,
-                  'icon' => $_base_href . 'images/folder_new_sibling.gif');
-       }
-       if ($contentManager->_menu_info[$cid]['content_parent_id']) {
-               $_tool_shortcuts[] = array(
-                 'title' => _AT('add_sibling_page'), 
-                 'url' => $_base_href .
-                       'home/editor/edit_content.php?pid='.$contentManager->_menu_info[$cid]['content_parent_id'].SEP.'_course_id='.$_course_id,
-                 'icon' => $_base_href . 'images/page_add_sibling.gif');
-       }
-       $_tool_shortcuts[] = array(
-                 'title' => _AT('delete_this_page'),   
-                 'url' => $_base_href . 'home/editor/delete_content.php?_cid='.$cid,
-                 'icon' => $_base_href . 'images/page_delete.gif');
-}*/
 $_tool_shortcuts = ContentUtility::getToolShortcuts($content_row);
 
 //if it has test and forum associated with it, still display it even if the content is empty
index e2bccc3..d09f20f 100644 (file)
@@ -72,6 +72,7 @@ if (isset($_POST['submit_file'])) {
        paste_from_file(body_text);
 } else if (isset($_POST['submit']) && ($_POST['submit'] != 'submit1')) {
        /* we're saving. redirects if successful. */
+       debug('here');exit;
        save_changes(true, $current_tab);
 }
 
@@ -84,6 +85,7 @@ if (isset($_POST['submit_file_alt'])) {
 
 if (isset($_POST['submit'])) {
        /* we're saving. redirects if successful. */
+       debug('here');
        save_changes(true, $current_tab);
 }
 
@@ -136,7 +138,7 @@ if ($cid) {
                $content_base_href = 'content/' . $_SESSION['course_id'] . '/';
        }
 }
-
+debug($content_base_href);exit;
 if (($current_tab == 0) || ($current_tab == 2)) {
     if ($_POST['formatting'] == null){ 
         // this is a fresh load from just logged in
index ca08335..f32351c 100644 (file)
@@ -97,7 +97,7 @@ function populate_a4a($cid, $content, $formatting){
        include_once(TR_INCLUDE_PATH.'classes/XML/XML_HTMLSax/XML_HTMLSax.php');        /* for XML_HTMLSax */
        include_once(TR_INCLUDE_PATH.'classes/ContentOutputParser.class.php');  /* for parser */
        
-       $body = ContentUtility::formatContent($content, $formatting,array());
+       $body = ContentUtility::formatContent($content, $formatting);
     
        $handler = new ContentOutputParser();
        $parser = new XML_HTMLSax();
@@ -144,7 +144,7 @@ function populate_a4a($cid, $content, $formatting){
        // insert the new resources
     foreach($resources as $primary_resource)
        {
-               if (!$a4a->getPrimaryResourceByName($primary_resource)){
+               if (!is_array($a4a->getPrimaryResourceByName($primary_resource))){
                        $a4a->setPrimaryResource($cid, $primary_resource, $_SESSION['lang']);
                }
        }
index 464a71b..1c70b6f 100644 (file)
@@ -59,13 +59,6 @@ function print_menu_sections(&$menu, $only_print_content_folder = false, $parent
        }
 }
 
-//if (!authenticate(AT_PRIV_CONTENT, AT_PRIV_RETURN) && ($_SESSION['packaging'] == 'none')) {
-//     echo '<p>'._AT('content_packaging_disabled').'</p>';
-//     require (AT_INCLUDE_PATH.'footer.inc.php'); 
-//     exit;
-//} else if (!authenticate(AT_PRIV_CONTENT, AT_PRIV_RETURN) && ($_SESSION['packaging'] == 'top')) {
-//     $_main_menu = array($_main_menu[0]);
-//}
 ?>
 <form name="exportForm" method="post" action="home/ims/ims_export.php">
 <div class="input-form">