[LON-CAPA-cvs] cvs: loncom /interface londocs.pm

tempelho tempelho@source.lon-capa.org
Thu, 13 Aug 2009 12:29:04 -0000


This is a MIME encoded message

--tempelho1250166544
Content-Type: text/plain

tempelho		Thu Aug 13 12:29:04 2009 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
   + Replaced "Edit Course" buttons by text links. "Edit Course" buttons will get the same look as "Manage Course Users" (submenu links).
   + pic01 .. pic33 are wildcards and will be replaced by images for a better look.
   + Subroutine create_list_elements and create_form_ul were created to get the list structure for the form buttons.
   + Javascript function injectData was created to get hidden field values on demand into a form, using a hyperlink instead of a button.
   + Bug in Supplemental Docs was fixed, that didn't show any Supplemental Docs for the students.
  
  
--tempelho1250166544
Content-Type: text/plain
Content-Disposition: attachment; filename="tempelho-20090813122904.txt"

Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.382 loncom/interface/londocs.pm:1.383
--- loncom/interface/londocs.pm:1.382	Mon Jul 27 20:35:40 2009
+++ loncom/interface/londocs.pm	Thu Aug 13 12:29:04 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.382 2009/07/27 20:35:40 tempelho Exp $
+# $Id: londocs.pm,v 1.383 2009/08/13 12:29:04 tempelho Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -35,6 +35,7 @@
 use Apache::imsexport;
 use Apache::lonnet;
 use Apache::loncommon;
+use Apache::lonhtmlcommon;
 use LONCAPA::map();
 use Apache::lonratedt();
 use Apache::lonxml;
@@ -119,8 +120,8 @@
     my $type = &Apache::loncommon::course_type();
     if ($home+$other==0) { return ''; }
     if ($home) {
-	return '<input type="submit" name="dumpcourse" value="'.
-	    &mt('Dump '.$type.' DOCS to Construction Space').'" />'.
+	my $link = "<a onclick='javascript:injectData(document.courseverify, \"dummy\", \"dumpcourse\", \"".&mt('Dump '.$type.' DOCS to Construction Space')."\")'>".&mt('Dump '.$type.' DOCS to Construction Space')."</a>";
+	return $link.' '.
 	    &Apache::loncommon::help_open_topic('Docs_Dump_Course_Docs').'<br />';
     } else {
 	return '<div>'.
@@ -262,9 +263,7 @@
 
 sub exportbutton {
     my $type = &Apache::loncommon::course_type();
-    return '<input type="submit" name="exportcourse"'
-          .' value="'.&mt('IMS Export').'"'
-          .' title="'.&mt('Export '.$type.' to IMS Package').'" />'.
+    return "<a onclick='javascript:injectData(document.courseverify, \"dummy\", \"exportcourse\", \"".&mt('IMS Export')."\")'>".&mt('IMS Export')."</a>".
     &Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').'<br />';
 }
 
@@ -1643,7 +1642,8 @@
              .$output
              .&Apache::loncommon::end_data_table()
     )
-    } else {
+    } 
+    unless($shown) {
         $r->print('<p class="LC_info">'
                  .&mt('Currently no documents.')
                  .'</p>'
@@ -2702,6 +2702,26 @@
        $allowed=0;
     }
 
+# subroutine to list form elements
+sub create_list_elements {
+   my @formarr = @_; 
+   my $list = '';
+   for my $button (@formarr){
+	for my $picture(keys %$button) {
+		#my $link = Apache::lonhtmlcommon::htmltag('a' ,$button->{$picture}, {href => "test"}); 
+		$list .= Apache::lonhtmlcommon::htmltag('li', $picture.' '.$button->{$picture}, {class => 'LC_menubuttons_inline_text'});	
+	}
+   }
+   return $list;
+}
+
+# subroutine to create ul from list elements
+sub create_form_ul {
+   my $list = shift;
+   my $ul = Apache::lonhtmlcommon::htmltag('ul',$list, {class => 'LC_ListStyleNormal'});
+   return $ul;
+}
+
 # get course data
     my $coursenum=$env{'course.'.$env{'request.course.id'}.'.num'};
     my $coursedom=$env{'course.'.$env{'request.course.id'}.'.domain'};
@@ -2871,6 +2891,9 @@
 	</label>
 CHBO
 
+        my @fileuploada = (
+        { pic01 => "<a onclick='document.uploaddocument.submit()'>$lt{'upld'}</a> $help{'Uploading_From_Harddrive'}" },
+        );
 	my $fileuploadform=(<<FUFORM);
 	<form name="uploaddocument" action="/adm/coursedocs" method="post" enctype="multipart/form-data">
 	<input type="hidden" name="active" value="aa" />
@@ -2884,27 +2907,23 @@
 	<span class="LC_nobreak">
 	$checkbox
 	</span>
-	<br />
-	<br />
-	<span class="LC_nobreak">
-	<input type="submit" value="$lt{'upld'}" />
-	 $help{'Uploading_From_Harddrive'}
-	</span>
+FUFORM
+	$fileuploadform .= create_form_ul(create_list_elements(@fileuploada));
+	$fileuploadform .= (<<FUFORM);
 	</form>
 FUFORM
 
 	my $simpleeditdefaultform=(<<SEDFFORM);
 	<form action="/adm/coursedocs" method="post" name="simpleeditdefault">
 	<input type="hidden" name="active" value="bb" />
-	$uploadtag
-	<input type="button" onclick="javascript:groupsearch()" value="$lt{'srch'}" />
-	<br />
-	<span class="LC_nobreak">
-	<input type="button" onclick="javascript:groupimport();" value="$lt{'impo'}" />
-	$help{'Importing_LON-CAPA_Resource'}
-	</span>
-	<br />
-	<input type="button" onclick="javascript:groupopen(0,1,1);" value="$lt{'book'}" />
+SEDFFORM
+	my @simpleeditdefaultforma = ( 
+	{ pic03 => "$uploadtag<a onclick='javascript:groupsearch()'>$lt{'srch'}</a>" },
+	{ pic04 => "<a onclick='javascript:groupimport();'>$lt{'impo'}</a>$help{'Importing_LON-CAPA_Resource'}" },
+	{ pic05 => "<a onclick='javascript:groupopen(0,1,1);'>$lt{'book'}</a>" },
+	);
+	$simpleeditdefaultform .= create_form_ul(create_list_elements(@simpleeditdefaultforma));
+	$simpleeditdefaultform .=(<<SEDFFORM);
 	<hr />
 	<p>
 	$lt{'copm'}<br />
@@ -2921,10 +2940,7 @@
 	<form action="/adm/coursedocs" method="post" name="newext">
 	$uploadtag
 	<input type="hidden" name="importdetail" value="" />
-	<span class="LC_nobreak">
-	<input name="newext" type="button" onclick="javascript:makenewext('newext');"
-	value="$lt{'extr'}" /> $help{'Adding_External_Resource'}
-	</span>
+	<a onclick="javascript:makenewext('newext');">$lt{'extr'}</a>$help{'Adding_External_Resource'}
 	</form>
 ERFORM
 
@@ -2964,8 +2980,10 @@
 HIDDENFORM
     }
 # --------------------------------------------------------- Main tab structure
+    
     my $activeClass = 1;
     my $active = '';
+
     $r->print('<ul class="LC_TabContentBigger" id="mainnav">');
     if (($standard) && ($allowed) && (!$forcesupplement) && (($env{'form.folderpath'}=~/^default/) || $env{'form.folderpath'}eq"" || ($env{'form.pagepath'}))) {
         if($activeClass == 1){
@@ -2973,7 +2991,9 @@
 	   $activeClass = 0;
 	}
     }
+    if($env{'request.role'}=~/^cc/){
     $r->print('<li '.$active.' onclick="javascript:showPage(this,\'mainCourseDocuments\',\'mainnav\',\'maincoursedoc\');"><a href="#"><b>'.&mt('Main Course Documents').'</b></a></li>');
+    }
     $active = '';
     if (!$forcestandard || ($env{'form.folderpath'}=~/^supplemental/)) {
         if($activeClass == 1){
@@ -2990,6 +3010,7 @@
        if($activeClass == 0){
           $active = 'style="display: block;"';
        }
+       if($env{'request.role'}=~/^cc/){
        $r->print('<div class="LC_ContentBox" id="mainCourseDocuments" '.$active.'>');
        my $folder=$env{'form.folder'};
        if ($folder eq '' || $folder=~/^supplemental/) {
@@ -3024,14 +3045,14 @@
 
 	my $recoverform=(<<RFORM);
 	<form action="/adm/groupsort" method="post" name="recover">
-	<input type="button" name="recovermap" onclick="javascript:groupopen('$readfile',1,0)" value="$lt{'reco'}" />
+	<a onclick="javascript:groupopen('$readfile',1,0)">$lt{'reco'}</a>
 	</form>
 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'}" title="$lt{imsl}"  onclick="javascript:makeims();" />
+	<a onclick="javascript:makeims();">$lt{'imsf'}</a>
 	</form>
 IMSPFORM
 
@@ -3041,10 +3062,8 @@
 	$uploadtag
 	<input type="hidden" name="importdetail" 
 	value="$lt{'navc'}=/adm/navmaps" />
-	<span class="LC_nobreak">
-	<input name="newnav" type="submit" value="$lt{'navc'}" />
+	<a onclick="document.newnav.submit()">$lt{'navc'}</a>
 	$help{'Navigate_Content'}
-	</span>
 	</form>
 NNFORM
 	my $newsmppageform=(<<NSPFORM);
@@ -3052,10 +3071,8 @@
 	<input type="hidden" name="active" value="cc" />
 	$uploadtag
 	<input type="hidden" name="importdetail" value="" />
-	<span class="LC_nobreak">
-	<input name="newsmppg" type="button" value="$lt{'sipa'}"
-	onclick="javascript:makesmppage();" /> $help{'Simple Page'}
-	</span>
+	<a onclick="javascript:makesmppage();"> $lt{'sipa'}</a>
+	$help{'Simple Page'}
 	</form>
 NSPFORM
 
@@ -3064,10 +3081,8 @@
 	<input type="hidden" name="active" value="cc" />
 	$uploadtag
 	<input type="hidden" name="importdetail" value="" />
-	<span class="LC_nobreak">
-	<input name="newsmpproblem" type="button" value="$lt{'sipr'}"
-	onclick="javascript:makesmpproblem();" />$help{'Simple Problem'}
-	</span>
+	<a onclick="javascript:makesmpproblem();">$lt{'sipr'}</a>
+	$help{'Simple Problem'}
 	</form>
 
 NSPROBFORM
@@ -3077,10 +3092,7 @@
 	<input type="hidden" name="active" value="cc" />
 	$uploadtag
 	<input type="hidden" name="importdetail" value="" />
-	<span class="LC_nobreak">
-	<input name="newdropbox" type="button" value="$lt{'drbx'}"
-	onclick="javascript:makedropbox();" />
-	</span>
+	<a onclick="javascript:makedropbox();">$lt{'drbx'}</a>
 	</form>
 NDBFORM
 
@@ -3089,11 +3101,8 @@
 	<input type="hidden" name="active" value="cc" />
 	$uploadtag
 	<input type="hidden" name="importdetail" value="" />
-	<span class="LC_nobreak">
-	<input name="newexamupload" type="button" value="$lt{'scuf'}"
-	onclick="javascript:makeexamupload();" />
+	<a onclick="javascript:makeexamupload();">$lt{'scuf'}</a>
 	$help{'Score_Upload_Form'}
-	</span>
 	</form>
 NEXUFORM
 
@@ -3102,11 +3111,8 @@
 	<input type="hidden" name="active" value="cc" />
 	$uploadtag
 	<input type="hidden" name="importdetail" value="" />
-	<span class="LC_nobreak">
-	<input name="newbulletin" type="button" value="$lt{'bull'}"
-	onclick="javascript:makebulboard();" />
+	<a onclick="javascript:makebulboard();" >$lt{'bull'}</a>
 	$help{'Bulletin Board'}
-	</span>
 	</form>
 NBFORM
 
@@ -3116,10 +3122,8 @@
 	$uploadtag
 	<input type="hidden" name="importdetail" 
 	value="$plainname=/adm/$udom/$uname/aboutme" />
-	<span class="LC_nobreak">
-	<input name="newaboutme" type="submit" value="$lt{'mypi'}" />
+	<a onclick="document.newaboutme.submit()">$lt{'mypi'}</a>
 	$help{'My Personal Information Page'}
-	</span>
 	</form>
 NAMFORM
 
@@ -3128,10 +3132,7 @@
 	<input type="hidden" name="active" value="cc" />
 	$uploadtag
 	<input type="hidden" name="importdetail" value="" />
-	<span class="LC_nobreak">
-	<input name="newaboutsomeone" type="button" value="$lt{'abou'}" 
-	onclick="javascript:makeabout();" />
-	</span>
+	<a onclick="javascript:makeabout();">$lt{'abou'}</a>
 	</form>
 NASOFORM
 
@@ -3142,44 +3143,42 @@
 	$uploadtag
 	<input type="hidden" name="importdetail" 
 	value="$lt{'rost'}=/adm/viewclasslist" />
-	<span class="LC_nobreak">
-	<input name="newroster" type="submit" value="$lt{'rost'}" />
+	<a onclick="document.newroster.submit()">$lt{'rost'}</a>
 	$help{'Course Roster'}
-	</span>
 	</form>
 NROSTFORM
 
 my $specialdocumentsform;
+my @specialdocumentsforma;
 my $newfolderform;
 
        unless ($env{'form.pagepath'}) {
 	   my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
-
+	
 	my $newpageform=(<<NPFORM);
 	<form action="/adm/coursedocs" method="post" name="newpage">
 	<input type="hidden" name="folderpath" value="$path" />
 	<input type="hidden" name="importdetail" value="" />
 	<input type="hidden" name="active" value="cc" />
-	<span class="LC_nobreak">
-	<input name="newpage" type="button"
-	onclick="javascript:makenewpage(this.form,'$pageseq');"
-	value="$lt{'newp'}" />$help{'Adding_Pages'}
-	</span>
+	<a onclick="javascript:makenewpage(document.newpage,'$pageseq');">$lt{'newp'}</a>
+	$help{'Adding_Pages'}
 	</form>
 NPFORM
-
+	
 	$newfolderform=(<<NFFORM);
 	<form action="/adm/coursedocs" method="post" name="newfolder">
 	<input type="hidden" name="folderpath" value="$path" />
 	<input type="hidden" name="importdetail" value="" />
 	<input type="hidden" name="active" value="aa" />
-	<span class="LC_nobreak">
-	<input name="newfolder" type="button"
-	onclick="javascript:makenewfolder(this.form,'$folderseq');"
-	value="$lt{'newf'}" />$help{'Adding_Folders'}
-	</span>
+	<a onclick="javascript:makenewfolder(document.newfolder,'$folderseq');">$lt{'newf'}</a>$help{'Adding_Folders'}
 	</form>
 NFFORM
+	my @newfolderforma= (
+	{ pic02 => "$newfolderform" }
+        );
+
+
+	$newfolderform = create_form_ul(create_list_elements(@newfolderforma));
 
 	my $newsylform=(<<NSYLFORM);
 	<form action="/adm/coursedocs" method="post" name="newsyl">
@@ -3187,10 +3186,9 @@
 	$uploadtag
 	<input type="hidden" name="importdetail" 
 	value="$lt{'syll'}=/public/$coursedom/$coursenum/syllabus" />
-	<span class="LC_nobreak">
-	<input name="newsyl" type="submit" value="$lt{'syll'}" /> 
+	<a onclick="document.newsyl.submit()">$lt{'syll'}</a>
 	$help{'Syllabus'}
-	</span>
+
 	</form>
 NSYLFORM
 
@@ -3200,29 +3198,49 @@
 	$uploadtag
 	<input type="hidden" name="importdetail"
 	value="$lt{'grpo'}=/adm/$coursedom/$coursenum/aboutme" />
-	<span class="LC_nobreak">
-	<input name="newgroupfiles" type="submit" value="$lt{'grpo'}" />
+	<a onclick="document.newgroupfiles.submit()">$lt{'grpo'}</a>
 	$help{'Group Portfolio'}
-	</span>
 	</form>
 NGFFORM
-
-	$specialdocumentsform="<br />$newpageform<br />$newsylform<br />$newgroupfileform";
+	@specialdocumentsforma=(
+	{pic06=>$newpageform},
+	{pic07=>$newsylform},
+	{pic08=>$newgroupfileform},
+	); 
+	
       }
-	$specialdocumentsform.="<br />$newnavform<br />$newsmppageform
-				<br />$newsmpproblemform<br />$newdropboxform
-       				<br />$newexuploadform<br />$newbulform
-       				<br />$newaboutmeform<br />$newaboutsomeoneform
-       				<br />$newrosterform";
+	push @specialdocumentsforma, ({pic09=>$newnavform},
+	{pic10=>$newsmppageform},
+	{pic11=>$newsmpproblemform},
+	{pic12=>$newdropboxform},
+	{pic13=>$newexuploadform},
+	{pic14=>$newbulform},
+	{pic15=>$newaboutmeform},
+	{pic16=>$newaboutsomeoneform},
+	{pic17=>$newrosterform},);
+
+	$specialdocumentsform = create_form_ul(create_list_elements(@specialdocumentsforma));
+
 if($env{'form.pagepath'}) {
-	$specialdocumentsform="<br />$newsmpproblemform<br />$newexuploadform";
+	
+	@specialdocumentsforma=(
+	{pic32=>$newsmpproblemform},
+	{pic33=>$newexuploadform}
+	);
+	$specialdocumentsform= create_form_ul(create_list_elements(@specialdocumentsforma));
 }
 
+my @tools = (
+	{pic18=>$extresourcesform},
+	{pic19=>$imspform},
+	{pic20=>$recoverform},
+	);
+
 my %orderhash = (
-                'aa' => ['Upload Document',$fileuploadform.'<br />'.$newfolderform],
+                'aa' => ['Upload Document',$fileuploadform.''.$newfolderform],
                 'bb' => ['Published Resources',$simpleeditdefaultform],
                 'cc' => ['Special Documents',$specialdocumentsform],
-		'dd' => ['Tools',$extresourcesform.'<br />'.$imspform.'<br />'.$recoverform.'<br />'.&generate_admin_options($containertag,$uploadtag,\%help,\%env)],
+		'dd' => ['Tools', create_form_ul(create_list_elements(@tools)).&generate_admin_options($containertag,$uploadtag,\%help,\%env)],
                 'zz' => ['Hide'],
                 );
 my $tid='1';
@@ -3241,6 +3259,7 @@
  $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',
                      &mt('Editing the Table of Contents for your '.$type)));
 $r->print('</div>');
+	}
        if ($env{'form.pagepath'}) {
        }
 # ----------------------------------------------------- Supplemental documents
@@ -3268,8 +3287,11 @@
 
 	   my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
 
+	my @supupdocform = (
+		{pic27=>"<a onclick='document.supuploaddocument.submit()'>$lt{'upld'}</a>$help{'Uploading_From_Harddrive'}"},
+		);
 	my $supupdocform=(<<SUPDOCFORM);
-	<form action="/adm/coursedocs" method="post" enctype="multipart/form-data">
+	<form action="/adm/coursedocs" method="post" name="supuploaddocument" enctype="multipart/form-data">
 	<input type="hidden" name="active" value="ee" />	
 	$fileupload
 	<br />
@@ -3279,30 +3301,25 @@
 	</span>
 	<br /><br />
 	$lt{'comment'}:<br />
-	<textarea cols="50" rows="4" name="comment">
-	</textarea>
+	<textarea cols="50" rows="4" name="comment"></textarea>
 	<br />
 	<input type="hidden" name="folderpath" value="$path" />
 	<input type="hidden" name="cmd" value="upload_supplemental" />
-	<span class="LC_nobreak">
-	<input type="submit" value="$lt{'upld'}" />
-	 $help{'Uploading_From_Harddrive'}
-	</span>
-	</form>
 SUPDOCFORM
+	$supupdocform .=  create_form_ul(create_list_elements(@supupdocform))."</form>";
 
 	my $supnewfolderform=(<<SNFFORM);
 	<form action="/adm/coursedocs" method="post" name="supnewfolder">
 	<input type="hidden" name="active" value="ee" />
 	<input type="hidden" name="folderpath" value="$path" />
 	<input type="hidden" name="importdetail" value="" />
-	<span class="LC_nobreak">
-	<input name="newfolder" type="button"
-	onclick="javascript:makenewfolder(this.form,'$folderseq');"
-	value="$lt{'newf'}" /> $help{'Adding_Folders'}
-	</span>
+	<a onclick="javascript:makenewfolder(document.supnewfolder,'$folderseq');">$lt{'newf'}</a> 
+	$help{'Adding_Folders'}
 	</form>
 SNFFORM
+	
+	my @supnewfolderforma = ({pic28=>$supnewfolderform});
+	$supnewfolderform = create_form_ul(create_list_elements(@supnewfolderforma));
 
 
 	my $supnewextform=(<<SNEFORM);
@@ -3310,11 +3327,7 @@
 	<input type="hidden" name="active" value="ff" />
 	<input type="hidden" name="folderpath" value="$path" />
 	<input type="hidden" name="importdetail" value="" />
-	<span class="LC_nobreak">
-	<input name="newext" type="button" 
-	onclick="javascript:makenewext('supnewext');"
-	value="$lt{'extr'}" /> $help{'Adding_External_Resource'}
-	</span>
+	<a onclick="javascript:makenewext('supnewext');">$lt{'extr'}</a> $help{'Adding_External_Resource'}
 	</form>
 SNEFORM
 
@@ -3324,31 +3337,31 @@
 	<input type="hidden" name="folderpath" value="$path" />
 	<input type="hidden" name="importdetail" 
 	value="Syllabus=/public/$coursedom/$coursenum/syllabus" />
-	<span class="LC_nobreak">
-	<input name="newsyl" type="submit" value="$lt{'syll'}" />
+	<a onclick="document.supnewsyl.submit()">$lt{'syll'}</a>
 	$help{'Syllabus'}
-	</span>
 	</form>
 SNSFORM
 
 	my $supnewaboutmeform=(<<SNAMFORM);
-	<form action="/adm/coursedocs" method="post" name="subnewaboutme">
+	<form action="/adm/coursedocs" method="post" name="supnewaboutme">
 	<input type="hidden" name="active" value="ff" />
 	<input type="hidden" name="folderpath" value="$path" />
 	<input type="hidden" name="importdetail" 
 	value="$plainname=/adm/$udom/$uname/aboutme" />
-	<span class="LC_nobreak">
-	<input name="newaboutme" type="submit" value="$lt{'mypi'}" />
+	<a onclick="document.supnewaboutme.submit()">$lt{'mypi'}</a>
 	$help{'My Personal Information Page'}
-	</span>
 	</form>
 SNAMFORM
 
 
-
+my @specialdocs = (
+		{pic29=>$supnewextform},
+		{pic30=>$supnewsylform},
+		{pic31=>$supnewaboutmeform},
+		);
 my %suporderhash = (
-                'ee' => ['Upload Document',$supupdocform.'<br />'.$supnewfolderform],
-                'ff' => ['Special Documents',$supnewextform.'<br />'.$supnewsylform.'<br />'.$supnewaboutmeform],
+                'ee' => ['Upload Document',$supupdocform.' '.$supnewfolderform],
+                'ff' => ['Special Documents',create_form_ul(create_list_elements(@specialdocs))],
                 'zz' => ['Hide'],
                 );
 
@@ -3356,13 +3369,16 @@
 my $varscd = 'Supplemental Course Documents';
 
 $r->print(&generate_edit_table($tid,$varscd,\%suporderhash));
+}
+
 my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
        if ($error) {
            $r->print('<p><span class="LC_error">'.$error.'</span></p>');
-       }
-$r->print('</div>');
-	}
+        }
 $r->print('</div>');
+$r->print('</div></div>');
+
+
     if ($allowed) {
 	$r->print('
 <form method="post" name="extimport" action="/adm/coursedocs">
@@ -3398,17 +3414,18 @@
   my %env = %{$env_ref};
   my $dumpbut=&dumpbutton();
   my $exportbut=&exportbutton();
-  return (<<ENDOPTIONFORM);
- <form action="/adm/coursedocs" method="post" name="courseverify">
-           <input type="submit" name="verify" value="$lt{'vc'}" />$help{'Verify_Content'}<br />
-           <input type="submit" name="versions" value="$lt{'cv'}" />$help{'Check_Resource_Versions'}<br />
-           $dumpbut
-           $exportbut
-          <input type="submit" name="listsymbs" value="$lt{'ls'}" />
-          <input type="hidden" name="folder" value="$env{'form.folder'}" /><br />
-          <input type="submit" name="docslog" value="$lt{'sl'}" />
- </form>
-ENDOPTIONFORM
+  my @list = (
+	{pic21=>"<a onclick='javascript:injectData(document.courseverify, \"dummy\", \"verify\", \"$lt{'vc'}\")'>$lt{'vc'}</a>$help{'Verify_Content'}"},
+	{pic22=>"<a onclick='javascript:injectData(document.courseverify, \"dummy\", \"versions\", \"$lt{'cv'}\")'>$lt{'cv'}</a>$help{'Check_Resource_Versions'}"},
+	);
+  if($dumpbut ne ''){
+  push @list, {pic23=>$dumpbut};
+  }
+  push @list, ({pic24=>$exportbut},
+	{pic25=>"<a onclick='javascript:injectData(document.courseverify, \"dummy\", \"listsymbs\", \"$lt{'ls'}\")'>$lt{'ls'}</a><input type='hidden' name='folder' value='$env{'form.folder'}' />"},
+	{pic26=>"<a onclick='javascript:injectData(document.courseverify, \"dummy\", \"docslog\", \"$lt{'sl'}\")'>$lt{'sl'}</a>"},
+	);
+  return '<form action="/adm/coursedocs" method="post" name="courseverify"><input type="hidden" id="dummy" />'.create_form_ul(create_list_elements(@list)).'</form>';
 
 }
 
@@ -3691,7 +3708,7 @@
 
 function openTabs(pageId) {
 	tabnav = document.getElementById(pageId).getElementsByTagName('UL');	
-	if(tabnav.length > 0 ){
+	if(tabnav.length > 2 ){
 		currentNav = document.getElementById(tabnav[0].id);
 		currentLis = currentNav.getElementsByTagName('LI');
 		for(i = 0; i< currentLis.length; i++){
@@ -3715,6 +3732,13 @@
 	return false;
 }
 
+function injectData(current, hiddenField, name, value) {
+	currentElement = document.getElementById(hiddenField);
+	currentElement.name = name;
+	currentElement.value = value;
+	current.submit();
+}
+
 ENDNEWSCRIPT
 }
 1;

--tempelho1250166544--