diff -ruN moodle-1.7/course/lib.php moodle-dev/course/lib.php
--- moodle-1.7/course/lib.php 2006-09-28 03:00:47.000000000 +0100
+++ moodle-dev/course/lib.php 2006-10-04 12:17:38.000000000 +0100
@@ -1155,11 +1155,18 @@
} else { // Normal activity
$linkcss = $mod->visible ? "" : " class=\"dimmed\" ";
- echo '
'.
- ' '.
- $instancename.'';
+
+ $linktag = ' ';
+
+ $icontag = '
';
+
+ if ($CFG->clickable_icons == 1 ){
+ echo $linktag . $icontag . ' ' . $linktag . $instancename . '';
+ }else{
+ echo $icontag . $linktag . $instancename . '';
+ }
+
}
if ($usetracking && $mod->modname == 'forum') {
$groupmode = groupmode($course, $mod);
@@ -1428,9 +1435,16 @@
echo '';
}
- echo '
'.$catimage.' | ';
+ $categorylinktag = '';
+
+ if ( $CFG->clickable_icons == 1 ){
+ echo '' . $categorylinktag . $catimage .' | ';
+ }else{
+ echo ''.$catimage.' | ';
+ }
+
echo '';
- echo ''.$category->name.'';
+ echo $categorylinktag . $category->name.'';
echo ' | ';
echo ' | ';
echo '';
diff -ruN moodle-1.7/lib/weblib.php moodle-dev/lib/weblib.php
--- moodle-1.7/lib/weblib.php 2006-10-03 03:02:22.000000000 +0100
+++ moodle-dev/lib/weblib.php 2006-10-04 12:31:38.000000000 +0100
@@ -4919,6 +4919,7 @@
* @todo Finish documenting this function. Show example of various attributes, etc.
*/
function print_side_block($heading='', $content='', $list=NULL, $icons=NULL, $footer='', $attributes = array(), $title='') {
+ global $CFG;
//Accessibility: skip block link, with title-text (or $block_id) to differentiate links.
static $block_id = 0;
@@ -4953,8 +4954,22 @@
echo "\n\n";
foreach ($list as $key => $string) {
echo '- ';
+
if ($icons) {
- echo ''. $icons[$key] .'';
+ $basicspan = ''. $icons[$key] .'';
+
+ if ( $CFG->clickable_icons == 1 ){
+ $linkhtml = extract_initial_link_tag($string);
+
+ // Make block icon clickable if configured and there is html in the block text
+ if ($linkhtml) {
+ echo ''. $linkhtml . $icons[$key] .'';
+ }else{
+ $basicspan;
+ }
+ }else{
+ echo $basicspan;
+ }
}
echo ''. $string .'';
echo "
\n";
@@ -4973,6 +4988,23 @@
}
/**
+ * Extracts the a beginign link tag from a html string if it is the first
+ * item in the string, otherwise returns 0 for no
+ * link found (or if there is somethign else before the link)
+ *
+ * @param string $inputhtml html to extract link from
+ *
+ */
+function extract_initial_link_tag($inputhtml = ''){
+ $regexp = "/^\s*(]+)>)/i";
+ if ( preg_match($regexp, $inputhtml, $matches) ){
+ return $matches[1];
+ } else{
+ return 0;
+ }
+ }
+
+/**
* Starts a nice side block with an optional header.
*
* @param string $heading ?