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

bisitz lon-capa-cvs-allow@mail.lon-capa.org
Thu, 25 Sep 2008 17:44:12 -0000


This is a MIME encoded message

--bisitz1222364652
Content-Type: text/plain

bisitz		Thu Sep 25 13:44:12 2008 EDT

  Modified files:              
    /loncom/interface	lonhtmlcommon.pm loncreatecourse.pm 
  Log:
  lonhtmlcommon.pm:
  - Introduces new sub routine "row_headline" to allow headlines in the middle of existing pick boxes
    (documentation and improved CSS will follow later on)
  
  Course creation screen:
  - Wrapped in LON-CAPA standard pick box table
  - XHTML conform HTML attributes usage (checked="checked")
  - Got rid of wrong HTML tag order (<p>...<p></p>...</p>)
  - Replaced h2 headlines with h3 (h2 usually used at one level higher)
  
  Note:
  Some more improvements will follow later on, e.g. course content table and some wording
  
  
  
--bisitz1222364652
Content-Type: text/plain
Content-Disposition: attachment; filename="bisitz-20080925134412.txt"

Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.180 loncom/interface/lonhtmlcommon.pm:1.181
--- loncom/interface/lonhtmlcommon.pm:1.180	Fri Sep  5 18:12:47 2008
+++ loncom/interface/lonhtmlcommon.pm	Thu Sep 25 13:44:11 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.180 2008/09/05 22:12:47 riegler Exp $
+# $Id: lonhtmlcommon.pm,v 1.181 2008/09/25 17:44:11 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1483,6 +1483,13 @@
     return $output;
 }
 
+sub row_headline {
+    my $output = <<"END";
+           <tr><td colspan="2">
+END
+    return $output;
+}
+
 sub row_title {
     my ($title,$css_title_class,$css_value_class) = @_;
     $css_title_class ||= 'LC_pick_box_title';
Index: loncom/interface/loncreatecourse.pm
diff -u loncom/interface/loncreatecourse.pm:1.108 loncom/interface/loncreatecourse.pm:1.109
--- loncom/interface/loncreatecourse.pm:1.108	Tue Jun 24 11:51:25 2008
+++ loncom/interface/loncreatecourse.pm	Thu Sep 25 13:44:11 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Create a course
 #
-# $Id: loncreatecourse.pm,v 1.108 2008/06/24 15:51:25 bisitz Exp $
+# $Id: loncreatecourse.pm,v 1.109 2008/09/25 17:44:11 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -153,7 +153,7 @@
                     'audr' => "Automated drops",
                     'dacu' => "Duration of automated classlist updates",
                     'dacc' => "Default start and end dates for student access",
-                    'psam' => "Please select the authentication mechanism",
+                    'psam' => "Please select the Authentication mechanism",
                     'pcda' => "Please choose the default authentication method to be used by new users added to this LON-CAPA domain by the automated enrollment process",
                     'nech' => "Notification of enrollment changes",
                     'nccl' => "Notification to course coordinator via LON-CAPA message when enrollment changes occur during the automated update?",
@@ -224,48 +224,50 @@
 					    'Create_Courses');
     $r->print($start_page.$crumbs);
     if ($crstype eq 'Course') {
-        $r->print(<<ENDDOCUMENT);
-<form action="/adm/createcourse" method="post" name="ccrs">
-<h2>$lt{'cinf'}</h2>
-<p>
-<label><b>$lt{'ctit'}:</b>
-<input type="text" size="50" name="title" /></label>
-</p><p>
-<label>
-    <b>$lt{'chsr'}:</b>$course_home
-</label>
-</p><p>
-<label>
-    <b>$lt{'cidn'} ($lt{'opt'})</b>
-    <input type="text" size="30" name="crsid" />
-</label>
-</p><p>
-<h2>$lt{'iinf'}</h2>
-<p>
-$lt{'stat'}
-</p><p>
-<label>
-    <b>$lt{'ccod'}</b>
-    <input type="text" size="30" name="crscode" />
-</label>
-<br/>
-($lt{'toin'})
-</p><p>
-<label>
-    <b>$lt{'snid'}</b>
-    <input type="text" size="30" name="crssections" />
-</label>
-<br/>
-($lt{'csli'})
-</p><p>
-<label>
-    <b>$lt{'crcs'}</b>
-    <input type="text" size="30" name="crsxlist" />
-</label>
-<br/>
-($lt{'cscs'})
-</p>
-<h2>$lt{'crco'}</h2>
+
+        $r->print('<form action="/adm/createcourse" method="post" name="ccrs">'
+                 .&Apache::lonhtmlcommon::start_pick_box()
+
+                 .&Apache::lonhtmlcommon::row_headline()
+                 .'<h3>'.$lt{'cinf'}.'</h3>'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'ctit'})
+                 .'<input type="text" size="50" name="title" />'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'chsr'})
+                 .$course_home
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'cidn'}.' ('.$lt{'opt'}.')')
+                 .'<input type="text" size="30" name="crsid" />'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_headline()
+                 .'<h3>'.$lt{'iinf'}.'</h3>'
+                 .$lt{'stat'}
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'ccod'})
+                 .'<input type="text" size="30" name="crscode" />'
+                 .'<br />('.$lt{'toin'}.')'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'snid'})
+                 .'<input type="text" size="30" name="crssections" />'
+                 .'<br />('.$lt{'csli'}.')'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'crcs'})
+                 .'<input type="text" size="30" name="crsxlist" />'
+                 .'<br />('.$lt{'cscs'}.')'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_headline()
+                 .'<h3>'.$lt{'crco'}.'</h3>'
+                );
+        $r->print(<<MYEND);
 <table border="2">
 <tr><th>$lt{'cncr'}</th><th>$lt{'cecr'}</th></tr>
 <tr><td>
@@ -287,7 +289,7 @@
 </label>
 &nbsp;
 <label>
-    <input type="radio" name="firstres" value="syl" checked />$lt{'sllb'}
+    <input type="radio" name="firstres" value="syl" checked="checked" />$lt{'sllb'}
 </label>
 &nbsp;
 <label>
@@ -311,126 +313,136 @@
 $lt{'asov'}.
 </td></tr>
 </table>
-<h2>$lt{'assp'}</h2>
-<p>
-<label>
-    <b>$lt{'oaas'}: </b>
-    <input type="checkbox" name="openall" />
-</label>
-</p>
-<h2>$lt{'mssg'}</h2>
-<p>
-<label>
-    <b>$lt{'scpf'}: </b>
-    <input type="checkbox" name="setpolicy" checked />
-</label>
-<br />
-<label>
-    <b>$lt{'scfc'}: </b>
-    <input type="checkbox" name="setcontent" checked />
-</label>
-</p>
-<h2>$lt{'cmmn'}</h2>
-<p>
-<label>
-    <b>$lt{'dsrd'}: </b>
-    <input type="checkbox" name="disresdis" />
-</label>
-<br />
-<label>
-    <b>$lt{'dsuc'}: </b>
-    <input type="checkbox" name="disablechat" />
-</label>
-</p>
-<h2>$lt{'acco'}</h2>
-<p>
-<label>
-    <b>$lt{'snak'}: </b>
-    <input type="checkbox" name="setkeys" />
-</label>
-<br />
-<label>
-    <b>$lt{'kaut'}: </b>
-    <input type="text" size="30" name="keyauth" />
-</label>
-</p>
-<h2>$lt{'rshm'}</h2>
-<p>
-<label>
-    <b>$lt{'rshm'}: </b>
-    <input type="text" name="reshome" size="30" value="/res/$defdom/" />
-</label>
-</p>
-<p>
-<h2>$lt{'aens'}</h2>
-$lt{'aesc'}
-</p>
-<p>
-<b>$lt{'aadd'}</b>
-<label><input type="radio" name="autoadds" value="1" />$lt{'yes'}</label> 
-<label><input type="radio" name="autoadds" value="0" checked="true" />$lt{'no'}
-</label>
-</p><p>
-<b>$lt{'audr'}</b>
-<label><input type="radio" name="autodrops" value="1" />$lt{'yes'}</label> 
-<label><input type="radio" name="autodrops" value="0" checked="true" />$lt{'no'}</label>
-</p><p>
-<b>$lt{'dacu'}</b>
-$enroll_table
-</p><p>
-<b>$lt{'dacc'}</b>
-$access_table
-<p></p>
-<b>$lt{'psam'}.</b><br />
-$lt{'pcda'}.
-</p><p>
-$krbform
-<br />
-$intform
-<br />
-$locform
-</p><p>
-<b>$lt{'nech'}</b><br />
-$lt{'nccl'}<br/>
-<label>
-    <input type="radio" name="notify_owner" value="1" />$lt{'yes'}
-</label> 
-<label>
-    <input type="radio" name="notify_owner" value="0" checked="true" />$lt{'no'}
-</label>
-<br />
-$lt{'ndcl'}<br/>
-<label>
-    <input type="radio" name="notify_dc" value="1" />$lt{'yes'}
-</label>
-<label>
-    <input type="radio" name="notify_dc" value="0" checked="true" />$lt{'no'}
-</label>
-</p><p>
-<b>$lt{'irsp'}</b>
-<label>
-    <input type="radio" name="showphotos" value="1" />$lt{'yes'}
-</label> 
-<label>
-    <input type="radio" name="showphotos" value="0" checked="true" />$lt{'no'}
-</label>
-</p>
-<p>
-<h2>$lt{'cgrs'}</h2>
-$lt{'cgrq'}
-<input type="text" name="crsquota" value="20" size="6" />Mb 
-</p>
-<hr />
-<h2>$lt{'cc'}</h2>
-<p>
-<label>
-    <b>$lt{'user'}:</b> <input type="text" size="15" name="ccuname" />
-</label>
-</p><p>
-<label>
-    <b>$lt{'dmn'}:</b> $domform
-</label>
-</p>
+MYEND
+
+
+$r->print(' '
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_headline()
+                 .'<h3>'.$lt{'assp'}.'</h3>'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'oaas'})
+                 .'<input type="checkbox" name="openall" />'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_headline()
+                 .'<h3>'.$lt{'mssg'}.'</h3>'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'scpf'})
+                 .'<input type="checkbox" name="setpolicy" checked="checked" />'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'scfc'})
+                 .'<input type="checkbox" name="setcontent" checked="checked" />'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_headline()
+                 .'<h3>'.$lt{'cmmn'}.'</h3>'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'dsrd'})
+                 .'<input type="checkbox" name="disresdis" />'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'dsuc'})
+                 .'<input type="checkbox" name="disablechat" /'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_headline()
+                 .'<h3>'.$lt{'acco'}.'</h3>'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'snak'})
+                 .'<input type="checkbox" name="setkeys" />'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'kaut'})
+                 .'<input type="text" size="30" name="keyauth" />'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_headline()
+                 .'<h3>'.$lt{'rshm'}.'</h3>'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'rshm'})
+                 .'<input type="text" name="reshome" size="30" value="/res/'.$defdom.'/" />'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_headline()
+                 .'<h3>'.$lt{'aens'}.'</h3>'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'aadd'})
+                 .'<label><input type="radio" name="autoadds" value="1" />'.$lt{'yes'}.'</label>'
+                 .'<label><input type="radio" name="autoadds" value="0" checked="checked" />'.$lt{'no'}.'</label>'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'audr'})
+                 .'<label><input type="radio" name="autodrops" value="1" />'.$lt{'yes'}.'</label>'
+                 .'<label><input type="radio" name="autodrops" value="0" checked="checked" />'.$lt{'no'}.'</label>'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'dacu'})
+                 .$enroll_table
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'dacc'})
+                 .$access_table
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'psam'})
+                 .$lt{'pcda'}.'<br />'
+                 .$krbform.'<br />'
+                 .$intform.'<br />'
+                 .$locform
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'nech'})
+                 .$lt{'nccl'}.'<br/>'
+                 .'<label><input type="radio" name="notify_owner" value="1" />'.$lt{'yes'}.'</label>'
+                 .'<label><input type="radio" name="notify_owner" value="0" checked="checked" />'.$lt{'no'}.'</label>'
+                 .'<br />'
+                 .$lt{'ndcl'}.'<br/>'
+                 .'<label><input type="radio" name="notify_dc" value="1" />'.$lt{'yes'}.'</label>'
+                 .'<label><input type="radio" name="notify_dc" value="0" checked="checked" />'.$lt{'no'}.'</label>'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'irsp'})
+                 .'<label>'
+                 .'<input type="radio" name="showphotos" value="1" />'.$lt{'yes'}
+                 .'</label> '
+                 .'<label>'
+                 .'<input type="radio" name="showphotos" value="0" checked="checked" />'.$lt{'no'}
+                 .'</label> '
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_headline()
+                 .'<h3>'.$lt{'cgrs'}.'</h3>'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'cgrq'})
+                 .'<input type="text" name="crsquota" value="20" size="6" />Mb'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_headline()
+                 .'<h3>'.$lt{'cc'}.'</h3>'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'user'})
+                 .'<input type="text" size="15" name="ccuname" />'
+                 .&Apache::lonhtmlcommon::row_closure()
+
+                 .&Apache::lonhtmlcommon::row_title($lt{'dmn'},"","LC_odd_row_value")
+                 .$domform
+                 .&Apache::lonhtmlcommon::row_closure(1)
+
+                 .&Apache::lonhtmlcommon::end_pick_box()
+                 );
+
+        $r->print(<<ENDDOCUMENT);
 <p>
 <input type="hidden" name="prevphase" value="courseone" />
 <input type="hidden" name="phase" value="coursetwo" />
@@ -438,6 +450,7 @@
 </p>
 </form>
 ENDDOCUMENT
+
     } elsif ($crstype eq 'Group') {
         $r->print(<<ENDDOCUMENT);
 <form action="/adm/createcourse" method="post" name="ccrs">
@@ -477,7 +490,7 @@
 </label>
 &nbsp;
 <label>
-    <input type="radio" name="firstres" value="syl" checked />$lt{'sllb'}
+    <input type="radio" name="firstres" value="syl" checked="checked" />$lt{'sllb'}
 </label>
 &nbsp;
 <label>
@@ -506,12 +519,12 @@
 <p>
 <label>
     <b>$lt{'sgpf'}: </b>
-    <input type="checkbox" name="setpolicy" checked />
+    <input type="checkbox" name="setpolicy" checked="checked" />
 </label>
 <br />
 <label>
     <b>$lt{'scfg'}: </b>
-    <input type="checkbox" name="setcontent" checked />
+    <input type="checkbox" name="setcontent" checked="checked" />
 </label>
 </p>
 <h2>$lt{'cmmn'}</h2>

--bisitz1222364652--