]> git.mjollnir.org Git - moodle.git/commitdiff
Added attribute $linkedwhenselected to tabobject class. Basically defines
authorvyshane <vyshane>
Wed, 8 Mar 2006 04:53:48 +0000 (04:53 +0000)
committervyshane <vyshane>
Wed, 8 Mar 2006 04:53:48 +0000 (04:53 +0000)
whether the tab should be linked even if it is selected.

lib/weblib.php

index 064217f4fbb924da983579a57035f67a255dee3b..75a8480a42527c82ad9ae81e9fb54d49dfdcc18f 100644 (file)
@@ -4584,13 +4584,15 @@ class tabobject {
     var $id;
     var $link;
     var $text;
+    var $linkedwhenselected;
 
     /// A constructor just because I like constructors
-    function tabobject ($id, $link='', $text='', $title='') {
+    function tabobject ($id, $link='', $text='', $title='', $linkedwhenselected=false) {
         $this->id   = $id;
         $this->link = $link;
         $this->text = $text;
         $this->title = $title ? $title : $text;
+        $this->linkedwhenselected = $linkedwhenselected;
     }
 
 
@@ -4602,7 +4604,7 @@ class tabobject {
         $cstr = '';
 
     /// The text and anchor for this tab
-        if ($inactive || $activetwo || $selected) {
+        if ($inactive || $activetwo || ($selected && !$this->linkedwhenselected)) {
             $astr .= $this->text;
         } else {
             $astr .= '<a href="'.$this->link.'" title="'.$this->title.'">'.$this->text.'</a>';