--- loncom/interface/loncommon.pm	2009/07/26 20:39:46	1.866
+++ loncom/interface/loncommon.pm	2009/07/31 03:14:20	1.873
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.866 2009/07/26 20:39:46 kalberla Exp $
+# $Id: loncommon.pm,v 1.873 2009/07/31 03:14:20 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -529,6 +529,11 @@ sub coursebrowser_javascript {
                 }
             }     
         }
+        if (formname == 'ccrs') {
+            var ownername = document.forms[formid].ccuname.value;
+            var ownerdom =  document.forms[formid].ccdomain.options[document.forms[formid].ccdomain.selectedIndex].value;
+            url += '&cloner='+ownername+':'+ownerdom;
+        }
         if (multflag !=null && multflag != '') {
             url += '&multiple='+multflag;
         }
@@ -620,12 +625,16 @@ function setSect(sectionlist) {
 
 sub selectcourse_link {
    my ($form,$unameele,$udomele,$desc,$extra_element,$multflag,$selecttype)=@_;
+   my $linktext = &mt('Select Course');
+   if ($selecttype eq 'Community') {
+       $linktext = &mt('Select Community'); 
+   }
    return '<span class="LC_nobreak">'
          ."<a href='"
          .'javascript:opencrsbrowser("'.$form.'","'.$unameele
          .'","'.$udomele.'","'.$desc.'","'.$extra_element
          .'","'.$multflag.'","'.$selecttype.'");'
-         ."'>".&mt('Select Course').'</a>'
+         ."'>".$linktext.'</a>'
          .'</span>';
 }
 
@@ -1787,7 +1796,7 @@ sub select_level_form {
 
 =pod
 
-=item * &select_dom_form($defdom,$name,$includeempty,$showdomdesc,$autosubmit)
+=item * &select_dom_form($defdom,$name,$includeempty,$showdomdesc,$onchange)
 
 Returns a string containing a <select name='$name' size='1'> form to 
 allow a user to select the domain to preform an operation in.  
@@ -1798,16 +1807,15 @@ selected");
 
 If the $showdomdesc flag is set, the domain name is followed by the domain description.
 
-If the $autosubmit flag is set, the form containing the domain selector will be auto-submitted by an onchange action.  
+The optional $onchange argumnet specifies what should occur if the domain selector is changed, e.g., 'this.form.submit()' if the form is to be automatically submitted.  
 
 =cut
 
 #-------------------------------------------
 sub select_dom_form {
-    my ($defdom,$name,$includeempty,$showdomdesc,$autosubmit) = @_;
-    my $onchange;
-    if ($autosubmit) {
-        $onchange = ' onchange="this.form.submit()"';
+    my ($defdom,$name,$includeempty,$showdomdesc,$onchange) = @_;
+    if ($onchange) {
+        ' onchange="'.$onchange.'"';
     }
     my @domains = sort {lc($a) cmp lc($b)} (&Apache::lonnet::all_domains());
     if ($includeempty) { @domains=('',@domains); }
@@ -3831,60 +3839,20 @@ sub parse_block_record {
     return ($setuname,$setudom,$title,$blocks);
 }
 
-sub build_block_table {
-    my ($startblock,$endblock,$setters) = @_;
-    my %lt = &Apache::lonlocal::texthash(
-        'cacb' => 'Currently active communication blocks',
-        'cour' => 'Course',
-        'dura' => 'Duration',
-        'blse' => 'Block set by'
-    );
-    my $output;
-    $output = '<br />'.$lt{'cacb'}.':<br />';
-    $output .= &start_data_table();
-    $output .= '
-<tr>
- <th>'.$lt{'cour'}.'</th>
- <th>'.$lt{'dura'}.'</th>
- <th>'.$lt{'blse'}.'</th>
-</tr>
-';
-    foreach my $course (keys(%{$setters})) {
-        my %courseinfo=&Apache::lonnet::coursedescription($course);
-        for (my $i=0; $i<@{$$setters{$course}{staff}}; $i++) {
-            my ($uname,$udom) = @{$$setters{$course}{staff}[$i]};
-            my $fullname = &plainname($uname,$udom);
-            if (defined($env{'user.name'}) && defined($env{'user.domain'})
-                && $env{'user.name'} ne 'public' 
-                && $env{'user.domain'} ne 'public') {
-                $fullname = &aboutmewrapper($fullname,$uname,$udom);
-            }
-            my ($openblock,$closeblock) = @{$$setters{$course}{times}[$i]};
-            $openblock = &Apache::lonlocal::locallocaltime($openblock);
-            $closeblock= &Apache::lonlocal::locallocaltime($closeblock);
-            $output .= &Apache::loncommon::start_data_table_row().
-                       '<td>'.$courseinfo{'description'}.'</td>'.
-                       '<td>'.$openblock.' to '.$closeblock.'</td>'.
-                       '<td>'.$fullname.'</td>'.
-                        &Apache::loncommon::end_data_table_row();
-        }
-    }
-    $output .= &end_data_table();
-}
 sub blocking_status {
-  my $blocked = blocking_status_print(@_);
+  my $blocked;
   my ($activity,$uname,$udom) = @_;
+  my %setters;
+  my ($startblock,$endblock)=&blockcheck(\%setters,$activity,$uname,$udom);
+  if ($startblock && $endblock) {
+    $blocked = 1;
+  }
   if(!wantarray) {
     return $blocked;
   }
   my $output;
   my $querystring;
   $querystring = "?activity=$activity";
-  if(defined($uname)) { 
-    $querystring .= "&uname=$uname";
-  }if(defined($udom)) {
-    $querystring .= "&udom=$udom";
-  }
 
       $output .= <<"END_MYBLOCK";
 <script type="text/javascript">
@@ -3901,73 +3869,19 @@ sub blocking_status {
 </script>
 END_MYBLOCK
   my $popupUrl = "/adm/blockingstatus/$querystring";
-  $output.="\n<img src='/res/adm/pages/emblem-readonly.png' /><a onclick='openWindow(\"$popupUrl\",\"Blocking Table\",600,300,\"no\",\"no\");return false;' href='/adm/blockingstatus/$querystring'>Blocking Table</a>";
+  $output .= <<"END_BLOCK";
+<div class='LC_comblock'>
+  <a onclick='openWindow("$popupUrl","Blocking Table",600,300,"no","no");return false;' href='/adm/blockingstatus/$querystring'
+  title='Communication Blocked'>
+  <img class='LC_noBorder LC_middle' title='Communication Blocked' src='/res/adm/pages/comblock.png' alt='Communication Blocked'/></a>
+  <a onclick='openWindow("$popupUrl","Blocking Table",600,300,"no","no");return false;' href='/adm/blockingstatus/$querystring' 
+  title='Communication Blocked'>Communication Blocked</a>
+</div>
+
+END_BLOCK
 
   return ($blocked, $output);
 }
-sub blocking_status_print {
-    my ($activity,$uname,$udom) = @_;
-    my %setters;
-    my ($blocked,$output,$ownitem,$is_course);
-    my ($startblock,$endblock)=&blockcheck(\%setters,$activity,$uname,$udom);
-    if ($startblock && $endblock) {
-        $blocked = 1;
-        if (wantarray) {
-            my $category;
-            if ($activity eq 'boards') {
-                $category = 'Discussion posts in this course';
-            } elsif ($activity eq 'chat') {
-                $category = 'Chat';
-            } elsif ($activity eq 'msgdisplay') {
-                $category = 'This message';
-            } elsif ($activity eq 'blogs') {
-                $category = 'Blogs'; 
-            } elsif ($activity eq 'port') {
-                if (defined($uname) && defined($udom)) {
-                    if ($uname eq $env{'user.name'} &&
-                        $udom eq $env{'user.domain'}) {
-                        $ownitem = 1;
-                    }
-                }
-                $is_course = &Apache::lonnet::is_course($udom,$uname);
-                if ($ownitem) { 
-                    $category = 'Your portfolio files';  
-                } elsif ($is_course) {
-                    my $coursedesc;
-                    foreach my $course (keys(%setters)) {
-                        my %courseinfo =
-                             &Apache::lonnet::coursedescription($course);
-                        $coursedesc = $courseinfo{'description'};
-                    }
-                    $category = "Group portfolio in the course '$coursedesc'";
-                } else {
-                    $category = 'Portfolio files belonging to ';
-                    if ($env{'user.name'} eq 'public' && 
-                        $env{'user.domain'} eq 'public') {
-                        $category .= &plainname($uname,$udom);
-                    } else {
-                        $category .= &aboutmewrapper(&plainname($uname,$udom),$uname,$udom);  
-                    }
-                }
-            } elsif ($activity eq 'groups') {
-                $category = 'Groups in this course';
-            } else {
-                $category = 'Communication';
-            }
-            my $showstart = &Apache::lonlocal::locallocaltime($startblock);
-            my $showend = &Apache::lonlocal::locallocaltime($endblock);
-            $output = '<br />'.&mt('[_1] will be inaccessible between [_2] and [_3] because communication is being blocked.',$category,$showstart,$showend).'<br />';
-            if (!($activity eq 'port' && !($ownitem) && !($is_course))) { 
-                $output .= &build_block_table($startblock,$endblock,\%setters);
-            }
-        }
-    }
-    if (wantarray) {
-        return ($blocked,$output);
-    } else {
-        return $blocked;
-    }
-}
 
 ###############################################
 
@@ -5447,12 +5361,27 @@ div.LC_feedback_link {
 
 div.LC_feedback_link img {
   height: 22px;
+  vertical-align:middle;
 }
 
 div.LC_feedback_link a{
   text-decoration: none;
 }
 
+div.LC_comblock {
+  display:inline; 
+  color:$font;
+  font-size:90%;
+}
+
+div.LC_feedback_link div.LC_comblock {
+  padding-left:5px;
+}
+
+div.LC_feedback_link div.LC_comblock a {
+  color:$font;
+}
+
 span.LC_feedback_link {
   /* background: $feedback_link_bg; */
   font-size: larger;
@@ -5929,24 +5858,13 @@ ul.LC_TabContent {
 	background: $sidebg;
 	border-bottom: solid 1px $lg_border_color;
 	list-style:none;
-	margin: -10px -10px 0 -10px;
+	margin: 0 -10px;
 	padding: 0;
 }
 
-ul.LC_TabContentBigger {
-        display:block;
-        list-style:none;
-        padding: 0;
-}
-
-
 ul.LC_TabContent li,
 ul.LC_TabContentBigger li {
-	display: inline;
-	border-right: solid 1px $lg_border_color;
 	float:left;
-	line-height:140%;
-	white-space:nowrap;
 }
 
 ul#LC_TabMainMenuContent li a {
@@ -5983,32 +5901,57 @@ ul.LC_TabContent li:hover, ul.LC_TabCont
 	padding-right: 16px;
 }
 
+#maincoursedoc {
+	clear:both;
+}
+
+ul.LC_TabContentBigger {
+        display:block;
+        list-style:none;
+        padding: 0;
+}
+
 ul.LC_TabContentBigger li {
-	vertical-align:bottom;
-	border-top:solid 1px $lg_border_color;
-	border-left:solid 1px $lg_border_color;
-	padding:5px 10px 5px 10px;
-	margin-left:2px;
-	background: #d9d9d9;
+        vertical-align:bottom;
+        height: 30px;
+        font-size:110%;
+        font-weight:bold;
+        color: #737373;
 }
 
-#maincoursedoc {
-	clear:both;
+
+ul.LC_TabContentBigger li a {
+        background:url('/adm/lonIcons/tabbgleft.gif') left bottom no-repeat;
+	height: 30px;
+	line-height: 30px;
+	text-align: center;
+	display: block;
+	text-decoration: none;
 }
 
-ul.LC_TabContentBigger li:hover, 
-ul.LC_TabContentBigger li.active {
-	background: #ffffff;
+ul.LC_TabContentBigger li:hover a, 
+ul.LC_TabContentBigger li.active a {
+	background:url('/adm/lonIcons/tabbgleft.gif') left top no-repeat;
 	color:$font;
+	text-decoration: underline;
 }
 
-ul.LC_TabContentBigger li, 
-ul.LC_TabContentBigger li a {
-	font-size:110%;
-	font-weight:bold;
-	color: #737373;
+
+ul.LC_TabContentBigger li b {
+	background: url('/adm/lonIcons/tabbgright.gif') no-repeat right bottom;
+	display: block;
+	float: left;
+	padding: 0 30px;
+}
+
+ul.LC_TabContentBigger li:hover b,
+ul.LC_TabContentBigger li.active b {
+        background:url('/adm/lonIcons/tabbgright.gif') right top no-repeat;
+        color:$font;
+	border-bottom: 1px solid #FFFFFF;
 }
 
+
 ul.LC_CourseBreadcrumbs {
   background: $sidebg;
   line-height: 32px;
@@ -6506,6 +6449,8 @@ $args - additional optional args support
              inherit_jsmath -> when creating popup window in a page,
                                     should it have jsmath forced on by the
                                     current page
+             bread_crumbs ->             Array containing breadcrumbs
+             bread_crumbs_components ->  if exists show it as headline else show only the breadcrumbs
 
 =back