GUI
Recently we had a project meeting and went through some feedback from the users of one of our courses. One thing that came up which kind of surprised me at first was that many users didn't get the difference between the "subscribe to forums" functionality and the "subscribe to thread" functionality. They wondered why they had to subscribe to the thread when they were allready subscribed to the forum.
Well, they don't of course, but when thinking of it you can understand the question. If you are subscribed to a forum allready, the system shouldn't give you the possibility to subscribe to the threads within it.
The good way to solve this would be to only allow subscription to threads if the user isn't subscribed to the forum they belong in, but the easy way is to just remove the possibility to subscribe to threads alltogether. This is what I will try and see if I get any reactions.
To do this, find the include/html/forum.inc.php, scroll down to lines 156 - 162 and comment out the following code:
<?php
if ($_SESSION['enroll'] && !$row['locked']) {
if (isset($last_accessed[$row['post_id']]) && $last_accessed[$row['post_id']]['subscribe']){
echo ' <br /><small><a href="forum/subscribe.php?us=1'.SEP.'pid='.$row['post_id'].SEP.'fid='.$fid.SEP.'t=1">('._AT('unsubscribe1').')</a></small>';
} else {
echo ' <br /><small><a href="forum/subscribe.php?pid='.$row['post_id'].SEP.'fid='.$fid.SEP.'t=1">('._AT('subscribe1').')</a></small>';
}
}
;
?>Many people would probably object to removing functionality, but I try to live by the KISS principle instead!

Quick and dirty trick to add a class to content links (and use grep!)
February 16, 2009 - 11:31 — Vegard A. JohansenWe've had several requests from clients that wants certain content pages stand out more than other content pages. This is easy to do with CSS, but then you need a hook to hang the CSS on, which is not available by default in ATutors content navigation.
I decided to have a closer look at this today, and my goal was adding an unique class to each content link in the side meny.
What you do is:
find include/classes/ContentManager.class.php
and within this file you need to find a link to content, I found one at line 696 that I got to work. It looks like:
<?php
$link .= $img_link . '<a href="'.$_base_path.url_rewrite($in_link).'" title="';
?>(not including the php start and end tag)
I'll be honest and say that I don't know if this is the best line to alter, but at least the end result works in all my tests. I changed the line to:
<?php
$link .= $img_link . '<a class="cid-'.$content['content_id'].'" href="'.$_base_path.url_rewrite($in_link).'" title="';
?>(again, not including the php start and end tag)
that is, adding class="cid-'.$content['content_id'].'" which will create an end result like <a class="cid-123" href=".." when you view source, which you can use to style!
Bonus tip
Finding code you wish to alter is easy if you have a terminal (which means you use Mac or Linux), and I'll write down here how you can use the grep command in a terminal to find this, mostly because I need a place where I can look it up myself:
Go to the directory where you wish to start searching, and fire away:
grep -R "I am the eggman!" test/*You will now search for I am the eggman! recursively within all the files in the test directory.
To find HTML code you will probably find that you need to search for the "-character too, and then you need to escape them. Here's what I used to find the file with the code I needed to change in the example above:
grep -R 'alt=\"\" class=\"img-size-tree\"' atutor/*Hat tip to Lon, the terminal ninja, for helping me with this
Something we've gotten quite a lot of feedback on is that the boxes for uploading new files and / or creating new folders in the file storage isn't obvious. People have a tendency to not see or ignore the "new file" and "create folder" boxes, and don't understand why they have to click the boxes to open them.
And, when thinking about it, I don't know why they should have to click these boxes to open them either. In addition the alignment of these boxes has been changed in newer ATutor versions, so this is what meets you in the file stoarage tool when using the default (and also Redux) theme:
So, two boxes, not aligned, which the user will have to click to open before they can start creating folders or files.
I created a patch that changes this. This patch does a few things:
- Removes the boxes completely, and wraps the two boxes in two fieldsets instead, which also blends better in with ATutors' way of doing forms, and are more in line with accessibility guidelines.
- Earlier this, technically, was one form. To make it validate it is now two forms - one for creating folders and one for uploading files.
- The inline javascript is removes, as well as the javascript "body onload" states.
- A few lines are added to the CSS, to make it look better.
In the default theme the end result is the following:

Now the boxes are always open, and wrapped in fieldsets. This solution takes up a tiny bit more screen estate (37 pixels more in height to be exact), but will probably be less confusing for the users. In addition, the file_storage/index.php is around 80 lines shorter!
The patch adds the neccessary styles to the default theme, and the next version of the Redux theme will have this included by default. If you wish to use it in other themes, please add the following to your themes' CSS file:
.file-storage-uploads {
padding: 10px;
margin: 0 auto;
margin-bottom: 40px;
display: table;
}
fieldset.file-storage-new-folder {
float: left;
margin-right: 30px;
padding: 10px;
border: 1px solid #E0E0E0;
}
fieldset.file-storage-new-file {
float: left;
padding: 10px;
border: 1px solid #E0E0E0;
width: 40%;
}Patch is tested in IE 5.5+, Firefox 2 and Opera 9 with no side effects so far, please post additional test results or other comments below!
One tweak we did for the Redux theme, and the upcoming Hopper theme is that the "home" heading on course front pages are removed, while the headings for the other sections (forums, file storage etc.) are kept.
We find this better as we always make custom front pages on courses under magage -> preferences (the "banner" box), where we specify the course title. Having both "home" and our course title as headings does not look good. Also, if the front page has nothing but announcements on it, you get two headning: "home" + "announcements".
If you wish to have this tweak in the default theme as well, this is what you do:
Right below line 262 in themes/default/include/header.inc.php, insert this line:
<?php
// remove home title
$we_are_home = ($this->page_title == _AT('home'))?TRUE:FALSE;
?>the code block should now look something like:
<?php foreach ($this->top_level_pages as $page): ?>
<?php ++$accesscounter; $accesscounter = ($accesscounter == 10 ? 0 : $accesscounter); ?>
<?php $accesskey_text = ($accesscounter < 10 ? 'accesskey="'.$accesscounter.'"' : ''); ?>
<?php $accesskey_title = ($accesscounter < 10 ? ' Alt+'.$accesscounter : ''); ?>
<?php if ($page['url'] == $this->current_top_level_page): ?>
<?php // remove home title
$we_are_home = ($this->page_title == _AT('home'))?TRUE:FALSE; ?>
<li><a href="<?php echo $page['url']; ?>" <?php echo $accesskey_text; ?> title="<?php echo $page['title'] . $accesskey_title; ?>" class="active"><?php echo $page['title']; ?></a></li>Then, at the very end of the same file, where the page title is echoed, replace the line there with this one:
<!-- the page title -->
<h2><?php if(!$we_are_home) {echo $this->page_title; }?></h2>That's all!
Slowly getting back in track after the holidays, and starting off with a small howto on how you can edit and alter the tools available in TinyMCE in ATutor.
It's very simple, just edit the atutor/include/lib/tinymce.inc.php: around lines 68 - 70 you see something like:
theme_advanced_buttons1 :
"pastetext,pasteword,|,bold,italic,bullist,numlist,link,unlink,
theme_advanced_buttons2 : "cut,copy,paste,|,search,replace,|,outdent,indent,|,undo,redo,This shows line one and two in my newly edited file, and should be quite easy to understand. Move the tools to where you like to have them, and save the file.
In our case I've moved the tools I find most important for our users to line one, starting with the new "paste as plain text" and "paste from Word" tools. I've also removed the font family drop down (no Comic Sans Serif, kthxbai) and some other tools. The screenshots below show the original and my edited TinyMCE:



Add subscription icons to the forum subscribe / unsubscribe link
July 14, 2008 - 12:30 — Vegard A. JohansenSome time ago we added a small modification to the forum listings in ATutor, which adds a small visual cue to whether you are subscribed to a forum or not.
It's best explained by example. This is the way forums look by default:

While you see the "Subscribe" / "Unsubscribe" text, it's not very easy to see which you are subscribed to and which not at a glance.
Our modification changes this listing to:
![]()
..so there's a small envelope showing if you are not subscribed, and a stop sign if you are. It's a detail, but has proved to be quite useful - have a look at our demo server! (note: you have to be registered and enrolled to see it).
Today I made this as a patch so yo can add it yourself. The patch changes the forum/list.php and adds the two small icons to the same folder.