From pate@users.sourceforge.net Thu Apr 25 12:45:50 2002 From: Pat Eyler To: koha-devel@lists.koha-community.org Subject: [Koha-devel] CVS: koha/C4 Output.pm,1.6.2.5,1.6.2.6 Date: Thu, 25 Apr 2002 12:54:11 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7897502961167820341==" --===============7897502961167820341== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Update of /cvsroot/koha/koha/C4 In directory usw-pr-cvs1:/tmp/cvs-serv10386 Modified Files: Tag: rel-1-2 Output.pm=20 Log Message: found (and fixed) an error in &mkformnotable while adding tests Index: Output.pm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/koha/koha/C4/Output.pm,v retrieving revision 1.6.2.5 retrieving revision 1.6.2.6 diff -C2 -r1.6.2.5 -r1.6.2.6 *** Output.pm 25 Apr 2002 17:33:16 -0000 1.6.2.5 --- Output.pm 25 Apr 2002 19:45:46 -0000 1.6.2.6 *************** *** 273,277 **** } if ($inputs[$i][0] eq 'radio') { ! $string.=3D"$inputs[$i][2]"; }=20 if ($inputs[$i][0] eq 'text') { --- 273,277 ---- } if ($inputs[$i][0] eq 'radio') { ! $string.=3D"$inputs[$i][2]"; }=20 if ($inputs[$i][0] eq 'text') { *************** *** 292,295 **** --- 292,302 ---- =20 sub mkform2{ + # FIXME + # no POD and no tests yet. Once tests are written, + # this function can be cleaned up with the following steps: + # turn the while loop into a foreach loop + # pull the nested if,elsif structure back up to the main level + # pull the code for the different kinds of inputs into separate + # functions my ($action,%inputs)=3D@_; my $string=3D"
\n"; *************** *** 349,352 **** --- 356,368 ---- } =20 + =3Dpod +=20 + =3Dhead2 &endpage +=20 + &endpage does not expect any arguments, it returns the string: + \n +=20 + =3Dcut +=20 =20 sub endpage() { *************** *** 354,357 **** --- 370,385 ---- } =20 + =3Dpod +=20 + =3Dhead2 &mklink +=20 + &mklink expects two arguments, the url to link to and the text of the link. + It returns this string: + $text + where $url is the first argument and $text is the second. +=20 + =3Dcut +=20 +=20 sub mklink($$) { my ($url,$text)=3D@_; *************** *** 360,377 **** } =20 sub mkheadr { my ($type,$text)=3D@_; my $string; if ($type eq '1'){ ! $string=3D"$text
"; } ! if ($type eq '2'){ ! $string=3D"$text"; ! } ! if ($type eq '3'){ ! $string=3D"$text

"; ! } ! return ($string); } =20 sub center() { --- 388,441 ---- } =20 + =3Dpod +=20 + =3Dhead2 &mkheadr +=20 + &mkeadr expects two strings, a type and the text to use in the header. + types are: +=20 + =3Dover +=20 + =3Ditem 1 ends with
+=20 + =3Ditem 2 no special ending tag +=20 + =3Ditem 3 ends with

+=20 + =3Dback +=20 + Other than this, the return value is the same: + $text$string + Where $test is the text passed in and $string is the tag generated from=20 + the type value. +=20 + =3Dcut +=20 +=20 sub mkheadr { + # FIXME + # would it be better to make this more generic by accepting an optional + # argument with a closing tag instead of a numeric type? +=20 my ($type,$text)=3D@_; my $string; if ($type eq '1'){ ! $string=3D"
"; ! } elsif ($type eq '3') { ! $string=3D"

"; ! } else { ! $string=3D""; } ! return ("$text$string"); } +=20 + =3Dpod +=20 + =3Dhead2 ¢er and &endcenter +=20 + ¢er and &endcenter take no arguments and return html tags

and +
respectivley. +=20 + =3Dcut =20 sub center() { --===============7897502961167820341==--