diff -urBN --exclude=.svn --exclude=.git --exclude=.DS_Store /Users/binneyd/Downloads/topcoll/format.php ./topcoll/format.php
--- /Users/binneyd/Downloads/topcoll/format.php 2010-11-08 08:14:00.000000000 +1000
+++ ./topcoll/format.php 2011-01-04 19:08:58.000000000 +1000
@@ -8,6 +8,7 @@
require_once($CFG->libdir.'/ajax/ajaxlib.php');
+ require_once($CFG->dirroot.'/course/format/topcoll/lib/lib.php');
// For persistence of toggles.
require_js(array('yui_yahoo', 'yui_cookie', 'yui_event'));
@@ -237,7 +238,7 @@
$thissection->summary='';
echo '
'.$topictext.' '.$currenttext.$section.' - '.$toggletext.' | ';
} else {
- echo ''.html_to_text($thissection->summary).' - '.$toggletext.' | '.$topictext.' '.$currenttext.$section.' | ';
+ echo ''. get_title($thissection->summary) .' - '.$toggletext.' | '.$topictext.' '.$currenttext.$section.' | ';
// Comment out the above line and uncomment the line below if you do not want 'Topic x' displayed on the right hand side of the toggle.
//echo ''.html_to_text($thissection->summary).' - '.$toggletext.' | ';
}
@@ -252,6 +253,9 @@
//echo ' | ';
echo '';
+ //DB - moved this line so the topic is shown all the time to suit the title changes
+ echo format_text($thissection->summary, FORMAT_HTML, $summaryformatoptions);
+
if (!has_capability('moodle/course:viewhiddensections', $context) and !$thissection->visible) { // Hidden for students
// Do not show anything!
// echo get_string('notavailable');
@@ -260,7 +264,7 @@
if (isediting($course->id) && has_capability('moodle/course:update', $context)) {
$summaryformatoptions->noclean = true;
- echo format_text($thissection->summary, FORMAT_HTML, $summaryformatoptions);
+ //echo format_text($thissection->summary, FORMAT_HTML, $summaryformatoptions);
echo ' '.
'
';
}
diff -urBN --exclude=.svn --exclude=.git --exclude=.DS_Store /Users/binneyd/Downloads/topcoll/lib/lib.php ./topcoll/lib/lib.php
--- /Users/binneyd/Downloads/topcoll/lib/lib.php 1970-01-01 10:00:00.000000000 +1000
+++ ./topcoll/lib/lib.php 2011-01-04 18:00:20.000000000 +1000
@@ -0,0 +1,21 @@
+loadHTML($html);
+
+ $xpath = new DOMXPath($dom);
+ $tags = $xpath->query('//*[@class="toggle-title"]');
+
+ if ($tags->length > 0) {
+ $title = $tags->item(0)->textContent;
+ } else {
+ $title = html_to_text($html);
+ $title = substr($title, 0, 30) . "...";
+ }
+
+ return $title;
+ }
+
+?>
\ No newline at end of file
|