--- loncom/interface/londocs.pm 2009/06/09 18:42:42 1.371 +++ loncom/interface/londocs.pm 2009/07/14 17:33:43 1.381 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.371 2009/06/09 18:42:42 tempelho Exp $ +# $Id: londocs.pm,v 1.381 2009/07/14 17:33:43 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -262,8 +262,9 @@ sub dumpcourse { sub exportbutton { my $type = &Apache::loncommon::course_type(); - return '<input type="submit" name="exportcourse" value="'. - &mt('Export '.$type.' to IMS').'" />'. + return '<input type="submit" name="exportcourse"' + .' value="'.&mt('IMS Export').'"' + .' title="'.&mt('Export '.$type.' to IMS Package').'" />'. &Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').'<br />'; } @@ -277,8 +278,8 @@ sub exportcourse { my $numdisc = keys(%discussiontime); my $navmap = Apache::lonnavmaps::navmap->new(); if (!defined($navmap)) { - $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package'). - '<h2>IMS Export Failed</h2>'. + $r->print(&Apache::loncommon::start_page('Export '.$type.' to IMS Package'). + '<h2>'.&mt('IMS Export Failed').'</h2>'. '<div class="LC_error">'. &mt('Unable to retrieve information about course contents'). '</div><a href="/adm/coursedocs">'.&mt('Return to Course Editor').'</a>'); @@ -298,7 +299,17 @@ sub exportcourse { my @exportitems = &Apache::loncommon::get_env_multiple('form.archive'); my @discussions = &Apache::loncommon::get_env_multiple('form.discussion'); if (@exportitems == 0 && @discussions == 0) { - $outcome = '<br />As you did not select any content items or discussions for export, an IMS package has not been created. Please <a href="javascript:history.go(-1)">go back</a> to select either content items or discussions for export'; + $outcome = + '<p class="LC_warning">' + .&mt('As you did not select any content items or discussions' + .' for export, an IMS package has not been created.') + .'</p>' + .'<p>' + .&mt('Please [_1]go back[_2] to select either content items' + .' or discussions for export.' + ,'<a href="javascript:history.go(-1)">' + ,'</a>') + .'</p>'; } else { my $now = time; my %symbs; @@ -321,22 +332,30 @@ sub exportcourse { open(OUTPUT, "zip -r $imszip * 2> /dev/null |"); close(OUTPUT); chdir $cwd; - $outcome .= '<p>' - .&mt('Download the zip file from [_1]IMS '.lc($type).' archive[_2]' - ,'<a href="'.$imszipfile.'">','</a>') - .'</p>'; if ($copyresult) { $outcome .= '<p class="LC_error">' .&mt('The following errors occurred during export - [_1]' ,$copyresult) .'</p>'; } + $outcome .= '<p>' + .&mt('[_1]Your IMS package[_2] is ready for download.' + ,'<a href="'.$imszipfile.'">','</a>') + .'</p>'; } else { - $outcome = '<br />'.&mt('Unfortunately you will not be able to retrieve an IMS archive of this posts at this time, because there was a problem creating a manifest file.').'<br />'; + $outcome = '<p class="LC_error">' + .&mt('Unfortunately you will not be able to retrieve' + .' an IMS archive of this posts at this time,' + .' because there was a problem creating a' + .' manifest file.') + .'</p>' + .'<p><a href="javascript:history.go(-1)">' + .&mt('Go Back') + .'</a></p>'; } } - $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package')); - $r->print(&Apache::lonhtmlcommon::breadcrumbs('Export '.lc($type).' to IMS content package')); + $r->print(&Apache::loncommon::start_page('Export '.$type.' to IMS Package')); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('IMS Export')); $r->print($outcome); $r->print(&Apache::loncommon::end_page()); } else { @@ -489,13 +508,13 @@ function containerCheck(item) { // ]]> </script> |; - $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package', + $r->print(&Apache::loncommon::start_page('Export '.$type.' to IMS Package', $scripttag)); - $r->print(&Apache::lonhtmlcommon::breadcrumbs('Export '.lc($type).' to IMS content package')); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('IMS Export')); $r->print($display. '<p><input type="hidden" name="finishexport" value="1" />'. '<input type="submit" name="exportcourse" value="'. - &mt('Export '.$type.' DOCS').'" /></p></form>'); + &mt('Export').'" /></p></form>'); } } @@ -1030,7 +1049,7 @@ sub breadcrumbs { } $plain=~s/\>\;\s*$//; return (&Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'nohelp', - 'LC_docs_path', undef, 1 ),$randompick,$ishidden,$isencrypted,$plain,$is_random_order); + undef, undef, 1 ),$randompick,$ishidden,$isencrypted,$plain,$is_random_order); } sub log_docs { @@ -1254,10 +1273,11 @@ sub print_paste_buffer { my ($r,$container) = @_; return if (!defined($env{'docs.markedcopy_url'})); - $r->print(<<ENDPASTE); -<form name="pasteform" action="/adm/coursedocs" method="post"><p> -ENDPASTE - $r->print('<input type="submit" name="pastemarked" value="'.&mt('Paste').'" /> '); + $r->print('<fieldset>' + .'<legend>'.&mt('Clipboard').'</legend>' + .'<form name="pasteform" action="/adm/coursedocs" method="post">' + .'<input type="submit" name="pastemarked" value="'.&mt('Paste').'" /> ' + ); my $type; if ($env{'docs.markedcopy_url'} =~ m{^(?:/adm/wrapper/ext|(?:http|https)(?::|:))//} ) { @@ -1271,7 +1291,7 @@ ENDPASTE if ($extension eq 'sequence' && $env{'docs.markedcopy_url'} =~ m{/default_\d+\.sequence$ }x) { $icon = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL')); - $icon .= '/folder_closed.gif'; + $icon .= '/navmap.folder.closed.gif'; } $icon = '<img src="'.$icon.'" alt="" class="LC_icon" />'; $r->print($icon.$type.': '. &parse_supplemental_title(&LONCAPA::map::qtescape($env{'docs.markedcopy_title'}))); @@ -1286,7 +1306,7 @@ ENDPASTE <input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" /> '); } - $r->print('</p></form>'); + $r->print('</form></fieldset>'); } sub do_paste_from_buffer { @@ -1569,34 +1589,66 @@ sub editor { my $idx=0; my $shown=0; if (($ishidden) || ($isencrypted) || ($randompick>=0) || ($is_random_order)) { - $r->print('<p>'.&mt('Parameters').':<ul>'. - ($randompick>=0?'<li>'.&mt('randomly pick [_1] resources',$randompick).'</li>':''). + $r->print('<div class="LC_Box">'. + '<p>'.&mt('Parameters:'). + '<ul>'. + ($randompick>=0?'<li>'.&mt('randomly pick [quant,_1,resource]',$randompick).'</li>':''). ($ishidden?'<li>'.&mt('contents hidden').'</li>':''). ($isencrypted?'<li>'.&mt('URLs hidden').'</li>':''). + ($is_random_order?'<li>'.&mt('random order').'</li>':''). '</ul></p>'); + if ($randompick>=0) { + $r->print('<p class="LC_warning">' + .&mt('Caution: this folder is set to randomly pick a subset' + .' of resources. Adding or removing resources from this' + .' folder will change the set of resources that the' + .' students see, resulting in spurious or missing credit' + .' for completed problems, not limited to ones you' + .' modify. Do not modify the contents of this folder if' + .' it is in active student use.') + .'</p>' + ); + } + if ($is_random_order) { + $r->print('<p class="LC_warning">' + .&mt('Caution: this folder is set to randomly order its' + .' contents. Adding or removing resources from this folder' + .' will change the order of resources shown.') + .'</p>' + ); + } + $r->print('</div>'); } - if ($randompick>=0) { - $r->print('<p>'.&mt('Caution: this folder is set to randomly pick a subset of resources. Adding or removing resources from this folder will change the set of resources that the students see, resulting in spurious or missing credit for completed problems, not limited to ones you modify. Do not modify the contents of this folder if it is in active student use.').'</p>'); - } - if ($is_random_order) { - $r->print('<p>'.&mt('Caution: this folder is set to randomly order its contents. Adding or removing resources from this folder will change the order of resources shown.').'</p>'); - } - $r->print('<table class="LC_docs_editor">'); + + my $output; foreach my $res (@LONCAPA::map::order) { - my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$res]); - $name=&LONCAPA::map::qtescape($name); - $url=&LONCAPA::map::qtescape($url); - unless ($name) { $name=(split(/\//,$url))[-1]; } - unless ($name) { $idx++; next; } - $r->print(&entryline($idx,$name,$url,$folder,$allowed,$res, - $coursenum)); - $idx++; - $shown++; + my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$res]); + $name=&LONCAPA::map::qtescape($name); + $url=&LONCAPA::map::qtescape($url); + unless ($name) { $name=(split(/\//,$url))[-1]; } + unless ($name) { $idx++; next; } + $output .= &entryline($idx,$name,$url,$folder,$allowed,$res, + $coursenum); + $idx++; + $shown++; } - unless ($shown) { - $r->print('<tr><td>'.&mt('Currently no documents.').'</td></tr>'); + if ($shown) { + $r->print(&Apache::loncommon::start_data_table() + .&Apache::loncommon::start_data_table_header_row() + .'<th colspan="2">'.&mt('Move').'</th>' + .'<th>'.&mt('Actions').'</th>' + .'<th colspan="2">'.&mt('Document').'</th>' + .'<th colspan="4">'.&mt('Settings').'</th>' + .&Apache::loncommon::end_data_table_header_row() + .$output + .&Apache::loncommon::end_data_table() + ) + } else { + $r->print('<p class="LC_info">' + .&mt('Currently no documents.') + .'</p>' + ); } - $r->print("\n</table>\n"); if ($allowed) { &print_paste_buffer($r,$container); } @@ -1759,7 +1811,7 @@ sub entryline { $renametitle=~s/\\/\\\\/g; $renametitle=~s/\"\;/\\\"/g; $renametitle=~s/ /%20/g; - my $line='<tr>'; + my $line=&Apache::loncommon::start_data_table_row(); my ($form_start,$form_end); # Edit commands my ($container, $type, $esc_path, $path, $symb); @@ -1790,7 +1842,7 @@ sub entryline { ne '')) { $selectbox= '<input type="hidden" name="currentpos" value="'.$incindex.'" />'. - '<select name="newpos" onChange="this.form.submit()">'; + '<select name="newpos" onchange="this.form.submit()">'; for (my $i=1;$i<=$#LONCAPA::map::order+1;$i++) { if ($i==$incindex) { $selectbox.='<option value="" selected="selected">('.$i.')</option>'; @@ -1862,18 +1914,16 @@ END $form_end = '</form>'; $line.=(<<END); <td> - <table class="LC_docs_entry_move"> - <tr> - <td> - <a href='/adm/coursedocs?cmd=up_$index&${type}path=$esc_path&${type}symb=$symb$cpinfo'><img src="${iconpath}move_up.gif" alt='$lt{'up'}' class="LC_icon" /></a> - </td> - </tr> - <tr> - <td> - <a href='/adm/coursedocs?cmd=down_$index&${type}path=$esc_path&${type}symb=$symb$cpinfo'><img src="${iconpath}move_down.gif" alt='$lt{'dw'}' class="LC_icon" /></a> - </td> - </tr> - </table> +<div class="LC_docs_entry_move"> + <a href='/adm/coursedocs?cmd=up_$index&${type}path=$esc_path&${type}symb=$symb$cpinfo'> + <img src="${iconpath}move_up.gif" alt='$lt{'up'}' class="LC_icon" /> + </a> +</div> +<div class="LC_docs_entry_move"> + <a href='/adm/coursedocs?cmd=down_$index&${type}path=$esc_path&${type}symb=$symb$cpinfo'> + <img src="${iconpath}move_down.gif" alt='$lt{'dw'}' class="LC_icon" /> + </a> +</div> </td> <td> $form_start @@ -1900,7 +1950,7 @@ END my $pagefile; if ($uploaded) { if ($extension eq 'sequence') { - $icon=$iconpath.'/folder_closed.gif'; + $icon=$iconpath.'/navmap.folder.closed.gif'; $url=~/\Q$coursenum\E\/([\/\w]+)\.sequence$/; $url='/adm/coursedocs?'; $folderarg=$1; @@ -1972,7 +2022,7 @@ END 'parameter_randomorder'))[0]=~/^yes$/i); $url.='folderpath='.&escape($folderpath).$cpinfo; $parameterset='<label>'.&mt('Randomly Pick: '). - '<input type="text" size="4" onChange="this.form.changeparms.value='."'randompick'".';this.form.submit()" name="randompick_'.$orderidx.'" value="'. + '<input type="text" size="4" onchange="this.form.changeparms.value='."'randompick'".';this.form.submit()" name="randompick_'.$orderidx.'" value="'. (&LONCAPA::map::getparameter($orderidx, 'parameter_randompick'))[0]. '" />'. @@ -2007,10 +2057,10 @@ END undef($external); } $line.=' - <td class="LC_docs_entry_icon"> + <td> '.($url?'<a href="'.$url.'">':'').'<img src="'.$icon.'" alt="" class="LC_icon" />'.($url?'</a>':'').' </td> - <td class="LC_docs_entry_title"> + <td> '.($url?"<a href=\"$url\">":'').$title.($url?'</a>':' <span class="LC_docs_reinit_warn">'.&mt('(re-initialize course to access)').'</span>').$external." </td>"; if (($allowed) && ($folder!~/^supplemental/)) { @@ -2036,7 +2086,7 @@ END <td class="LC_docs_entry_parameter">$form_start $parameterset $form_end</td> ENDPARMS } - $line.="</tr>"; + $line.=&Apache::loncommon::end_data_table_row(); return $line; } @@ -2502,18 +2552,18 @@ sub changewarning { $message='Changes will become active for your current session after [_1], or the next time you log in.'; } $r->print("\n\n". -'<script type="text/javascript">'. -'// <![CDATA['. -'function reinit(tf) { tf.submit();'.$postexec.' }'. -'// ]]>'. +'<script type="text/javascript">'."\n". +'// <![CDATA['."\n". +'function reinit(tf) { tf.submit();'.$postexec.' }'."\n". +'// ]]>'."\n". '</script>'."\n". '<form name="reinitform" method="post" action="/adm/roles" target="loncapaclient">'. '<input type="hidden" name="orgurl" value="'.$url. -'" /><input type="hidden" name="selectrole" value="1" /><h3><span class="LC_warning">'. +'" /><input type="hidden" name="selectrole" value="1" /><p class="LC_warning">'. &mt($message,' <input type="hidden" name="'. $env{'request.role'}.'" value="1" /><input type="button" value="'. &mt('re-initializing '.$course_type).'" onclick="reinit(this.form)" />'). -$help{'Caching'}.'</span></h3></form>'."\n\n"); +$help{'Caching'}.'</p></form>'."\n\n"); } @@ -2583,7 +2633,7 @@ sub handler { &init_breadcrumbs('dumpcourse','Dump '.&Apache::loncommon::course_type().' DOCS to Construction Space'); &dumpcourse($r); } elsif ($allowed && $env{'form.exportcourse'}) { - &init_breadcrumbs('exportcourse','Export '.&Apache::loncommon::course_type().' to IMS'); + &init_breadcrumbs('exportcourse','IMS Export'); &exportcourse($r); } else { # is this a standard course? @@ -2670,10 +2720,10 @@ sub handler { } # -------------------------------------------------------------------- Body tag $script = '<script type="text/javascript">'."\n" - .'// <![CDATA[' - .$script - .'// ]]>' - ."\n".'</script>'; + .'// <![CDATA['."\n" + .$script."\n" + .'// ]]>'."\n" + .'</script>'."\n"; my $brcrum = [{href=>"/adm/createuser",text=>"$type Documents"}]; $r->print(&Apache::loncommon::start_page("$type Documents", $script, {'force_register' => $showdoc, @@ -2773,7 +2823,6 @@ sub handler { 'uplm' => 'Upload a new main '.lc($type).' document', 'upls' => 'Upload a new supplemental '.lc($type).' document', 'impp' => 'Import a document', - 'pubd' => 'Published Documents', 'copm' => 'All documents out of a published map into this folder', 'upld' => 'Upload Document', 'srch' => 'Search', @@ -2796,7 +2845,8 @@ sub handler { 'grpo' => 'Group Portfolio', 'rost' => 'Course Roster', 'abou' => 'Personal Information Page for a User', - 'imsf' => 'Import IMS package', + 'imsf' => 'IMS Import', + 'imsl' => 'Import IMS package', 'file' => 'File', 'title' => 'Title', 'comment' => 'Comment', @@ -2805,7 +2855,6 @@ sub handler { 'pm' => 'Published Map', 'sd' => 'Special Document', 'mo' => 'More Options', - 'hao' => 'Hide all Options' ); # ----------------------------------------------------------------------------- my $fileupload=(<<FIUP); @@ -2847,7 +2896,6 @@ FUFORM my $simpleeditdefaultform=(<<SEDFFORM); <form action="/adm/coursedocs" method="post" name="simpleeditdefault"> <input type="hidden" name="active" value="bb" /> - $lt{'pubd'}<br /> $uploadtag <input type="button" onclick="javascript:groupsearch()" value="$lt{'srch'}" /> <br /> @@ -2919,21 +2967,23 @@ HIDDENFORM my $activeClass = 1; my $active = ''; $r->print('<ul class="LC_TabContentBigger" id="mainnav">'); - if (($standard) && ($allowed) && (!$forcesupplement) && (($env{'form.folderpath'}=~/^default/) || ($env{'form.pagepath'}))) { + if (($standard) && ($allowed) && (!$forcesupplement) && (($env{'form.folderpath'}=~/^default/) || $env{'form.folderpath'}eq"" || ($env{'form.pagepath'}))) { if($activeClass == 1){ $active = 'class="active"'; $activeClass = 0; } } - $r->print('<li '.$active.'onclick="javascript:showPage(this,\'mainCourseDocuments\',\'mainnav\',\'maincoursedoc\');">'.&mt('Main Course Documents').'</li>'); + $r->print('<li '.$active.' onclick="javascript:showPage(this,\'mainCourseDocuments\',\'mainnav\',\'maincoursedoc\');">'.&mt('Main Course Documents').'</li>'); $active = ''; if (!$forcestandard || ($env{'form.folderpath'}=~/^supplemental/)) { if($activeClass == 1){ $active = 'class="active"'; } } - $r->print('<li '.$active.'onclick="javascript:showPage(this,\'Supplemental Course Documents\',\'mainnav\',\'maincoursedoc\');">'.&mt('Supplemental Course Documents').'</li>'); - $r->print('</ul><div class="LC_Box" style="margin:0 0;padding:0 0;"><div id="maincoursedoc" style="margin:0 0;padding:0 0;">'); + $r->print('<li '.$active.' onclick="javascript:showPage(this,\'supplCourseDocuments\',\'mainnav\',\'maincoursedoc\');">'.&mt('Supplemental Course Documents').'</li>'); + $r->print('</ul>' + .'<div class="LC_Box" style="clear:both;margin:0;">' + .'<div id="maincoursedoc" style="margin:0 0;padding:0 0;">'); # --------------------------------------------------------- Standard documents my $savefolderpath; my $active = 'style="display: none;"'; @@ -2951,11 +3001,11 @@ HIDDENFORM } my $postexec=''; if ($folder eq 'default') { - $r->print('<script type="text/javascript">' - .'// <![CDATA[' - .'this.window.name="loncapaclient";' - .'// ]]>' - .'</script>' + $r->print('<script type="text/javascript">'."\n" + .'// <![CDATA['."\n" + .'this.window.name="loncapaclient";'."\n" + .'// ]]>'."\n" + .'</script>'."\n" ); } else { #$postexec='self.close();'; @@ -2981,7 +3031,7 @@ RFORM my $imspform=(<<IMSPFORM); <form action="/adm/imsimportdocs" method="post" name="ims"> <input type="hidden" name="folder" value="$folder" /> - <input name="imsimport" type="button" value="$lt{'imsf'}" onclick="javascript:makeims();" /> + <input name="imsimport" type="button" value="$lt{'imsf'}" title="$lt{imsl}" onclick="javascript:makeims();" /> </form> IMSPFORM @@ -3170,10 +3220,10 @@ if($env{'form.pagepath'}) { my %orderhash = ( 'aa' => ['Upload Document',$fileuploadform.'<br />'.$newfolderform], - 'bb' => ['Published Documents',$simpleeditdefaultform], + 'bb' => ['Published Resources',$simpleeditdefaultform], 'cc' => ['Special Documents',$specialdocumentsform], 'dd' => ['Tools',$extresourcesform.'<br />'.$imspform.'<br />'.$recoverform.'<br />'.&generate_admin_options($containertag,$uploadtag,\%help,\%env)], - 'zz' => ['Hide all Options'], + 'zz' => ['Hide'], ); my $tid='1'; my $varcd = 'Main Course Documents'; @@ -3198,7 +3248,7 @@ $r->print('</div>'); if($activeClass == 1){ $active = 'style="display: block;"'; } - $r->print('<div class="LC_ContentBox" id="Supplemental Course Documents" '.$active.'>'); + $r->print('<div class="LC_ContentBox" id="supplCourseDocuments" '.$active.'>'); my $folder=$env{'form.folder'}; unless ($folder=~/^supplemental/) { $folder='supplemental'; @@ -3299,7 +3349,7 @@ SNAMFORM my %suporderhash = ( 'ee' => ['Upload Document',$supupdocform.'<br />'.$supnewfolderform], 'ff' => ['Special Documents',$supnewextform.'<br />'.$supnewsylform.'<br />'.$supnewaboutmeform], - 'zz' => ['Hide all Options'], + 'zz' => ['Hide'], ); my $tid='2'; @@ -3377,18 +3427,18 @@ sub generate_edit_table { foreach my $name (sort(keys(%orderhash))){ if($name eq 'zz'){ if($activetab ne ''){ - $active = ''; + $active = 'class="right"'; }else{ - $active = 'class="active"'; + $active = 'class="right active"'; } - $form .= '<span class="LC_Right"><li onclick="javascript:hideAll(this, \'navigation'.$tid.'\' ,\'content'.$tid.'\');" '.$active.'>'.&mt(${$orderhash{$name}}[0]).'</li></span>'; + $form .= '<li onclick="javascript:hideAll(this, \'navigation'.$tid.'\' ,\'content'.$tid.'\');" '.$active.'>'.&mt(${$orderhash{$name}}[0]).'</li>'; }else{ if($activetab eq '' || $activetab ne $name){ $active = ''; }elsif($activetab eq $name){ $active = 'class="active"'; } - $form .= '<li '.$active.' onclick="javascript:showPage(this, \''.substr(${$orderhash{$name}}[0],0,3).$tid.'\', \'navigation'.$tid.'\',\'content'.$tid.'\');">'.&mt(${$orderhash{$name}}[0]).'</li>'; + $form .= '<li '.$active.' onclick="javascript:showPage(this, \''.$name.$tid.'\', \'navigation'.$tid.'\',\'content'.$tid.'\');">'.&mt(${$orderhash{$name}}[0]).'</li>'; } } $form .= '</ul>'; @@ -3400,7 +3450,9 @@ sub generate_edit_table { }elsif($activetab eq $field){ $active = 'style="display:block;"'; } - $form .= '<div id="'.substr(${$orderhash{$field}}[0],0,3).$tid.'" class="LC_ContentBox" '.$active.'">'.${$orderhash{$field}}[1].'</div>'; + $form .= '<div id="'.$field.$tid.'"' + .' class="LC_ContentBox" '.$active.'>'.${$orderhash{$field}}[1] + .'</div>'; } } $form .= '</div></div>'; @@ -3613,13 +3665,21 @@ function unselectInactive(nav) { currentNav = document.getElementById(nav); currentLis = currentNav.getElementsByTagName('LI'); for (i = 0; i < currentLis.length; i++) { - currentLis[i].className = 'i'; + if(currentLis[i].className == 'right active' || currentLis[i].className == 'right'){ + currentLis[i].className = 'right'; + }else{ + currentLis[i].className = 'i'; + } } } function hideAll(current, nav, data) { unselectInactive(nav); -current.className = 'active'; +if(current.className == 'right'){ + current.className = 'right active' + }else{ + current.className = 'active'; +} currentData = document.getElementById(data); currentDivs = currentData.getElementsByTagName('DIV'); for (i = 0; i < currentDivs.length; i++) { @@ -3629,8 +3689,25 @@ for (i = 0; i < currentDivs.length; i++) } } +function openTabs(pageId) { + tabnav = document.getElementById(pageId).getElementsByTagName('UL'); + if(tabnav.length > 0 ){ + currentNav = document.getElementById(tabnav[0].id); + currentLis = currentNav.getElementsByTagName('LI'); + for(i = 0; i< currentLis.length; i++){ + if(currentLis[i].className == 'active') { + funcString = currentLis[i].onclick.toString(); + tab = funcString.split('"'); + currentData = document.getElementById(tab[1]); + currentData.style.display = 'block'; + } + } + } +} + function showPage(current, pageId, nav, data) { hideAll(current, nav, data); + openTabs(pageId); unselectInactive(nav); current.className = 'active'; currentData = document.getElementById(pageId);