From: Cindy Li Date: Fri, 8 Oct 2010 20:06:16 +0000 (-0000) Subject: fix bugs from merging atutor changes. X-Git-Tag: v1.1~15 X-Git-Url: https://iam.tj/gitweb/gitweb.cgi?p=acontent.git;a=commitdiff_plain;h=d06f8a42a0533bf9eb88680f0e5f830ad5cd3df2 fix bugs from merging atutor changes. --- diff --git a/docs/home/classes/ContentUtility.class.php b/docs/home/classes/ContentUtility.class.php index f90f236..72bff9c 100644 --- a/docs/home/classes/ContentUtility.class.php +++ b/docs/home/classes/ContentUtility.class.php @@ -212,7 +212,7 @@ class ContentUtility { clip: { autoPlay: false }, plugins: { controls: { - all: false, + buttons:true, play: true, scrubber: true } @@ -233,7 +233,7 @@ class ContentUtility { * For instance: http://www.youtube.com/watch?v=a0ryB0m0MiM * Otherwise, return the original send-in parameter. */ - function convertYoutubePlayURLToWatchURL($youtube_playURL) { + public function convertYoutubePlayURLToWatchURL($youtube_playURL) { return preg_replace("/(http:\/\/[a-z0-9\.]*)?youtube.com\/v\/(.*)/", "\\1youtube.com/watch?v=\\2", $youtube_playURL); } @@ -247,7 +247,7 @@ class ContentUtility { * For instance, http://www.youtube.com/v/a0ryB0m0MiM * Otherwise, return the original send-in parameter. */ - function convertYoutubeWatchURLToPlayURL($youtube_watchURL) { + public function convertYoutubeWatchURLToPlayURL($youtube_watchURL) { return preg_replace("/(http:\/\/[a-z0-9\.]*)?youtube.com\/watch\?v=(.*)/", "\\1youtube.com/v/\\2", $youtube_watchURL); } @@ -805,7 +805,7 @@ class ContentUtility { $sql .= " AND srt.type_id=".$only_on_secondary_type; } $sql .= " ORDER BY pr.primary_resource_id, prt.type_id"; - + $rows = $dao->execute($sql); if (!is_array($rows)) { diff --git a/docs/home/course/content.php b/docs/home/course/content.php index fb09578..b38de92 100644 --- a/docs/home/course/content.php +++ b/docs/home/course/content.php @@ -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 diff --git a/docs/home/editor/edit_content.php b/docs/home/editor/edit_content.php index e2bccc3..d09f20f 100644 --- a/docs/home/editor/edit_content.php +++ b/docs/home/editor/edit_content.php @@ -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 diff --git a/docs/home/editor/editor_tab_functions.inc.php b/docs/home/editor/editor_tab_functions.inc.php index ca08335..f32351c 100644 --- a/docs/home/editor/editor_tab_functions.inc.php +++ b/docs/home/editor/editor_tab_functions.inc.php @@ -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']); } } diff --git a/docs/home/editor/import_export_content.php b/docs/home/editor/import_export_content.php index 464a71b..1c70b6f 100644 --- a/docs/home/editor/import_export_content.php +++ b/docs/home/editor/import_export_content.php @@ -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 '

'._AT('content_packaging_disabled').'

'; -// 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]); -//} ?>