Revision: 93
http://svn.sourceforge.net/hw4mdl/?rev=93&view=rev
Author: shazan
Date: 2006-10-20 07:05:16 -0700 (Fri, 20 Oct 2006)
Log Message:
-----------
Modified Paths:
--------------
trunk/moodle/blocks/next_liveclassroom/block_next_liveclassroom.php
Modified: trunk/moodle/blocks/next_liveclassroom/block_next_liveclassroom.php
===================================================================
--- trunk/moodle/blocks/next_liveclassroom/block_next_liveclassroom.php 2006-10-20 13:55:25 UTC (rev 92)
+++ trunk/moodle/blocks/next_liveclassroom/block_next_liveclassroom.php 2006-10-20 14:05:16 UTC (rev 93)
@@ -25,6 +25,7 @@
die;
}
+
$this->content = new stdClass;
$this->content->text = '';
@@ -69,14 +70,20 @@
// print $line;
$cm = get_record("course_modules", "id", "$line");
if($cm->module==$lc->id) {
- if(sizeof($result1)==$gnumber) {
+ if(sizeof($result)>=$gnumber) {
$full=true;
break;
}
else{
- array_push($result,$line);
+ $block_instance = array();
+
+ $course = get_record("course", "id", "$cm->course");
+ $block_instance['course'] =$course->fullname;
+ $block_instance['summary'] = $section->summary;
+ $block_instance['cm_id'] = $line; //$cm id
$liveclassroom = get_record("liveclassroom", "id", "$cm->instance");
- array_push($result1,$liveclassroom->name);
+ $block_instance['lc_name'] = $liveclassroom->name;
+ array_push($result,$block_instance);
}
}
}
@@ -85,7 +92,24 @@
}
$sectionnumber++;
}
-
+ $this->content->text .= '<table width="100%">';
+ //Display the list
+
+ foreach ($result as $block) {
+ $this->content->text .= '<tr><td>';
+ $this->content->text .= '<a href="'.$CFG->wwwroot.'/mod/liveclassroom/view.php?id='.$block['cm_id'].'" >';
+ if($block['summary'] !=null) {
+ $this->content->text .= $block['summary'].': ';
+ }
+ $this->content->text .= $block['lc_name'].'</a>';
+ $this->content->text .= '</tr></td>';
+ $this->content->text .= '<tr style="font-style:italic; color: #969696;"><td>';
+ $this->content->text .= $block['course'];
+ $this->content->text .= '</tr></td>';
+ $this->content->text .= '<tr style="border-bottom: 1px solid #666666; "><td ></td></tr>';
+
+ }
+ $this->content->text .= '</table>';
}
@@ -110,31 +134,42 @@
//Look just the liveclasssroom instance
$cm = get_record("course_modules", "id", "$line");
if($cm->module==$lc->id) {
- if(sizeof($result1)==$cnumber){
+ if(sizeof($result1)>=$cnumber){
$full=true;
}
else {
- array_push($result,$line);
+ $block_instance = array();
+
+ $block_instance['course'] =$COURSE->fullname;
+ $block_instance['summary'] = $section->summary;
+ $block_instance['cm_id'] = $line; //$cm id
$liveclassroom = get_record("liveclassroom", "id", "$cm->instance");
- array_push($result1,$liveclassroom->name);
+ $block_instance['lc_name'] = $liveclassroom->name;
+ array_push($result,$block_instance);
}
}
}
}
}
}
-
- }
$this->content->text .= '<table width="100%">';
//Display the list
- for($r=0;$r<sizeof($result);$r++) {
- // $this->content->text .= '<div style="text-align: left; font-size: 1; padding-top: 5px;">';
+ foreach ($result as $block) {
+
$this->content->text .= '<tr><td>';
- $this->content->text .= '<a href="'.$CFG->wwwroot.'/mod/liveclassroom/view.php?id='.$result[$r].'" >'.$result1[$r].'</a>';
+ $this->content->text .= '<a href="'.$CFG->wwwroot.'/mod/liveclassroom/view.php?id='.$block['cm_id'].'" >'.$block['lc_name'].'</a>';
$this->content->text .= '</tr> </td>';
- // $this->content->text .= '</div>';
+ if($block['summary'] !=null) {
+ $this->content->text .= '<tr style="font-style:italic; color: #969696;"><td>';
+ $this->content->text .= $block['summary'];
+ $this->content->text .= '</tr></td>';
+ }
+ $this->content->text .= '<tr style="border-bottom: 1px solid #666666; "><td ></td></tr>';
+
}
$this->content->text .= '</table>';
+ }
+
return $this->content;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|