Index: blocks/tags/block_tags.php
===================================================================
RCS file: /cvsroot/moodle/moodle/blocks/tags/block_tags.php,v
retrieving revision 1.14
diff -u -r1.14 block_tags.php
--- blocks/tags/block_tags.php	5 Jan 2009 21:37:22 -0000	1.14
+++ blocks/tags/block_tags.php	9 Apr 2009 12:54:39 -0000
@@ -101,14 +101,9 @@
             //TODO check whether time limited personal tags are required
             $numoftags = $this->config->numberoftags;
             $sort = 'name';
-            $alltags = $officialtags = $coursetags = $commtags = $mytags = $coursetagdivs = $courseflag = '';
-            if ($sitepage or $coursepage) {
+            $alltags = $coursetags = $mytags = $coursetagdivs = $courseflag = '';
+            if ($sitepage) {
                 $alltags = coursetag_print_cloud(coursetag_get_all_tags($sort, $this->config->numberoftags), true);
-                $officialtags = coursetag_print_cloud(coursetag_get_tags(0, 0, 'official', $numoftags, $sort), true);
-                $commtags = coursetag_print_cloud(coursetag_get_tags(0, 0, 'default', $numoftags, $sort), true);
-                if ($loggedin) {
-                    $mytags = coursetag_print_cloud(coursetag_get_tags(0, $USER->id, 'default', $numoftags, $sort), true);
-                }
             }
             if ($coursepage) {
                 $coursetags = coursetag_print_cloud(coursetag_get_tags($COURSE->id, 0, '', $numoftags, $sort), true);
@@ -117,23 +112,15 @@
             }
             if ($mymoodlepage) {
                 $mytags = coursetag_print_cloud(coursetag_get_tags(0, $USER->id, 'default', $numoftags, $sort), true);
-                $officialtags = coursetag_print_cloud(coursetag_get_tags(0, 0, 'official', $numoftags, $sort), true);
-                $commtags = coursetag_print_cloud(coursetag_get_tags(0, 0, 'default', $numoftags, $sort), true);
             }
 
             // Prepare the divs and javascript that displays the groups of tags (and which is displayed first)
             $moretags = $CFG->wwwroot.'/tag/coursetags_more.php';
             $moretagstitle = get_string('moretags', $tagslang);
             $moretagsstring = get_string('more', $tagslang);
-            $displayblock = 'style="display:block"';
-            $displaynone = 'style="display:none"'; //only one div created below will be displayed at a time
+            $display = 'style="display:block"';
             if ($alltags) {
-                if ($sitepage) {
-                    $display = $displayblock;
-                } else {
-                    $display = $displaynone;
-                }
-                $alltagscontent = '
+                 $alltagscontent = '
                     <div id="f_alltags" '.$display.'>'.
                         get_string("alltags", $tagslang).
                         '<div class="coursetag_list">'.$alltags.'</div>
@@ -144,11 +131,6 @@
                 $coursetagdivs .= '"f_alltags", ';
             }
             if ($mytags) {
-                if ($mymoodlepage) {
-                    $display = $displayblock;
-                } else {
-                    $display = $displaynone;
-                }
                 $mytagscontent = '
                     <div id="f_mytags" '.$display.'>';
                         /*if ($rssfeed) { // - temporarily removed
@@ -167,29 +149,8 @@
                     </div>';
                 $coursetagdivs .= '"f_mytags", ';
             }
-            if ($officialtags) {
-                if ($mytags or $alltags) {
-                    $display = $displaynone;
-                } else {
-                    $display = $displayblock;
-                }
-                $officialtagscontent = '
-                    <div id="f_officialtags" '.$display.'>'.
-                        get_string('officialtags', $tagslang).
-                        '<div class="coursetag_list">'.$officialtags.'</div>
-                        <div class="coursetag_morelink">
-                            <a href="'.$moretags.'?show=official'.$courseflag.'" title="'.$moretagstitle.'">'.$moretagsstring.'</a>
-                        </div>
-                    </div>';
-                $coursetagdivs .= '"f_officialtags", ';
-            }
             if ($coursetags) {
-                if ($coursepage) {
-                    $display = $displayblock;
-                } else {
-                    $display = $displaynone;
-                }
-                $coursetagscontent = '
+               $coursetagscontent = '
                     <div id="f_coursetags" '.$display.'>'.
                         get_string('coursetags', $tagslang).
                         '<div class="coursetag_list">'.$coursetags.'</div>
@@ -199,17 +160,6 @@
                     </div>';
                 $coursetagdivs .= '"f_coursetags", ';
             }
-            if ($commtags) {
-                $commtagscontent = '
-                    <div id="f_commtags" '.$displaynone.'>'.
-                        get_string('communitytags', $tagslang).
-                        '<div class="coursetag_list">'.$commtags.'</div>
-                        <div class="coursetag_morelink">
-                            <a href="'.$moretags.'?show=community'.$courseflag.'" title="'.$moretagstitle.'">'.$moretagsstring.'</a>
-                        </div>
-                    </div>';
-                $coursetagdivs .= '"f_commtags", ';
-            }
             // Tidy up the end of a javascript array and add javascript
             $coursetagdivs = rtrim($coursetagdivs, ', ');
             $this->content->text .= coursetag_get_jscript($coursetagdivs);
@@ -217,95 +167,51 @@
             // Add the divs (containing the tags) to the block's content
             if ($alltags) { $this->content->text .= $alltagscontent; }
             if ($mytags) { $this->content->text .= $mytagscontent; }
-            if ($officialtags) { $this->content->text .= $officialtagscontent; }
             if ($coursetags) { $this->content->text .= $coursetagscontent; }
-            if ($commtags) { $this->content->text .= $commtagscontent; }
 
             // add the input form section (allowing a user to tag the current course) and navigation, or loggin message
             if ($loggedin) {
                 // only show the input form on course pages for those allowed (or not barred)
                 if ($coursepage && $canedit) {
                     //$this->content->footer .= coursetag_get_jscript();
-                    $tagthisunit = get_string('tagthisunit', $tagslang);
                     $buttonadd = get_string('add', $tagslang);
                     $arrowtitle = get_string('arrowtitle', $tagslang);
                     $coursetaghelpbutton = helpbutton('addtags', 'adding tags', $tagslang, TRUE, FALSE, '', TRUE);
+                    $edit_tags = get_string('edittags', $tagslang);
                     $sesskey = sesskey();
                     $this->content->footer .= <<<EOT
-                        <hr />
-                        <form action="{$CFG->wwwroot}/tag/coursetags_add.php" method="post" id="coursetag"
-                                onsubmit="return ctags_checkinput(this.coursetag_new_tag.value)">
-                            <div style="display: none;">
-                                <input type="hidden" name="entryid" value="$COURSE->id" />
-                                <input type="hidden" name="userid" value="$USER->id" />
-                                <input type="hidden" name="sesskey" value="$sesskey" />
-                            </div>
-                            <div><label for="coursetag_new_tag">$tagthisunit</label></div>
-                            <div class="coursetag_form_wrapper">
-                            <div class="coursetag_form_positioner">
-                                <div class="coursetag_form_input1">
-                                    <input type="text" name="coursetag_sug_keyword" class="coursetag_form_input1a" disabled="disabled" />
-                                </div>
-                                <div class="coursetag_form_input2">
-                                    <input type="text" name="coursetag_new_tag" id="coursetag_new_tag" class="coursetag_form_input2a"
-                                        onfocus="ctags_getKeywords()" onkeyup="ctags_getKeywords()" maxlength="50" />
-                                </div>
-                                <div class="coursetag_form_input3" id="coursetag_sug_btn">
-                                    <a title="$arrowtitle">
-                                        <img src="$CFG->pixpath/t/arrow_left.gif" width="10" height="10" alt="enter" onclick="ctags_setKeywords()" />
-                                    </a>
-                                </div>
-                            </div>
-                            <div style="display: inline;">
-                                <button type="submit">$buttonadd</button>
-                                $coursetaghelpbutton
-                            </div>
-                            </div>
-                        </form>
+<hr />
+<form action="{$CFG->wwwroot}/tag/coursetags_add.php" method="post" id="coursetag"
+        onsubmit="return ctags_checkinput(this.coursetag_new_tag.value)">
+    <div style="display: none;">
+        <input type="hidden" name="entryid" value="$COURSE->id" />
+        <input type="hidden" name="userid" value="$USER->id" />
+        <input type="hidden" name="sesskey" value="$sesskey" />
+    </div>
+    <div class="coursetag_form_wrapper">
+        <div class="coursetag_form_positioner">
+            <div class="coursetag_form_input1">
+                <input type="text" name="coursetag_sug_keyword" class="coursetag_form_input1a" disabled="disabled" />
+            </div>
+            <div class="coursetag_form_input2">
+                <input type="text" name="coursetag_new_tag" id="coursetag_new_tag" class="coursetag_form_input2a"
+                    onfocus="ctags_getKeywords()" onkeyup="ctags_getKeywords()" maxlength="50" />
+            </div>
+            <div class="coursetag_form_input3" id="coursetag_sug_btn">
+                <a title="$arrowtitle">
+                    <img src="$CFG->pixpath/t/arrow_left.gif" width="10" height="10" alt="enter" onclick="ctags_setKeywords()" />
+                </a>
+            </div>
+        </div>
+        <div style="display: inline;">
+            <button type="submit">$buttonadd</button>
+            $coursetaghelpbutton
+            <a href="$CFG->wwwroot/tag/coursetags_edit.php?courseid=$COURSE->id" title="$edit_tags">$edit_tags</a>
+        </div>
+    </div>
+</form>
 EOT;
-                    // add the edit link
-                    $this->content->footer .= '
-                        <div>
-                        <a href="'.$CFG->wwwroot.'/tag/coursetags_edit.php?courseid='.$COURSE->id.'"
-                        title="'.get_string('edittags', $tagslang).'">'.get_string('edittags', $tagslang).'</a>
-                        </div>';
-                }
-
-                // Navigation elements at the bottom of the block
-                // show the alternative displays options if available
-                if ($mytags or $officialtags or $commtags or $coursetags) {
-                    $this->content->footer .= '<div id="coursetagslinks"></div>';
                 }
-                // This section sets the order of the links
-                $coursetagslinks = array();
-                if ($mytags) {
-                    $coursetagslinks['my'] = array('title'=>get_string('mytags2', $tagslang),
-                                                    'onclick'=>'f_mytags',
-                                                    'text'=>get_string('mytags1', $tagslang));
-                }
-                // because alltags is always present, only show link if there is something else as well
-                if ($alltags and ($mytags or $officialtags or $commtags or $coursetags)) {
-                    $coursetagslinks['all'] = array('title'=>get_string('alltags2', $tagslang),
-                                                    'onclick'=>'f_alltags',
-                                                    'text'=>get_string('alltags1', $tagslang));
-                }
-                if ($officialtags) {
-                    $coursetagslinks['off'] = array('title'=>get_string('officialtags2', $tagslang),
-                                                    'onclick'=>'f_officialtags',
-                                                    'text'=>get_string('officialtags1', $tagslang));
-                }
-                //if ($commtags) {
-                //    $coursetagslinks['com'] = array('title'=>get_string('communitytags2', $tagslang),
-                //                                    'onclick'=>'f_commtags',
-                //                                    'text'=>get_string('communitytags1', $tagslang));
-                //}
-                if ($coursetags) {
-                    $coursetagslinks['crs'] = array('title'=>get_string('coursetags2', $tagslang),
-                                                    'onclick'=>'f_coursetags',
-                                                    'text'=>get_string('coursetags1', $tagslang));
-                }
-                $this->content->footer .= coursetag_get_jscript_links($coursetagslinks);
-
             } else {
                 //if not logged in
                 $this->content->footer = '<hr />'.get_string('please', $tagslang).'
