--- loncom/interface/loncommon.pm 2009/05/18 16:29:55 1.821 +++ loncom/interface/loncommon.pm 2009/05/19 22:52:10 1.822 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.821 2009/05/18 16:29:55 raeburn Exp $ +# $Id: loncommon.pm,v 1.822 2009/05/19 22:52:10 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -4168,6 +4168,68 @@ sub designparm { return $output; } +############################################## +=pod + +=item * &head_subbox() + +Inputs: $content (contains HTML code with page functions, etc.) + +Returns: HTML div with $content + To be included in page header + +=cut + +sub head_subbox { + my ($content)=@_; + my $output = + '
' #FIXME: solve conflicts with lonhtmlcommon:breadcrumbs LC_head_subbox + .$content + .'
' +} + +############################################## +=pod + +=item * &CSTR_pageheader() + +Inputs: ./. + +Returns: HTML div with CSTR path and recent box + To be included on Construction Space pages + +=cut + +sub CSTR_pageheader { + # this is for resources; directories have customtitle, and crumbs + # and select recent are created in lonpubdir.pm + my ($uname,$thisdisfn)= + ($env{'request.filename'} =~ m|^/home/([^/]+)/public_html/(.*)|); + my $formaction='/priv/'.$uname.'/'.$thisdisfn; + $formaction=~s/\/+/\//g; + + my $parentpath = ''; + my $lastitem = ''; + if ($thisdisfn =~ m-(.+/)([^/]*)$-) { + $parentpath = $1; + $lastitem = $2; + } else { + $lastitem = $thisdisfn; + } + return + '
' + .&Apache::loncommon::help_open_menu('','',3,'Authoring') #FIXME: Broken? Where is it? + .''.&mt('Construction Space:').' ' + .'
' #FIXME lonpubdir: target="_parent" + .&Apache::lonhtmlcommon::crumbs($uname.'/'.$parentpath,'_top','/priv','','+1',1)."$lastitem
" + #FIXME lonpubdir: &Apache::lonhtmlcommon::crumbs($uname.$thisdisfn.'/','_top','/priv','','+1',1)."
" + .&Apache::lonhtmlcommon::select_recent('construct','recent','this.form.action=this.form.recent.value;this.form.submit()') + .'
' + .&Apache::lonmenu::constspaceform() + .'
'; +} + ############################################### ############################################### @@ -4320,32 +4382,9 @@ ENDROLE $forcereg=1; } - if (!$customtitle && $env{'request.state'} eq 'construct') { - # this is for resources; directories have customtitle, and crumbs - # and select recent are created in lonpubdir.pm - my ($uname,$thisdisfn)= - ($env{'request.filename'} =~ m|^/home/([^/]+)/public_html/(.*)|); - my $formaction='/priv/'.$uname.'/'.$thisdisfn; - $formaction=~s/\/+/\//g; - - my $parentpath = ''; - my $lastitem = ''; - if ($thisdisfn =~ m-(.+/)([^/]*)$-) { - $parentpath = $1; - $lastitem = $2; - } else { - $lastitem = $thisdisfn; - } - $titleinfo = - &Apache::loncommon::help_open_menu('','',3,'Authoring') - .''.&mt('Construction Space').': ' - .'
' - .&Apache::lonhtmlcommon::crumbs($uname.'/'.$parentpath,'_top','/priv','','+1',1)."$lastitem
" - .&Apache::lonhtmlcommon::select_recent('construct','recent','this.form.action=this.form.recent.value;this.form.submit()') - .'
' - .&Apache::lonmenu::constspaceform(); - } + if (!$customtitle && $env{'request.state'} eq 'construct') { + $titleinfo = &CSTR_pageheader(); #FIXME: Will be removed once all scripts have their own calls + } my $titletable = '' ."".$roleinfo @@ -4802,13 +4841,21 @@ table#LC_mainmenu td.LC_mainmenu_column #LC_head_subbox { clear:both; background: $sidebg; - border-bottom: 1px solid #999999; + border-bottom: 1px solid $lg_border_color; height: 32px; line-height: 32px; - margin: 0 0 10px; + margin: 0; padding: 0; } +#LC_head_subbox2 { /* FIXME: replace by LC_head_subbox once lonhtmlcommon::breadcrumbs has been fixed */ + clear:both; + background: #F8F8F8; /* $sidebg; */ + border-bottom: 1px solid $lg_border_color; + margin: 0 0 10px 0; + padding: 5px; +} + .LC_fontsize_medium { font-size: 85%; }
$titleinfo $dc_info