From 600212a9a1ad3ef22cac8d20a1b1f54ce5c9d02b Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 24 Aug 2006 03:17:53 +0000 Subject: [PATCH] FIxing Ed's mistaken checkin --- course/format/topics/ajaxcourse-topics.js | 207 ---------------------- course/format/topics/commands.php | 142 --------------- course/format/topics/format.php | 15 -- 3 files changed, 364 deletions(-) delete mode 100644 course/format/topics/ajaxcourse-topics.js delete mode 100644 course/format/topics/commands.php diff --git a/course/format/topics/ajaxcourse-topics.js b/course/format/topics/ajaxcourse-topics.js deleted file mode 100644 index 9fe8f8c139..0000000000 --- a/course/format/topics/ajaxcourse-topics.js +++ /dev/null @@ -1,207 +0,0 @@ -//set DDM to intersect mode -//YAHOO.util.DDM.mode = YAHOO.util.DDM.INTERSECT; - -//hide content body until done loading(manipulation looks ugly elsewise) -document.getElementById('content').style.display='none'; - -//onload object for handling scripts on page load, this insurses they run in my order -function onload_class(){ - this.scripts = new Array(); - this.debug = false; -} - -onload_class.prototype.add = function(script){ - if(this.debug)YAHOO.log("onload.add - adding "+script,"junk"); - this.scripts[this.scripts.length] = script; - } - -onload_class.prototype.load = function(){ - var scriptcount = this.scripts.length; - if(this.debug)YAHOO.log("onload.load - loading "+scriptcount+" scripts","info"); - for(i=0;i= main.connectQueue.length) - return; - - var callback = { - success: function(){ - main.connectQueue_fireNext(); - } - } - - main.connectQueueConnection = main.connect(main.connectQueue[head]['method'],main.connectQueue[head]['urlStub'],callback,main.connectQueue[head]['body']) - - main.connectQueueHead++; - } - -main_class.prototype.update_marker = function(newMarker){ - if(this.marker != null) - this.marker.toggle_highlight(); - - this.marker = newMarker; - this.marker.toggle_highlight(); - - this.connect('post','class=course&field=marker',null,'value='+this.marker.sectionId); - } - - - - -var main = new main_class(); - - - - -//portal to php data -function php_portal_class(){ - this.id = null; - - //array of id's of blocks set at end of page load by php - this.blocks = new Array(); - this.imagePath = null; - - //flag for week fomat - this.isWeek = false; - - YAHOO.log("instantiated php_portal_class","info"); -} - - - - diff --git a/course/format/topics/commands.php b/course/format/topics/commands.php deleted file mode 100644 index ca0cb87119..0000000000 --- a/course/format/topics/commands.php +++ /dev/null @@ -1,142 +0,0 @@ -libdir.'/blocklib.php'); - - require_once($CFG->dirroot.'/mod/forum/lib.php'); - require_once($CFG->dirroot.'/lib/ajaxlib/ajaxlib.php'); - - //verify user is authorized - if(!isteacher($course->id)){ - echo("Not authorized to edit page!"); - die; - } - - if(!$_GET[courseId]){ - echo("No ID presented!"); - die; - } - - - switch($_SERVER['REQUEST_METHOD']){ - - - case POST: - switch($_GET['class']){ - case block: switch($_GET[field]){ - - case visible: - $dataobject->id = $_POST[instanceId]; - $dataobject->visible = $_POST[value]; - update_record('block_instance',$dataobject); - break; - - case position: - $dataobject->id = $_POST[instanceId]; - $dataobject->position = $_POST[value]; - $dataobject->weight = $_POST[weight]; - update_record('block_instance',$dataobject); - //echo("Got ".$_GET['class'].",".$_GET[field]."Posted id=".$dataobject->id." position=".$dataobject->position." weight=".$dataobject->weight); - break; - } - break; - - - case section: switch($_GET[field]){ - - case visible: - $dataobject->id = get_field('course_sections','id','course',$_GET[courseId],'section',(int)$_POST[id]); - $dataobject->visible = $_POST[value]; - update_record('course_sections',$dataobject); - break; - - - case sequence: - $dataobject->id = get_field('course_sections','id','course',$_GET[courseId],'section',(int)$_POST[id]); - $dataobject->sequence = $_POST[value]; - update_record('course_sections',$dataobject); - break; - - case all: - $dataobject->id = get_field('course_sections','id','course',$_GET[courseId],'section',(int)$_POST[id]); - $dataobject->summary = $_POST[summary]; - $dataobject->sequence = $_POST[sequence]; - $dataobject->visible = $_POST[visible]; - update_record('course_sections',$dataobject); - break; - - - - } - break; - - - - - case resource: switch($_GET[field]){ - - case visible: - $dataobject->id = $_POST[id]; - $dataobject->visible = $_POST[value]; - update_record('course_modules',$dataobject); - break; - - case groupmode: - $dataobject->id = $_POST[id]; - $dataobject->groupmode = $_POST[value]; - update_record('course_modules',$dataobject); - break; - - case section: - $dataobject->id = $_POST[id]; - //$dataobject->section = get_field('course_sections','id','course',$_GET[courseId],'section',(int)$_POST[value]); - $dataobject->section = $_POST[value]; - update_record('course_modules',$dataobject); - break; - - } - break; - - case course: switch($_GET[field]){ - - case marker: - $dataobject->id = $_GET[courseId]; - $dataobject->marker = $_POST[value]; - update_record('course',$dataobject); - break; - - - } - break; - - } - - - break; - case DELETE: - switch($_GET['class']){ - case block: - delete_records('block_instance','id',$_GET[instanceId]); - break; - - case section: - $dataobject->id = get_field('course_sections','id','course',$_GET[courseId],'section',(int)$_GET[id]); - $dataobject->summary = ''; - $dataobject->sequence = ''; - $dataobject->visible = '1'; - update_record('course_sections',$dataobject); - break; - - case resource: - delete_records('course_modules','id',$_GET[id]); - break; - - } - break; - } -?> diff --git a/course/format/topics/format.php b/course/format/topics/format.php index 2bcad82076..1d4c5f3af2 100644 --- a/course/format/topics/format.php +++ b/course/format/topics/format.php @@ -7,16 +7,9 @@ // Included from "view.php" require_once($CFG->dirroot.'/mod/forum/lib.php'); - require_once($CFG->dirroot.'/lib/ajaxlib/ajaxlib.php'); - - - - $topic = optional_param('topic', -1, PARAM_INT); - - // Bounds for block widths define('BLOCK_L_MIN_WIDTH', 100); define('BLOCK_L_MAX_WIDTH', 210); @@ -62,10 +55,6 @@ $strmarkedthistopic = get_string('markedthistopic'); $strmoveup = get_string('moveup'); $strmovedown = get_string('movedown'); - - $COURSE->javascriptportal = new jsportal(); - print_require_js(Array("yui_yahoo","yui_dom","yui_event","yui_dragdrop","yui_logger","yui_connection","ajaxcourse_blocks","ajaxcourse_sections","ajaxcourse_topic")); - } @@ -274,9 +263,5 @@ } echo ''; - - //create javascript portal code - if($COURSE->javascriptportal) - $COURSE->javascriptportal->print_javascript($course->id); ?> -- 2.39.5