##---------------------------------------------------------------------------## ## File: ## $Id: mhidxrc.pl,v 2.15 2003/03/31 17:53:47 ehood Exp $ ## Author: ## Earl Hood mhonarc@mhonarc.org ## Description: ## MHonArc library defining values for various index resources ##---------------------------------------------------------------------------## ## MHonArc -- Internet mail-to-HTML converter ## Copyright (C) 1996-1999 Earl Hood, mhonarc@mhonarc.org ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA ##---------------------------------------------------------------------------## package mhonarc; sub mhidxrc_set_vars { ##-----------------## ## Index resources ## ##-----------------## $IdxTypeStr = $NOSORT ? 'Message' : $SUBSORT ? 'Subject' : $AUTHSORT ? 'Author' : 'Date'; ## MAIN index resources ## if ($MAIN) { ## Label for main index unless ($IDXLABEL) { $IDXLABEL = $IdxTypeStr . ' Index'; $IsDefault{'IDXLABEL'} = 1; } ## Beginning of main index page unless ($IDXPGBEG) { $IDXPGBEG =<<'EndOfStr'; $IDXTITLE$

$IDXTITLE$

EndOfStr $IsDefault{'IDXPGBEG'} = 1; } ## End of main index page unless ($IDXPGEND) { $IDXPGEND = "\n\n"; $IsDefault{'IDXPGEND'} = 1; } ## Beginning of main index list unless ($LIBEG) { $LIBEG = ''; $LIBEG .= "\n" if $THREAD; $LIBEG .= '$PGLINK(PREV)$$PGLINK(NEXT)$' . "\n" if $MULTIIDX; $LIBEG .= "
\n\n"; $IsDefault{'LIEND'} = 1; } ## Main index entry (start, content, and end) unless ($LITMPL) { $LITMPL = qq|
  • \$SUBJECT\$\n| . qq|\n
  • \n|; $IsDefault{'LITMPL'} = 1; } ## Main list group resources unless ($AUTHBEG) { $AUTHBEG = ''; $IsDefault{'AUTHBEG'} = 1; } unless ($AUTHEND) { $AUTHEND = ''; $IsDefault{'AUTHEND'} = 1; } unless ($DAYBEG) { $DAYBEG = ''; $IsDefault{'DAYBEG'} = 1; } unless ($DAYEND) { $DAYEND = ''; $IsDefault{'DAYEND'} = 1; } unless ($SUBJECTBEG) { $SUBJECTBEG = ''; $IsDefault{'SUBJECTBEG'} = 1; } unless ($SUBJECTEND) { $SUBJECTEND = ''; $IsDefault{'SUBJECTEND'} = 1; } ## } ## THREAD index resources ## if ($THREAD) { ## Label for thread index unless ($TIDXLABEL) { $TIDXLABEL = 'Thread Index'; $IsDefault{'TIDXLABEL'} = 1; } ## Beginning of thread index page unless ($TIDXPGBEG) { $TIDXPGBEG =<<'EndOfStr'; $TIDXTITLE$

    $TIDXTITLE$

    EndOfStr $IsDefault{'TIDXPGBEG'} = 1; } ## End of thread index page unless ($TIDXPGEND) { $TIDXPGEND = "\n\n"; $IsDefault{'TIDXPGEND'} = 1; } ## Head of thread index page (also contains list start markup) unless ($THEAD) { $THEAD = ''; $THEAD .= "\n" if $MAIN; $THEAD .= '$PGLINK(TPREV)$$PGLINK(TNEXT)$' . "\n" if $MULTIIDX; $THEAD .= "
    \n\n"; $IsDefault{'TFOOT'} = 1; } ## Template for thread entry with no follow-ups unless ($TSINGLETXT) { $TSINGLETXT =<<'EndOfStr';
  • $SUBJECT$, $FROMNAME$
  • EndOfStr $IsDefault{'TSINGLETXT'} = 1; } ## Template for thread entry that is the start of a thread unless ($TTOPBEG) { $TTOPBEG =<<'EndOfStr';
  • $SUBJECT$, $FROMNAME$ EndOfStr $IsDefault{'TTOPBEG'} = 1; } ## Template for end of a thread unless ($TTOPEND) { $TTOPEND = "
  • \n"; $IsDefault{'TTOPEND'} = 1; } ## Template for the start of a sub-thread unless ($TSUBLISTBEG) { $TSUBLISTBEG = "\n"; $IsDefault{'TSUBLISTEND'} = 1; } ## Template for the start and content of a regular thread entry unless ($TLITXT) { $TLITXT =<<'EndOfStr';
  • $SUBJECT$, $FROMNAME$ EndOfStr $IsDefault{'TLITXT'} = 1; } ## Template for end of a regular thread entry unless ($TLIEND) { $TLIEND = "
  • \n"; $IsDefault{'TLIEND'} = 1; } ## Template for the start of subject based section unless ($TSUBJECTBEG) { $TSUBJECTBEG = "
  • <Possible follow-ups>
  • \n"; $IsDefault{'TSUBJECTBEG'} = 1; } ## Template for the end of subject based section unless ($TSUBJECTEND) { $TSUBJECTEND = " "; $IsDefault{'TSUBJECTEND'} = 1; } ## Template for start and content of missing message in thread unless ($TLINONE) { $TLINONE = "
  • Message not available"; $IsDefault{'TLINONE'} = 1; } ## Template for end of missing message in thread unless ($TLINONEEND) { $TLINONEEND = "
  • \n"; $IsDefault{'TLINONEEND'} = 1; } ## Template for opening an indent (for cross-page threads) unless ($TINDENTBEG) { $TINDENTBEG = "\n"; $IsDefault{'TINDENTEND'} = 1; } ## Template for start of a continued thread (for cross-page threads) unless ($TCONTBEG) { $TCONTBEG = '
  • $SUBJECTNA$, ' . "(continued)\n"; $IsDefault{'TCONTBEG'} = 1; } ## Template for end of a continued thread (for cross-page threads) unless ($TCONTEND) { $TCONTEND = "
  • \n"; $IsDefault{'TCONTEND'} = 1; } $DoMissingMsgs = $TLINONE =~ /\S/; ## } ## Thread Slice Resources unless ($TSLICEBEG) { $TSLICEBEG = "
    \n"; $IsDefault{'TSLICEEND'} = 1; } if ($TSLICELEVELS < 0) { $TSLICELEVELS = $TLEVELS; $IsDefault{'TSLICELEVELS'} = 1; } unless ($TSLICESINGLETXT) { $TSLICESINGLETXT = $TSINGLETXT; $IsDefault{'TSLICESINGLETXT'} = 1; } unless ($TSLICETOPBEG) { $TSLICETOPBEG = $TTOPBEG; $IsDefault{'TSLICETOPBEG'} = 1; } unless ($TSLICETOPEND) { $TSLICETOPEND = $TTOPEND; $IsDefault{'TSLICETOPEND'} = 1; } unless ($TSLICESUBLISTBEG) { $TSLICESUBLISTBEG = $TSUBLISTBEG; $IsDefault{'TSLICESUBLISTBEG'} = 1; } unless ($TSLICESUBLISTEND) { $TSLICESUBLISTEND = $TSUBLISTEND; $IsDefault{'TSLICESUBLISTEND'} = 1; } unless ($TSLICELITXT) { $TSLICELITXT = $TLITXT; $IsDefault{'TSLICELITXT'} = 1; } unless ($TSLICELIEND) { $TSLICELIEND = $TLIEND; $IsDefault{'TSLICELIEND'} = 1; } unless ($TSLICELINONE) { $TSLICELINONE = $TLINONE; $IsDefault{'TSLICELINONE'} = 1; } unless ($TSLICELINONEEND) { $TSLICELINONEEND = $TLINONEEND; $IsDefault{'TSLICELINONEEND'} = 1; } unless ($TSLICESUBJECTBEG) { $TSLICESUBJECTBEG = $TSUBJECTBEG; $IsDefault{'TSLICESUBJECTBEG'} = 1; } unless ($TSLICESUBJECTEND) { $TSLICESUBJECTEND = $TSUBJECTEND; $IsDefault{'TSLICESUBJECTEND'} = 1; } unless ($TSLICEINDENTBEG) { $TSLICEINDENTBEG = $TINDENTBEG; $IsDefault{'TSLICEINDENTBEG'} = 1; } unless ($TSLICEINDENTEND) { $TSLICEINDENTEND = $TINDENTEND; $IsDefault{'TSLICEINDENTEND'} = 1; } unless ($TSLICECONTBEG) { $TSLICECONTBEG = $TCONTBEG; $IsDefault{'TSLICECONTBEG'} = 1; } unless ($TSLICECONTEND) { $TSLICECONTEND = $TCONTEND; $IsDefault{'TSLICECONTEND'} = 1; } unless ($TSLICESINGLETXTCUR) { $TSLICESINGLETXTCUR = $TSLICESINGLETXT; $IsDefault{'TSLICESINGLETXTCUR'} = 1; } unless ($TSLICETOPBEGCUR) { $TSLICETOPBEGCUR = $TSLICETOPBEG; $IsDefault{'TSLICETOPBEGCUR'} = 1; } unless ($TSLICETOPENDCUR) { $TSLICETOPENDCUR = $TSLICETOPEND; $IsDefault{'TSLICETOPENDCUR'} = 1; } unless ($TSLICELITXTCUR) { $TSLICELITXTCUR = $TSLICELITXT; $IsDefault{'TSLICELITXTCUR'} = 1; } unless ($TSLICELIENDCUR) { $TSLICELIENDCUR = $TSLICELIEND; $IsDefault{'TSLICELIENDCUR'} = 1; } ##-------------------## ## Message resources ## ##-------------------## unless (@DateFields) { @DateFields = ('received', 'date'); @_DateFields = ( ['received',0], ['date',0] ); $IsDefault{'DATEFIELDS'} = 1; } else { local($_); my $f; foreach (@DateFields) { s/\s//g; tr/A-Z/a-z/; $f = $_; if ($f =~ s/\[(\d+)\]//) { push(@_DateFields, [ $f, $1 ]); } else { push(@_DateFields, [ $f, 0 ]); } } } unless (@FromFields) { @FromFields = ('from', 'mail-reply-to', 'reply-to', 'return-path', 'apparently-from', 'sender', 'resent-sender'); $IsDefault{'FROMFIELDS'} = 1; } ## Beginning of message page unless ($MSGPGBEG) { $MSGPGBEG =<<'EndOfStr'; $SUBJECTNA$ EndOfStr $MSGPGBEG .= qq|\n| unless $SpamMode; $MSGPGBEG .= "\n\n"; $IsDefault{'MSGPGBEG'} = 1; } ## End of message page unless ($MSGPGEND) { $MSGPGEND = "\n\n"; $IsDefault{'MSGPGEND'} = 1; } ## Subject header unless ($SUBJECTHEADER) { $SUBJECTHEADER = '

    $SUBJECTNA$

    ' . "\n
    \n"; $IsDefault{'SUBJECTHEADER'} = 1; } ## Separator between message data head and message data body unless ($HEADBODYSEP) { $HEADBODYSEP = "
    \n"; $IsDefault{'HEADBODYSEP'} = 1; } ## Separator between end of message data and rest of page unless ($MSGBODYEND) { $MSGBODYEND = "
    \n"; $IsDefault{'MSGBODYEND'} = 1; } ##---------------------------------## ## Mail header formating resources ## ##---------------------------------## $FIELDSBEG = "\n", $IsDefault{'FIELDSEND'} = 1 unless $FIELDSEND; $LABELBEG = "
  • ", $IsDefault{'LABELBEG'} = 1 unless $LABELBEG; $LABELEND = ":", $IsDefault{'LABELEND'} = 1 unless $LABELEND; $FLDBEG = " ", $IsDefault{'FLDBEG'} = 1 unless $FLDBEG; $FLDEND = "
  • ", $IsDefault{'FLDEND'} = 1 unless $FLDEND; ##-----------------------------------## ## Next/prev message link resources ## ##-----------------------------------## ## Next/prev buttons $NEXTBUTTON = '['.$IdxTypeStr.' Next]', $IsDefault{'NEXTBUTTON'} = 1 unless $NEXTBUTTON; $PREVBUTTON = '['.$IdxTypeStr.' Prev]', $IsDefault{'PREVBUTTON'} = 1 unless $PREVBUTTON; $NEXTBUTTONIA = "[$IdxTypeStr Next]", $IsDefault{'NEXTBUTTONIA'} = 1 unless $NEXTBUTTONIA; $PREVBUTTONIA = "[$IdxTypeStr Prev]", $IsDefault{'PREVBUTTONIA'} = 1 unless $PREVBUTTONIA; ## Next message link unless ($NEXTLINK) { $NEXTLINK =<Next by $IdxTypeStr: \$SUBJECT(NEXT)\$ EndOfStr $IsDefault{'NEXTLINK'} = 1; } ## Inactive next message link $NEXTLINKIA = '', $IsDefault{'NEXTLINKIA'} = 1 unless $NEXTLINKIA; ## Previous message link unless ($PREVLINK) { $PREVLINK =<Prev by $IdxTypeStr: \$SUBJECT(PREV)\$ EndOfStr $IsDefault{'PREVLINK'} = 1; } ## Inactive previous message link $PREVLINKIA = '', $IsDefault{'PREVLINKIA'} = 1 unless $PREVLINKIA; ## Thread next/previous buttons $TNEXTBUTTON = '[Thread Next]', $IsDefault{'TNEXTBUTTON'} = 1 unless $TNEXTBUTTON; $TPREVBUTTON = '[Thread Prev]', $IsDefault{'TPREVBUTTON'} = 1 unless $TPREVBUTTON; $TNEXTBUTTONIA = '[Thread Next]', $IsDefault{'TNEXTBUTTONIA'} = 1 unless $TNEXTBUTTONIA; $TPREVBUTTONIA = '[Thread Prev]', $IsDefault{'TPREVBUTTONIA'} = 1 unless $TPREVBUTTONIA; $TNEXTINBUTTON = '[Next in Thread]', $IsDefault{'TNEXTINBUTTON'} = 1 unless $TNEXTINBUTTON; $TNEXTINBUTTONIA = '[Next in Thread]', $IsDefault{'TNEXTINBUTTONIA'} = 1 unless $TNEXTINBUTTONIA; $TPREVINBUTTON = '[Prev in Thread]', $IsDefault{'TPREVINBUTTON'} = 1 unless $TPREVINBUTTON; $TPREVINBUTTONIA = '[Prev in Thread]', $IsDefault{'TPREVINBUTTONIA'} = 1 unless $TPREVINBUTTONIA; $TNEXTTOPBUTTON = '[Next Thread]', $IsDefault{'TNEXTTOPBUTTON'} = 1 unless $TNEXTTOPBUTTON; $TNEXTTOPBUTTONIA = '[Next Thread]', $IsDefault{'TNEXTTOPBUTTONIA'} = 1 unless $TNEXTTOPBUTTONIA; $TPREVTOPBUTTON = '[Prev Thread]', $IsDefault{'TPREVTOPBUTTON'} = 1 unless $TPREVTOPBUTTON; $TPREVTOPBUTTONIA = '[Prev Thread]', $IsDefault{'TPREVTOPBUTTONIA'} = 1 unless $TPREVTOPBUTTONIA; $TTOPBUTTON = '[First in Thread]', $IsDefault{'TTOPBUTTON'} = 1 unless $TTOPBUTTON; $TTOPBUTTONIA = '[First in Thread]', $IsDefault{'TTOPBUTTONIA'} = 1 unless $TTOPBUTTONIA; $TENDBUTTON = '[Last in Thread]', $IsDefault{'TENDBUTTON'} = 1 unless $TENDBUTTON; $TENDBUTTONIA = '[Last in Thread]', $IsDefault{'TENDBUTTONIA'} = 1 unless $TENDBUTTONIA; ## Next message by thread link unless ($TNEXTLINK) { $TNEXTLINK =<<'EndOfStr';
  • Next by thread: $SUBJECT(TNEXT)$
  • EndOfStr $IsDefault{'TNEXTLINK'} = 1; } ## Inactive next message in thread link $TNEXTLINKIA = '', $IsDefault{'TNEXTLINKIA'} = 1 unless $TNEXTLINKIA; ## Previous message by thread link unless ($TPREVLINK) { $TPREVLINK =<<'EndOfStr';
  • Previous by thread: $SUBJECT(TPREV)$
  • EndOfStr $IsDefault{'TPREVLINK'} = 1; } ## Inactive previous message in thread link $TPREVLINKIA = '', $IsDefault{'TPREVLINKIA'} = 1 unless $TPREVLINKIA; ## Next message within thread link unless ($TNEXTINLINK) { $TNEXTINLINK =<<'EndOfStr';
  • Next in thread: $SUBJECT(TNEXTIN)$
  • EndOfStr $IsDefault{'TNEXTINLINK'} = 1; } ## Inactive next message within thread link $TNEXTINLINKIA = '', $IsDefault{'TNEXTINLINKIA'} = 1 unless $TNEXTINLINKIA; ## Previous message within thread link unless ($TPREVINLINK) { $TPREVINLINK =<<'EndOfStr';
  • Previous in thread: $SUBJECT(TPREVIN)$
  • EndOfStr $IsDefault{'TPREVINLINK'} = 1; } ## Inactive previous message within thread link $TPREVINLINKIA = '', $IsDefault{'TPREVINLINKIA'} = 1 unless $TPREVINLINKIA; ## Next thread unless ($TNEXTTOPLINK) { $TNEXTTOPLINK =<<'EndOfStr';
  • Next thread: $SUBJECT(TNEXTTOP)$
  • EndOfStr $IsDefault{'TNEXTTOPLINK'} = 1; } ## Inactive next thread $TNEXTTOPLINKIA = '', $IsDefault{'TNEXTTOPLINKIA'} = 1 unless $TNEXTTOPLINKIA; ## Previous thread unless ($TPREVTOPLINK) { $TPREVTOPLINK =<<'EndOfStr';
  • Previous thread: $SUBJECT(TPREVTOP)$
  • EndOfStr $IsDefault{'TPREVTOPLINK'} = 1; } ## Inactive prev thread $TPREVTOPLINKIA = '', $IsDefault{'TPREVTOPLINKIA'} = 1 unless $TPREVTOPLINKIA; ## First in thread unless ($TTOPLINK) { $TTOPLINK =<<'EndOfStr';
  • First in thread: $SUBJECT(TTOP)$
  • EndOfStr $IsDefault{'TTOPLINK'} = 1; } ## Inactive first in thread $TTOPLINKIA = '', $IsDefault{'TTOPLINKIA'} = 1 unless $TTOPLINKIA; ## Last in thread unless ($TENDLINK) { $TENDLINK =<<'EndOfStr';
  • Last in thread: $SUBJECT(TEND)$
  • EndOfStr $IsDefault{'TENDLINK'} = 1; } ## Inactive last in thread $TENDLINKIA = '', $IsDefault{'TENDLINKIA'} = 1 unless $TENDLINKIA; ## Top links in message if (!$TOPLINKS) { $TOPLINKS = "
    \n"; $TOPLINKS .= '$BUTTON(PREV)$$BUTTON(NEXT)$' if $MAIN; $TOPLINKS .= '$BUTTON(TPREV)$$BUTTON(TNEXT)$' if $THREAD; $TOPLINKS .= '[$IDXLABEL$]' if $MAIN; $TOPLINKS .= '[$TIDXLABEL$]' if $THREAD; $IsDefault{'TOPLINKS'} = 1; } ## Bottom links in message if (!$BOTLINKS) { $BOTLINKS = "\n"; $IsDefault{'BOTLINKS'} = 1; } ## Follow-up and References resources unless ($FOLUPBEGIN) { $FOLUPBEGIN =<<'EndOfVar'; EndOfVar $IsDefault{'FOLUPEND'} = 1; } unless ($REFSBEGIN) { $REFSBEGIN =<<'EndOfVar'; EndOfVar $IsDefault{'REFSEND'} = 1; } ##--------------------------------------------## ## Next/previous main/thread index page links ## ##--------------------------------------------## $FIRSTPGLINK = '[First Page]', $IsDefault{'FIRSTPGLINK'} = 1 unless $FIRSTPGLINK; $LASTPGLINK = '[Last Page]', $IsDefault{'LASTPGLINK'} = 1 unless $LASTPGLINK; $NEXTPGLINK = '[Next Page]', $IsDefault{'NEXTPGLINK'} = 1 unless $NEXTPGLINK; $PREVPGLINK = '[Prev Page]', $IsDefault{'PREVPGLINK'} = 1 unless $PREVPGLINK; $TFIRSTPGLINK = '[First Page]', $IsDefault{'TFIRSTPGLINK'} = 1 unless $TFIRSTPGLINK; $TLASTPGLINK = '[Last Page]', $IsDefault{'TLASTPGLINK'} = 1 unless $TLASTPGLINK; $TNEXTPGLINK = '[Next Page]', $IsDefault{'TNEXTPGLINK'} = 1 unless $TNEXTPGLINK; $TPREVPGLINK = '[Prev Page]', $IsDefault{'TPREVPGLINK'} = 1 unless $TPREVPGLINK; $NEXTPGLINKIA = '[Next Page]', $IsDefault{'NEXTPGLINKIA'} = 1 unless $NEXTPGLINKIA; $PREVPGLINKIA = '[Prev Page]', $IsDefault{'PREVPGLINKIA'} = 1 unless $PREVPGLINKIA; $TNEXTPGLINKIA = '[Next Page]', $IsDefault{'TNEXTPGLINKIA'} = 1 unless $TNEXTPGLINKIA; $TPREVPGLINKIA = '[Prev Page]', $IsDefault{'TPREVPGLINKIA'} = 1 unless $TPREVPGLINKIA; ##---------------## ## Miscellaneous ## ##---------------## $MSGIDLINK = '$MSGID$', $IsDefault{'MSGIDLINK'} = 1 unless $MSGIDLINK; $NOTE = '$NOTETEXT$', $IsDefault{'NOTE'} = 1 unless $NOTE; $NOTEIA = '', $IsDefault{'NOTEIA'} = 1 unless $NOTEIA; $NOTEICON = '', $IsDefault{'NOTEICON'} = 1 unless $NOTEICON; $NOTEICONIA = '', $IsDefault{'NOTEICONIA'} = 1 unless $NOTEICONIA; ## Set unknown icon $Icons{'unknown'} = $Icons{'text/plain'} unless $Icons{'unknown'}; ## if ($AddressModify eq "") { $AddressModify = q{s|([\!\%\w\.\-+=/]+@)([\w\-]+\.[\w\.\-]+)|$1.('x' x length($2))|ge} if $SpamMode; $IsDefault{'AddressModify'} = 1; } if ($MAILTOURL eq "") { if ($SpamMode) { $MAILTOURL = 'mailto:$TOADDRNAME$@DOMAIN.HIDDEN'; } else { $MAILTOURL = 'mailto:$TO$'; } $IsDefault{'MAILTOURL'} = 1; } if (!defined($AddrModifyBodies)) { $AddrModifyBodies = 1 if $SpamMode; } } ##---------------------------------------------------------------------------## 1;