- $res = '<div class="title">'.$this->title().'</div>';
-
- $head = $this->head();
- $head = str_replace('<cher>', $sexe ? 'Chère' : 'Cher', $head);
- $head = str_replace('<prenom>', $prenom, $head);
- $head = str_replace('<nom>', $nom, $head);
- $head = enriched_to_text($head,true);
-
- if($head) {
- $res .= "<div class='intro'>$head</div>";
- }
-
- $i = 1;
- foreach ($this->_arts as $cid=>$arts) {
- $res .= "<div class='lnk'><a href='#cat$cid'><strong>$i. {$this->_cats[$cid]}</strong></a>";
- foreach ($arts as $art) {
- $res .= "<a href='#art{$art->_aid}'> - ".htmlentities($art->title())."</a>";
- }
- $res .= '</div>';
- $i ++;
- }
-
- foreach ($this->_arts as $cid=>$arts) {
- $res .= "<h1><a id='cat$cid'></a><span>".$this->_cats[$cid].'</span></h1>';
- foreach($arts as $art) {
- $res .= $art->toHtml();
- }
- }
-
- $res .= $this->footer(true);
-
- if ($body) {
- $res = <<<EOF
-<html>
- <head>
- <style type="text/css">
- <!--
- div.nl { margin: auto; font-family: "Georgia","times new roman",serif; width: 60ex; text-align: justify; font-size: 10pt; }
- div.title { margin: 2ex 0ex 2ex 0ex; padding: 1ex; width: 100%; font-size: 140%; text-align: center;
- font-weight: bold; border-bottom: 3px red solid; border-top: 3px red solid; }
-
- a[href] { text-decoration: none; }
- a[href]:hover { text-decoration: underline; }
-
- div.lnk { margin: 2ex 0ex 2ex 0ex; padding: 0ex 2ex 0ex 2ex; }
- div.lnk a { display: block; }
-
- h1 { margin: 6ex 0ex 4ex 0ex; padding: 2px 4ex 2px 0ex; width: 60ex; font-size: 100%;
- border-bottom: 3px red solid; border-top: 3px red solid; }
- h2 { width: 100%; margin: 0ex 1ex 0ex 1ex; padding: 2px 0px 2px 0px; font-weight: bold; font-style: italic; font-size: 95%; }
- h1 span { font-size: 140%; padding: 2px 1ex 2px 1ex; border-bottom: 3px red solid; }
- h2 span { padding: 2px 4px 2px 4px; border-bottom: 2px yellow solid; }
-
- div.art { padding: 2ex; margin: 0ex 1ex 2ex 1ex; width: 58ex; border-top: 2px yellow solid; }
- div.app { padding: 2ex 3ex 0ex 3ex; width: 100%; margin: 0ex; text-align: left; font-size: 95%; }
- div.intro { padding: 2ex; }
- div.foot { border-top: 1px #808080 dashed; font-size: 95%; padding: 1ex; color: #808080; background: inherit;
- text-align: center; width: 100% }
- -->
- </style>
- </head>
- <body>
- <div class='nl'>
- $res
- </div>
- </body>
-</html>
-EOF;
- }
- return $res;
+ $page->assign('prefix', 'nl/show/' . $this->id());
+ $page->assign('is_mail', false);
+ $page->assign('html_version', true);
+ $page->assign('prenom', $prenom);
+ $page->assign('nom', $nom);
+ $page->assign('sexe', $sexe);
+ $page->assign_by_ref('nl', $this);