cvs: pres2 / display.php objects.php
| From: | Derick Rethans | Date: | Mon, 13 Sep 2004 13:36:38 +0000 |
| Subject: | cvs: pres2 / display.php objects.php | ||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-1059@lists.php.net to get a copy of this message | ||
derick Mon Sep 13 09:36:38 2004 EDT
Modified files:
/pres2 display.php objects.php
Log:
- Added support for the class attribute to blurbs, examples, lists and images
- Added support for subtitles
- Added support for the "encoding" attribute for examples
- Added a new tag "div" to be able to use effects on a block of elements
(Only tested for "hide").
- Spaces to tabs for objects.php
http://cvs.php.net/diff.php/pres2/display.php?r1=1.21&r2=1.22&ty=u Index: pres2/display.php diff -u pres2/display.php:1.21 pres2/display.php:1.22 --- pres2/display.php:1.21 Thu Sep 2 02:54:14 2004 +++ pres2/display.php Mon Sep 13 09:36:38 2004 @@ -100,7 +100,7 @@ if(!empty($slide->logo1)) $logo1 = $slide->logo1; else $logo1 = $this->pres->logo1; if(!empty($slide->logoimage1url)) $logo1url = $slide->logoimage1url; - else $logo1url = $this->pres->logoimage1url; + else $logo1url = $this->pres->logoimage1url; if(!empty($logo1)) { $size = getimagesize($logo1); echo "<td align=\"left\" $size[3]><a href=\"$logo1url\"><img src=\"$logo1\" border=\"0\" align=\"left\" style=\"float: left; margin-bottom: 0em; margin-left: 0em;\"></a></td>"; @@ -147,7 +147,7 @@ if(!empty($slide->logo1)) $logo1 = $slide->logo1; else $logo1 = $this->pres->logo1; if(!empty($slide->logoimage1url)) $logo1url = $slide->logoimage1url; - else $logo1url = $this->pres->logoimage1url; + else $logo1url = $this->pres->logoimage1url; if(!empty($logo1)) { $size = getimagesize($logo1); echo "<td align=\"left\" $size[3]><a href=\"$logo1url\"><img src=\"$logo1\" border=\"0\" align=\"left\" style=\"float: left; margin-bottom: 0.5em; margin-left: 1em;\" alt=\"".$this->pres->slides[$this->slideNum]->filename."\"></a></td>"; @@ -194,11 +194,11 @@ <div align='center' class='navbar_title'><a href='http://{$_SERVER['HTTP_HOST']}{$this->baseDir}{$this->showScript}/$currentPres/{$this->slideNum}' style='navbar_title_a'> ENDT; echo $slide->title."</a></div>"; - if (isset($slide->subtitle)) { - echo <<<ENDST + if (isset($slide->subtitle)) { + echo <<<ENDST <div class="subtitle">{$slide->subtitle}</div> ENDST; - } + } echo "<div class='navbar_nr'>"; echo <<<ENDD <a href='http://{$_SERVER['HTTP_HOST']}{$this->baseDir}/slidelist.php' class='navbar-title' onClick="window.open('http://{$_SERVER['HTTP_HOST']}{$this->baseDir}/slidelist.php','slidelist','toolbar=no,directories=no,location=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=300,height=500,left=10,top=0'); return false">{$this->slideNum}/{$this->maxSlideNum}</a></div> @@ -216,7 +216,7 @@ if(!empty($slide->logo1)) $logo1 = $slide->logo1; else $logo1 = $this->pres->logo1; if(!empty($slide->logoimage1url)) $logo1url = $slide->logoimage1url; - else $logo1url = $this->pres->logoimage1url; + else $logo1url = $this->pres->logoimage1url; if(!empty($logo1)) { echo "<a href=\"$logo1url\"><img src=\"$logo1\" border=\"0\" align=\"left\" style=\"float: left;\" alt=\"".$this->pres->slides[$this->slideNum]->filename."\"></a>"; $offset+=2; @@ -287,13 +287,13 @@ $str = str_replace('(c)','©',$p->copyright); $str = str_replace('(R)','®',$str); echo "<div align\=\"center\" style=\"font-size: 1em\">$str</div>\n"; - } + } } } function _blurb(&$blurb) { if ($this->pres->template == 'css') { - $class = isset($blurb->class) ? $blurb->class : 'blurb'; + $class = isset($blurb->class) ? $blurb->class : 'blurb'; echo "<div class='{$class}'>".markup_text($blurb->text)."</div>"; return; } @@ -313,6 +313,7 @@ function _image(&$image) { $effect = ''; + $class = ''; if($image->effect) $effect = "effect=\"$#image->effect\""; if(isset($image->title)) echo "<h1 align=\"{$image->talign}\">".markup_text($image->title)."</h1>\n"; if ($image->width) { @@ -327,9 +328,12 @@ $size = $size[3]; } } + if (isset($image->class)) { + $class=" class='{$image->class}'"; + } ?> <div <?php echo $effect?> align="<?php echo $image->align?>" style="margin-left: <?php echo $image->marginleft?>; margin-right: <?php echo $image->marginright?>;"> -<img align="<?php echo $image->align?>" src="<?php echo $this->slideDir.$image->filename?>" <?php echo $size?>> +<img align="<?php echo $image->align?>" src="<?php echo $this->slideDir.$image->filename?>" <?php echo $size?><?php echo $class?>> </div> <?php if(isset($image->clear)) echo "<br clear=\"".$image->clear."\"/>\n"; @@ -354,35 +358,55 @@ if(isset($example->title)) echo '<div style="font-size: '.(4*(float)$example->fontsize/3).'em;">'.markup_text($example->title)."</div>\n"; if(!$example->hide) { - $_html_sz = (float) $example->fontsize; - if(!$_html_sz) $_html_sz = 0.1; - $_html_offset = (1/$_html_sz).'em'; - echo '<div '.$_html_effect.' class="shadow" style="margin: '. - ((float)$example->margintop).'em '. - ((float)$example->marginright+1).'em '. - ((float)$example->marginbottom).'em '. - ((float)$example->marginleft).'em;'. - ((!empty($example->width)) ? "width: $example->width;" : ""). - '">'; - if(!empty($pres->examplebackground)) $_html_examplebackground = $pres->examplebackground; - if(!empty($this->objs[1]->examplebackground)) $_html_examplebackground = $this->objs[1]->examplebackground; - if(!empty($example->examplebackground)) $_html_examplebackground = $example->examplebackground; + if (!$this->pres->template == 'css') { + $_html_sz = (float) $example->fontsize; + if(!$_html_sz) $_html_sz = 0.1; + $_html_offset = (1/$_html_sz).'em'; + echo '<div '.$_html_effect.' class="shadow" style="margin: '. + ((float)$example->margintop).'em '. + ((float)$example->marginright+1).'em '. + ((float)$example->marginbottom).'em '. + ((float)$example->marginleft).'em;'. + ((!empty($example->width)) ? "width: $example->width;" : ""). + '">'; + if(!empty($pres->examplebackground)) $_html_examplebackground = $pres->examplebackground; + if(!empty($this->objs[1]->examplebackground)) $_html_examplebackground = $this->objs[1]->examplebackground; + if(!empty($example->examplebackground)) $_html_examplebackground = $example->examplebackground; +/* } if (($this->pres->template == 'css') and (isset($example->class))) { echo "<div class='{$example->class}'>"; } else { - echo '<div class="emcode" style="font-size: '.$_html_sz."em; margin: -$_html_offset 0 0 -$_html_offset;". +*/ echo '<div class="emcode" style="font-size: '.$_html_sz."em; margin: -$_html_offset 0 0 -$_html_offset;". ((!empty($_html_examplebackground)) ? "background: $_html_examplebackground;" : ''). (($example->type=='shell') ? 'font-family: monotype.com, courier, monospace; background: #000000; color: #ffffff; padding: 0px;' : ''). '">'; + } else { + if (isset($example->class)) { + echo "<div class='{$example->class}'>"; + } else { + echo "<div class='example'>"; + } } $example->highlight($this->slideDir); - echo "</div></div>\n"; + if (!$pres->template == 'css') { + echo "</div>"; + } + echo "</div>\n"; } if($example->result && (empty($example->condition) || isset(${$example->condition})) && (empty($example->required_extension) || extension_loaded($example->required_extension))) { - if(!$example->hide) echo '<div style="font-size: '.(4*(float)$example->fontsize/3)."em;\">Output</div>\n"; + if (!$example->hide) { + if ($this->pres->template == 'css' and (isset($example->class))) { + if (!isset($example->output_word)) { + $example->output_word = 'output:'; + } + echo "<div class='{$example->class}_output_text'>{$example->output_word}</div>\n"; + } else { + echo '<div style="font-size: '.(4*(float)$example->fontsize/3)."em;\">Output</div>\n"; + } + } $_html_sz = (float) $example->rfontsize; if(!$_html_sz) $_html_sz = 0.1; $_html_offset = (1/$_html_sz).'em'; @@ -393,16 +417,20 @@ if(!empty($this->objs[1]->outputbackground)) $_html_outputbackground = $this->objs[1]->outputbackground; if(!empty($example->outputbackground)) $_html_outputbackground = $example->outputbackground; if(!empty($example->anchor)) echo "<a name=\"$example->anchor\"></a>\n"; - echo '<div class="shadow" style="margin: '. - ((float)$example->margintop).'em '. - ((float)$example->marginright+1).'em '. - ((float)$example->marginbottom).'em '. - ((float)$example->marginleft).'em;'. - ((!empty($example->rwidth)) ? "width: $example->rwidth;" : ""). - '">'; - echo '<div '.$_html_effect.' class="output" style="font-size: '.$_html_sz."em; margin: -$_html_offset 0 0 -$_html_offset; ". - ((!empty($_html_outputbackground)) ? "background: $_html_outputbackground;" : ''). - "\">\n"; + if ($this->pres->template == 'css' and (isset($example->class))) { + echo "<div class='{$example->class}_output'>"; + } else { + echo '<div class="shadow" style="margin: '. + ((float)$example->margintop).'em '. + ((float)$example->marginright+1).'em '. + ((float)$example->marginbottom).'em '. + ((float)$example->marginleft).'em;'. + ((!empty($example->rwidth)) ? "width: $example->rwidth;" : ""). + '">'; + echo '<div '.$_html_effect.' class="output" style="font-size: '.$_html_sz."em; margin: -$_html_offset 0 0 -$_html_offset; ". + ((!empty($_html_outputbackground)) ? "background: $_html_outputbackground;" : ''). + "\">\n"; + } if(!empty($example->filename)) { $_html_filename = preg_replace('/\?.*$/','',$this->slideDir.$example->filename); switch($example->type) { @@ -414,7 +442,7 @@ break; case 'link': echo "<a href=\"$this->slideDir$example->filename\" class=\"resultlink\">$example->linktext</a><br />\n"; - break; + break; case 'nlink': echo "<a href=\"$this->slideDir$example->filename\" class=\"resultlink\" target=\"_blank\">$example->linktext</a><br />\n"; break; @@ -428,7 +456,7 @@ break; case 'system': system("DISPLAY=localhost:0 $this->slideDir$example->filename"); - break; + break; default: include $_html_filename; break; @@ -436,12 +464,26 @@ } else { switch($example->type) { default: - eval('?>'.$example->text); + if (isset($example->encoding)) { + $example->text = iconv('utf8', $example->encoding, $example->text); + ob_start(); + eval('?>'.$example->text); + $result = ob_get_contents(); + ob_end_clean(); + echo iconv($example->encoding, 'utf8', $result); + } + else + { + eval('?>'.$example->text); + } break; } } - echo "</div></div>\n"; -# if(!empty($example->anchor)) echo "</a>\n"; + if ($this->pres->template == 'css' and (isset($example->class))) { + echo "</div>\n"; + } else { + echo "</div></div>\n"; + } } } @@ -449,6 +491,16 @@ echo str_repeat("<br/>\n", $break->lines); } + function _div(&$div) { + $effect = ''; + if($div->effect) $effect = "effect=\"$div->effect\""; + echo "<div style='' $effect>"; + } + + function _div_end(&$div) { + echo "</div>"; + } + function _list(&$list) { if (!isset($list->bullets)) return; $align = ''; @@ -457,11 +509,11 @@ if(!empty($list->align)) $align = 'align="'.$list->align.'"'; echo "<div $align style=\"$style\">".markup_text($list->title)."</div>\n"; } - if (isset($list->class)) { - echo "<ul class='{$list->class}'>"; - } else { - echo '<ul class="pres">'; - } + if (isset($list->class)) { + echo "<ul class='{$list->class}'>"; + } else { + echo '<ul class="pres">'; + } while(list($k,$bul)=each($list->bullets)) { $bul->display(); } echo '</ul>'; } @@ -483,7 +535,7 @@ if(!empty($bullet->start)) { if(is_numeric($bullet->start)) { - $this->objs[$this->coid]->num = (int)$bullet->start; + $this->objs[$this->coid]->num = (int)$bullet->start; } else { $this->objs[$this->coid]->alpha = $bullet->start; } @@ -574,15 +626,15 @@ $markedText = ($bullet->text == ' ') ? $bullet->text : markup_text(htmlspecialchars($bullet->text)); if ($this->pres->template == 'css') { - if (isset($bullet->class)) { - $class = $bullet->class; - } else { - $class = "pres_bullet'"; - } - $attrs = ''; - if (isset($bullet->effect) && !empty($bullet->effect)) { - $attrs = " style='' effect='{$bullet->effect}'"; - } + if (isset($bullet->class)) { + $class = $bullet->class; + } else { + $class = "pres_bullet'"; + } + $attrs = ''; + if (isset($bullet->effect) && !empty($bullet->effect)) { + $attrs = " style='' effect='{$bullet->effect}'"; + } echo "<div $attrs><li class='$class'>$markedText</li></div>"; } else { echo "<div $eff_str style=\"position: relative;\"><li style=\"$style\">".'<tt>'.$symbol.'</tt> '.$markedText."</li></div>\n"; @@ -738,7 +790,7 @@ if(!empty($slide->logo1)) $logo1 = $slide->logo1; else $logo1 = $pres->logo1; if(!empty($slide->logoimage1url)) $logo1url = $slide->logoimage1url; - else $logo1url = $pres->logoimage1url; + else $logo1url = $pres->logoimage1url; if(!empty($logo1)) echo "<a href=\"$logo1url\"><img src=\"$logo1\" border=\"0\" align=\"left\"></a>\n"; echo "</td>\n"; if ($pres->navbartopiclinks) { @@ -807,7 +859,7 @@ $str = str_replace('(c)','©',$p->copyright); $str = str_replace('(R)','®',$str); echo "<div align\=\"center\" style=\"font-size: 1em\">$str</div>\n"; - } + } } } @@ -891,7 +943,7 @@ break; case 'system': system("DISPLAY=localhost:0 $this->slideDir$example->filename"); - break; + break; default: include $_html_filename; break; @@ -904,7 +956,7 @@ } } echo "</td></tr></table>\n"; -# if(!empty($example->anchor)) echo "</a>\n"; +# if(!empty($example->anchor)) echo "</a>\n"; } } @@ -981,9 +1033,9 @@ class flash extends html { function _slide(&$slide) { - global $pres; + global $pres; - list($dx,$dy) = getFlashDimensions($slide->titleFont,$slide->title,flash_fixsize($slide->titleSize)); + list($dx,$dy) = getFlashDimensions($slide->titleFont,$slide->title,flash_fixsize($slide->titleSize)); $dx = $this->winW; // full width ?> <div align="<?php echo $slide->titleAlign?>" class="sticky" id="stickyBar"> @@ -1042,7 +1094,7 @@ $str = str_replace('(c)','©',$p->copyright); $str = str_replace('(R)','®',$str); echo "<div align\=\"center\" style=\"font-size: 1em\">$str</div>\n"; - } + } } } @@ -1097,8 +1149,8 @@ $fs = font size */ function my_pdf_paginated_code(&$pdf, $data, $x, $y, $tm, $bm, $lm, $rm, $font, $fs) { - $data = strip_markups($data); - pdf_set_font($pdf, $font, $fs, 'winansi'); + $data = strip_markups($data); + pdf_set_font($pdf, $font, $fs, 'winansi'); $cw = pdf_stringwidth($pdf,'m'); // Width of 1 char - assuming monospace $linelen = (int)(($x-$lm-$rm)/$cw); // Number of chars on a line @@ -1124,7 +1176,7 @@ $ln = wordwrap($ln,$linelen); $out = explode("\n", $ln); } else { - $out = array($ln); + $out = array($ln); } foreach($out as $l) { $l = str_replace("\t",' ',$l); // 4-space tabs - should probably be an attribute @@ -1137,7 +1189,7 @@ $this->my_new_pdf_end_page($pdf); $this->my_new_pdf_page($pdf, $x, $y, true); - pdf_set_font($pdf, $font, $fs, 'winansi'); + pdf_set_font($pdf, $font, $fs, 'winansi'); pdf_set_text_pos($pdf, $lm, 60); $np = true; } @@ -1213,7 +1265,7 @@ } function _slide(&$slide) { - global $pres; + global $pres; $currentPres = $_SESSION['currentPres']; $p = $this->objs[1]; @@ -1222,7 +1274,7 @@ $this->pdf_cy = 25; // top-margin $this->pdf_cx = 40; if($this->objs[1]->template == 'titlepage') { - $p = $pres; + $p = $pres; $loc = $middle - 80 * ( !empty($p->title) + !empty($p->event) + !empty($p->date) + (!empty($p->speaker)||!empty($p->email)) + @@ -1300,13 +1352,13 @@ $this->page_index[$this->page_number] = strip_markups($slide->title); } - $this->pdf_cy += 30; + $this->pdf_cy += 30; if($this->slideNum) { pdf_moveto($this->pdf,40,$this->pdf_cy); - pdf_lineto($this->pdf,$this->pdf_x-40,$this->pdf_cy); + pdf_lineto($this->pdf,$this->pdf_x-40,$this->pdf_cy); pdf_stroke($this->pdf); } - $this->pdf_cy += 20; + $this->pdf_cy += 20; pdf_set_text_pos($this->pdf, $this->pdf_cx, $this->pdf_cy); } @@ -1356,7 +1408,7 @@ pdf_scale($this->pdf,1, -1); pdf_set_font($this->pdf, $this->pdf_font , 12, 'winansi'); $leading = pdf_get_value($this->pdf, "leading"); - $height = $inc = 12+$leading; + $height = $inc = 12+$leading; $txt = strip_markups($blurb->text); while(pdf_show_boxed($this->pdf, $txt, $this->pdf_cx+20, $this->pdf_y-$this->pdf_cy, $this->pdf_x-2*($this->pdf_cx-20), $height, $align, 'blind')!=0) $height+=$inc; @@ -1403,8 +1455,8 @@ switch($type) { case 1: - if(!strstr($image->filename,'blank')) - $im = pdf_open_gif($this->pdf, $this->slideDir.$image->filename); + if(!strstr($image->filename,'blank')) + $im = pdf_open_gif($this->pdf, $this->slideDir.$image->filename); break; case 2: $im = pdf_open_jpeg($this->pdf, $this->slideDir.$image->filename); @@ -1451,7 +1503,7 @@ pdf_place_image($this->pdf, $im, $x, ($this->pdf_y-$this->pdf_cy-$dy), $scale); pdf_restore($this->pdf); pdf_set_text_pos($this->pdf,$this->pdf_cx,$this->pdf_cy+$dy); - } + } } function _example(&$example) { @@ -1504,7 +1556,7 @@ break; } - } + } $this->pdf_cy = pdf_get_value($this->pdf, "texty"); if($example->result && $example->type != 'iframe' && (empty($example->condition) || isset(${$example->condition})) && (empty($example->required_extension) || extension_loaded($example->required_extension))) { if(!$example->hide) { @@ -1572,11 +1624,11 @@ // don't think we can do these in pdf break; case 'flash': - // Definitely can't do this one + // Definitely can't do this one break; case 'system': // system("DISPLAY=localhost:0 $this->slideDir$example->filename"); - break; + break; default: // Need something to turn html into pdf here? // Perhaps just output buffering and stripslashes @@ -1620,7 +1672,7 @@ } if(!empty($list->start)) { if(is_numeric($list->start)) { - $list->num = (int)$list->start; + $list->num = (int)$list->start; } else { $list->alpha = $list->start; } @@ -1634,7 +1686,7 @@ $this->pdf_cy = pdf_get_value($this->pdf, "texty"); pdf_set_font($this->pdf, $this->pdf_font, -12, 'winansi'); - $height=10; + $height=10; $txt = strip_markups($bullet->text); pdf_save($this->pdf); @@ -1642,7 +1694,7 @@ pdf_scale($this->pdf,1, -1); pdf_set_font($this->pdf, $this->pdf_font , 12, 'winansi'); $leading = pdf_get_value($this->pdf, "leading"); - $inc = $leading; + $inc = $leading; while(pdf_show_boxed($this->pdf, $txt, $this->pdf_cx+30, $this->pdf_y-$this->pdf_cy, $this->pdf_x-2*($this->pdf_cx+20), $height, 'left', 'blind')) $height+=$inc; pdf_restore($this->pdf); @@ -1767,7 +1819,7 @@ $this->pdf_cy = pdf_get_value($this->pdf, "texty"); pdf_set_font($this->pdf, $this->pdf_font, -12, 'winansi'); - $height=10; + $height=10; $txt = strip_markups($row_text[0]); while(pdf_show_boxed($this->pdf, $txt, 60, $this->pdf_cy, $this->pdf_x-120, $height, 'left', 'blind')) $height+=10; if( ($this->pdf_cy + $height) > $this->pdf_y-40 ) { @@ -1787,7 +1839,7 @@ } $this->pdf_cy+=$height; pdf_set_text_pos($this->pdf, $this->pdf_cx, $this->pdf_cy); - pdf_continue_text($this->pdf,""); + pdf_continue_text($this->pdf,""); $row_text = array(); } @@ -1814,7 +1866,7 @@ case 'left': default: - $x = $this->pdf_cx; + $x = $this->pdf_cx; break; } if($link->marginleft) $x += (int)(((float)$link->marginleft) * $cw); http://cvs.php.net/diff.php/pres2/objects.php?r1=1.155&r2=1.156&ty=u Index: pres2/objects.php diff -u pres2/objects.php:1.155 pres2/objects.php:1.156 --- pres2/objects.php:1.155 Thu Sep 2 02:54:14 2004 +++ pres2/objects.php Mon Sep 13 09:36:38 2004 @@ -24,15 +24,15 @@ } /* {{{ string markup_text($str) - *word* Bold - _word_ underline - %word% monospaced word (ie. %function()%) - ~word~ italics + *word* Bold + _word_ underline + %word% monospaced word (ie. %function()%) + ~word~ italics |rrggbb|word| Colour a word - ^N^ Superscript - @N@ Subscript - **word** Blink - #id# Entity + ^N^ Superscript + @N@ Subscript + **word** Blink + #id# Entity */ function markup_text($str) { $ret = $str; @@ -81,7 +81,7 @@ $format = '%'.$lnwidth."d: %s\n"; $lined_text = ''; while (list ($num, $line) = each ($lines)) { - $lined_text .= sprintf($format, $num + 1, $line); + $lined_text .= sprintf($format, $num + 1, $line); } return $lined_text; } @@ -117,12 +117,12 @@ // {{{ Presentation List Classes class _tag { - function display() { - global $mode; - - $class = get_class($this); - $mode->$class($this); - } + function display() { + global $mode; + + $class = get_class($this); + $mode->$class($this); + } } class _presentation extends _tag { @@ -187,17 +187,17 @@ $this->font = 'fonts/Verdana.fdb'; $this->align = 'left'; $this->talign = 'left'; - $this->fontsize = '2.66em'; + $this->fontsize = '2.66em'; $this->marginleft = '1em'; $this->marginright = '1em'; - $this->margintop = '0.2em'; + $this->margintop = '0.2em'; $this->marginbottom = '0em'; - $this->title = ''; + $this->title = ''; $this->titlecolor = '#000000'; - $this->text = ''; - $this->textcolor = '#000000'; - $this->effect = ''; - $this->type = ''; + $this->text = ''; + $this->textcolor = '#000000'; + $this->effect = ''; + $this->type = ''; } } @@ -363,18 +363,18 @@ echo $this->text."\n"; break; case 'perl': - $text = str_replace('"', '\\"', $this->text); + $text = str_replace('"', '\\"', $this->text); print `echo "{$text}" | perl2html -cs`; break; case 'c': - $text = str_replace('"', '\\"', $this->text); + $text = str_replace('"', '\\"', $this->text); print `echo "{$text}" | c2html -cs`; break; case 'xml': $prog = trim(`which code2html`); if (!empty($prog)) { - $text = str_replace('"', '\\"', $this->text); + $text = str_replace('"', '\\"', $this->text); echo "<pre>\n"; print `echo "{$text}" | code2html -lhtml --no-header`; echo "</pre>"; @@ -403,10 +403,22 @@ } // }}} + // {{{ Div Class + class _div extends _tag { + function _div() { + $this->effect = ''; + } + } + + class _div_end extends _tag { + /* empty */ + } + // }}} + // {{{ List Class class _list extends _tag { function _list() { - $this->fontsize = '3em'; + $this->fontsize = '3em'; $this->marginleft = '0em'; $this->marginright = '0em'; $this->num = 1; @@ -432,7 +444,7 @@ // {{{ Table Class class _table extends _tag { function _table() { - $this->fontsize = '3em'; + $this->fontsize = '3em'; $this->marginleft = '0em'; $this->marginright = '0em'; $this->border = 0; @@ -463,11 +475,11 @@ function _link() { $this->href = ''; $this->align = 'left'; - $this->fontsize = '2em'; - $this->textcolor = '#000000'; + $this->fontsize = '2em'; + $this->textcolor = '#000000'; $this->marginleft = '0em'; $this->marginright = '0em'; - $this->margintop = '0em'; + $this->margintop = '0em'; $this->marginbottom = '0em'; } @@ -486,13 +498,13 @@ // {{{ Divider Class class _divide extends _tag { - /* empty */ + /* empty */ } // }}} // {{{ Footer Class class _footer extends _tag { - /* empty */ + /* empty */ } // }}} ?>
http://cvs.php.net/diff.php/pres2/display.php?r1=1.21&r2=1.22&ty=u Index: pres2/display.php diff -u pres2/display.php:1.21 pres2/display.php:1.22 --- pres2/display.php:1.21 Thu Sep 2 02:54:14 2004 +++ pres2/display.php Mon Sep 13 09:36:38 2004 @@ -100,7 +100,7 @@ if(!empty($slide->logo1)) $logo1 = $slide->logo1; else $logo1 = $this->pres->logo1; if(!empty($slide->logoimage1url)) $logo1url = $slide->logoimage1url; - else $logo1url = $this->pres->logoimage1url; + else $logo1url = $this->pres->logoimage1url; if(!empty($logo1)) { $size = getimagesize($logo1); echo "<td align=\"left\" $size[3]><a href=\"$logo1url\"><img src=\"$logo1\" border=\"0\" align=\"left\" style=\"float: left; margin-bottom: 0em; margin-left: 0em;\"></a></td>"; @@ -147,7 +147,7 @@ if(!empty($slide->logo1)) $logo1 = $slide->logo1; else $logo1 = $this->pres->logo1; if(!empty($slide->logoimage1url)) $logo1url = $slide->logoimage1url; - else $logo1url = $this->pres->logoimage1url; + else $logo1url = $this->pres->logoimage1url; if(!empty($logo1)) { $size = getimagesize($logo1); echo "<td align=\"left\" $size[3]><a href=\"$logo1url\"><img src=\"$logo1\" border=\"0\" align=\"left\" style=\"float: left; margin-bottom: 0.5em; margin-left: 1em;\" alt=\"".$this->pres->slides[$this->slideNum]->filename."\"></a></td>"; @@ -194,11 +194,11 @@ <div align='center' class='navbar_title'><a href='http://{$_SERVER['HTTP_HOST']}{$this->baseDir}{$this->showScript}/$currentPres/{$this->slideNum}' style='navbar_title_a'> ENDT; echo $slide->title."</a></div>"; - if (isset($slide->subtitle)) { - echo <<<ENDST + if (isset($slide->subtitle)) { + echo <<<ENDST <div class="subtitle">{$slide->subtitle}</div> ENDST; - } + } echo "<div class='navbar_nr'>"; echo <<<ENDD <a href='http://{$_SERVER['HTTP_HOST']}{$this->baseDir}/slidelist.php' class='navbar-title' onClick="window.open('http://{$_SERVER['HTTP_HOST']}{$this->baseDir}/slidelist.php','slidelist','toolbar=no,directories=no,location=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=300,height=500,left=10,top=0'); return false">{$this->slideNum}/{$this->maxSlideNum}</a></div> @@ -216,7 +216,7 @@ if(!empty($slide->logo1)) $logo1 = $slide->logo1; else $logo1 = $this->pres->logo1; if(!empty($slide->logoimage1url)) $logo1url = $slide->logoimage1url; - else $logo1url = $this->pres->logoimage1url; + else $logo1url = $this->pres->logoimage1url; if(!empty($logo1)) { echo "<a href=\"$logo1url\"><img src=\"$logo1\" border=\"0\" align=\"left\" style=\"float: left;\" alt=\"".$this->pres->slides[$this->slideNum]->filename."\"></a>"; $offset+=2; @@ -287,13 +287,13 @@ $str = str_replace('(c)','©',$p->copyright); $str = str_replace('(R)','®',$str); echo "<div align\=\"center\" style=\"font-size: 1em\">$str</div>\n"; - } + } } } function _blurb(&$blurb) { if ($this->pres->template == 'css') { - $class = isset($blurb->class) ? $blurb->class : 'blurb'; + $class = isset($blurb->class) ? $blurb->class : 'blurb'; echo "<div class='{$class}'>".markup_text($blurb->text)."</div>"; return; } @@ -313,6 +313,7 @@ function _image(&$image) { $effect = ''; + $class = ''; if($image->effect) $effect = "effect=\"$#image->effect\""; if(isset($image->title)) echo "<h1 align=\"{$image->talign}\">".markup_text($image->title)."</h1>\n"; if ($image->width) { @@ -327,9 +328,12 @@ $size = $size[3]; } } + if (isset($image->class)) { + $class=" class='{$image->class}'"; + } ?> <div <?php echo $effect?> align="<?php echo $image->align?>" style="margin-left: <?php echo $image->marginleft?>; margin-right: <?php echo $image->marginright?>;"> -<img align="<?php echo $image->align?>" src="<?php echo $this->slideDir.$image->filename?>" <?php echo $size?>> +<img align="<?php echo $image->align?>" src="<?php echo $this->slideDir.$image->filename?>" <?php echo $size?><?php echo $class?>> </div> <?php if(isset($image->clear)) echo "<br clear=\"".$image->clear."\"/>\n"; @@ -354,35 +358,55 @@ if(isset($example->title)) echo '<div style="font-size: '.(4*(float)$example->fontsize/3).'em;">'.markup_text($example->title)."</div>\n"; if(!$example->hide) { - $_html_sz = (float) $example->fontsize; - if(!$_html_sz) $_html_sz = 0.1; - $_html_offset = (1/$_html_sz).'em'; - echo '<div '.$_html_effect.' class="shadow" style="margin: '. - ((float)$example->margintop).'em '. - ((float)$example->marginright+1).'em '. - ((float)$example->marginbottom).'em '. - ((float)$example->marginleft).'em;'. - ((!empty($example->width)) ? "width: $example->width;" : ""). - '">'; - if(!empty($pres->examplebackground)) $_html_examplebackground = $pres->examplebackground; - if(!empty($this->objs[1]->examplebackground)) $_html_examplebackground = $this->objs[1]->examplebackground; - if(!empty($example->examplebackground)) $_html_examplebackground = $example->examplebackground; + if (!$this->pres->template == 'css') { + $_html_sz = (float) $example->fontsize; + if(!$_html_sz) $_html_sz = 0.1; + $_html_offset = (1/$_html_sz).'em'; + echo '<div '.$_html_effect.' class="shadow" style="margin: '. + ((float)$example->margintop).'em '. + ((float)$example->marginright+1).'em '. + ((float)$example->marginbottom).'em '. + ((float)$example->marginleft).'em;'. + ((!empty($example->width)) ? "width: $example->width;" : ""). + '">'; + if(!empty($pres->examplebackground)) $_html_examplebackground = $pres->examplebackground; + if(!empty($this->objs[1]->examplebackground)) $_html_examplebackground = $this->objs[1]->examplebackground; + if(!empty($example->examplebackground)) $_html_examplebackground = $example->examplebackground; +/* } if (($this->pres->template == 'css') and (isset($example->class))) { echo "<div class='{$example->class}'>"; } else { - echo '<div class="emcode" style="font-size: '.$_html_sz."em; margin: -$_html_offset 0 0 -$_html_offset;". +*/ echo '<div class="emcode" style="font-size: '.$_html_sz."em; margin: -$_html_offset 0 0 -$_html_offset;". ((!empty($_html_examplebackground)) ? "background: $_html_examplebackground;" : ''). (($example->type=='shell') ? 'font-family: monotype.com, courier, monospace; background: #000000; color: #ffffff; padding: 0px;' : ''). '">'; + } else { + if (isset($example->class)) { + echo "<div class='{$example->class}'>"; + } else { + echo "<div class='example'>"; + } } $example->highlight($this->slideDir); - echo "</div></div>\n"; + if (!$pres->template == 'css') { + echo "</div>"; + } + echo "</div>\n"; } if($example->result && (empty($example->condition) || isset(${$example->condition})) && (empty($example->required_extension) || extension_loaded($example->required_extension))) { - if(!$example->hide) echo '<div style="font-size: '.(4*(float)$example->fontsize/3)."em;\">Output</div>\n"; + if (!$example->hide) { + if ($this->pres->template == 'css' and (isset($example->class))) { + if (!isset($example->output_word)) { + $example->output_word = 'output:'; + } + echo "<div class='{$example->class}_output_text'>{$example->output_word}</div>\n"; + } else { + echo '<div style="font-size: '.(4*(float)$example->fontsize/3)."em;\">Output</div>\n"; + } + } $_html_sz = (float) $example->rfontsize; if(!$_html_sz) $_html_sz = 0.1; $_html_offset = (1/$_html_sz).'em'; @@ -393,16 +417,20 @@ if(!empty($this->objs[1]->outputbackground)) $_html_outputbackground = $this->objs[1]->outputbackground; if(!empty($example->outputbackground)) $_html_outputbackground = $example->outputbackground; if(!empty($example->anchor)) echo "<a name=\"$example->anchor\"></a>\n"; - echo '<div class="shadow" style="margin: '. - ((float)$example->margintop).'em '. - ((float)$example->marginright+1).'em '. - ((float)$example->marginbottom).'em '. - ((float)$example->marginleft).'em;'. - ((!empty($example->rwidth)) ? "width: $example->rwidth;" : ""). - '">'; - echo '<div '.$_html_effect.' class="output" style="font-size: '.$_html_sz."em; margin: -$_html_offset 0 0 -$_html_offset; ". - ((!empty($_html_outputbackground)) ? "background: $_html_outputbackground;" : ''). - "\">\n"; + if ($this->pres->template == 'css' and (isset($example->class))) { + echo "<div class='{$example->class}_output'>"; + } else { + echo '<div class="shadow" style="margin: '. + ((float)$example->margintop).'em '. + ((float)$example->marginright+1).'em '. + ((float)$example->marginbottom).'em '. + ((float)$example->marginleft).'em;'. + ((!empty($example->rwidth)) ? "width: $example->rwidth;" : ""). + '">'; + echo '<div '.$_html_effect.' class="output" style="font-size: '.$_html_sz."em; margin: -$_html_offset 0 0 -$_html_offset; ". + ((!empty($_html_outputbackground)) ? "background: $_html_outputbackground;" : ''). + "\">\n"; + } if(!empty($example->filename)) { $_html_filename = preg_replace('/\?.*$/','',$this->slideDir.$example->filename); switch($example->type) { @@ -414,7 +442,7 @@ break; case 'link': echo "<a href=\"$this->slideDir$example->filename\" class=\"resultlink\">$example->linktext</a><br />\n"; - break; + break; case 'nlink': echo "<a href=\"$this->slideDir$example->filename\" class=\"resultlink\" target=\"_blank\">$example->linktext</a><br />\n"; break; @@ -428,7 +456,7 @@ break; case 'system': system("DISPLAY=localhost:0 $this->slideDir$example->filename"); - break; + break; default: include $_html_filename; break; @@ -436,12 +464,26 @@ } else { switch($example->type) { default: - eval('?>'.$example->text); + if (isset($example->encoding)) { + $example->text = iconv('utf8', $example->encoding, $example->text); + ob_start(); + eval('?>'.$example->text); + $result = ob_get_contents(); + ob_end_clean(); + echo iconv($example->encoding, 'utf8', $result); + } + else + { + eval('?>'.$example->text); + } break; } } - echo "</div></div>\n"; -# if(!empty($example->anchor)) echo "</a>\n"; + if ($this->pres->template == 'css' and (isset($example->class))) { + echo "</div>\n"; + } else { + echo "</div></div>\n"; + } } } @@ -449,6 +491,16 @@ echo str_repeat("<br/>\n", $break->lines); } + function _div(&$div) { + $effect = ''; + if($div->effect) $effect = "effect=\"$div->effect\""; + echo "<div style='' $effect>"; + } + + function _div_end(&$div) { + echo "</div>"; + } + function _list(&$list) { if (!isset($list->bullets)) return; $align = ''; @@ -457,11 +509,11 @@ if(!empty($list->align)) $align = 'align="'.$list->align.'"'; echo "<div $align style=\"$style\">".markup_text($list->title)."</div>\n"; } - if (isset($list->class)) { - echo "<ul class='{$list->class}'>"; - } else { - echo '<ul class="pres">'; - } + if (isset($list->class)) { + echo "<ul class='{$list->class}'>"; + } else { + echo '<ul class="pres">'; + } while(list($k,$bul)=each($list->bullets)) { $bul->display(); } echo '</ul>'; } @@ -483,7 +535,7 @@ if(!empty($bullet->start)) { if(is_numeric($bullet->start)) { - $this->objs[$this->coid]->num = (int)$bullet->start; + $this->objs[$this->coid]->num = (int)$bullet->start; } else { $this->objs[$this->coid]->alpha = $bullet->start; } @@ -574,15 +626,15 @@ $markedText = ($bullet->text == ' ') ? $bullet->text : markup_text(htmlspecialchars($bullet->text)); if ($this->pres->template == 'css') { - if (isset($bullet->class)) { - $class = $bullet->class; - } else { - $class = "pres_bullet'"; - } - $attrs = ''; - if (isset($bullet->effect) && !empty($bullet->effect)) { - $attrs = " style='' effect='{$bullet->effect}'"; - } + if (isset($bullet->class)) { + $class = $bullet->class; + } else { + $class = "pres_bullet'"; + } + $attrs = ''; + if (isset($bullet->effect) && !empty($bullet->effect)) { + $attrs = " style='' effect='{$bullet->effect}'"; + } echo "<div $attrs><li class='$class'>$markedText</li></div>"; } else { echo "<div $eff_str style=\"position: relative;\"><li style=\"$style\">".'<tt>'.$symbol.'</tt> '.$markedText."</li></div>\n"; @@ -738,7 +790,7 @@ if(!empty($slide->logo1)) $logo1 = $slide->logo1; else $logo1 = $pres->logo1; if(!empty($slide->logoimage1url)) $logo1url = $slide->logoimage1url; - else $logo1url = $pres->logoimage1url; + else $logo1url = $pres->logoimage1url; if(!empty($logo1)) echo "<a href=\"$logo1url\"><img src=\"$logo1\" border=\"0\" align=\"left\"></a>\n"; echo "</td>\n"; if ($pres->navbartopiclinks) { @@ -807,7 +859,7 @@ $str = str_replace('(c)','©',$p->copyright); $str = str_replace('(R)','®',$str); echo "<div align\=\"center\" style=\"font-size: 1em\">$str</div>\n"; - } + } } } @@ -891,7 +943,7 @@ break; case 'system': system("DISPLAY=localhost:0 $this->slideDir$example->filename"); - break; + break; default: include $_html_filename; break; @@ -904,7 +956,7 @@ } } echo "</td></tr></table>\n"; -# if(!empty($example->anchor)) echo "</a>\n"; +# if(!empty($example->anchor)) echo "</a>\n"; } } @@ -981,9 +1033,9 @@ class flash extends html { function _slide(&$slide) { - global $pres; + global $pres; - list($dx,$dy) = getFlashDimensions($slide->titleFont,$slide->title,flash_fixsize($slide->titleSize)); + list($dx,$dy) = getFlashDimensions($slide->titleFont,$slide->title,flash_fixsize($slide->titleSize)); $dx = $this->winW; // full width ?> <div align="<?php echo $slide->titleAlign?>" class="sticky" id="stickyBar"> @@ -1042,7 +1094,7 @@ $str = str_replace('(c)','©',$p->copyright); $str = str_replace('(R)','®',$str); echo "<div align\=\"center\" style=\"font-size: 1em\">$str</div>\n"; - } + } } } @@ -1097,8 +1149,8 @@ $fs = font size */ function my_pdf_paginated_code(&$pdf, $data, $x, $y, $tm, $bm, $lm, $rm, $font, $fs) { - $data = strip_markups($data); - pdf_set_font($pdf, $font, $fs, 'winansi'); + $data = strip_markups($data); + pdf_set_font($pdf, $font, $fs, 'winansi'); $cw = pdf_stringwidth($pdf,'m'); // Width of 1 char - assuming monospace $linelen = (int)(($x-$lm-$rm)/$cw); // Number of chars on a line @@ -1124,7 +1176,7 @@ $ln = wordwrap($ln,$linelen); $out = explode("\n", $ln); } else { - $out = array($ln); + $out = array($ln); } foreach($out as $l) { $l = str_replace("\t",' ',$l); // 4-space tabs - should probably be an attribute @@ -1137,7 +1189,7 @@ $this->my_new_pdf_end_page($pdf); $this->my_new_pdf_page($pdf, $x, $y, true); - pdf_set_font($pdf, $font, $fs, 'winansi'); + pdf_set_font($pdf, $font, $fs, 'winansi'); pdf_set_text_pos($pdf, $lm, 60); $np = true; } @@ -1213,7 +1265,7 @@ } function _slide(&$slide) { - global $pres; + global $pres; $currentPres = $_SESSION['currentPres']; $p = $this->objs[1]; @@ -1222,7 +1274,7 @@ $this->pdf_cy = 25; // top-margin $this->pdf_cx = 40; if($this->objs[1]->template == 'titlepage') { - $p = $pres; + $p = $pres; $loc = $middle - 80 * ( !empty($p->title) + !empty($p->event) + !empty($p->date) + (!empty($p->speaker)||!empty($p->email)) + @@ -1300,13 +1352,13 @@ $this->page_index[$this->page_number] = strip_markups($slide->title); } - $this->pdf_cy += 30; + $this->pdf_cy += 30; if($this->slideNum) { pdf_moveto($this->pdf,40,$this->pdf_cy); - pdf_lineto($this->pdf,$this->pdf_x-40,$this->pdf_cy); + pdf_lineto($this->pdf,$this->pdf_x-40,$this->pdf_cy); pdf_stroke($this->pdf); } - $this->pdf_cy += 20; + $this->pdf_cy += 20; pdf_set_text_pos($this->pdf, $this->pdf_cx, $this->pdf_cy); } @@ -1356,7 +1408,7 @@ pdf_scale($this->pdf,1, -1); pdf_set_font($this->pdf, $this->pdf_font , 12, 'winansi'); $leading = pdf_get_value($this->pdf, "leading"); - $height = $inc = 12+$leading; + $height = $inc = 12+$leading; $txt = strip_markups($blurb->text); while(pdf_show_boxed($this->pdf, $txt, $this->pdf_cx+20, $this->pdf_y-$this->pdf_cy, $this->pdf_x-2*($this->pdf_cx-20), $height, $align, 'blind')!=0) $height+=$inc; @@ -1403,8 +1455,8 @@ switch($type) { case 1: - if(!strstr($image->filename,'blank')) - $im = pdf_open_gif($this->pdf, $this->slideDir.$image->filename); + if(!strstr($image->filename,'blank')) + $im = pdf_open_gif($this->pdf, $this->slideDir.$image->filename); break; case 2: $im = pdf_open_jpeg($this->pdf, $this->slideDir.$image->filename); @@ -1451,7 +1503,7 @@ pdf_place_image($this->pdf, $im, $x, ($this->pdf_y-$this->pdf_cy-$dy), $scale); pdf_restore($this->pdf); pdf_set_text_pos($this->pdf,$this->pdf_cx,$this->pdf_cy+$dy); - } + } } function _example(&$example) { @@ -1504,7 +1556,7 @@ break; } - } + } $this->pdf_cy = pdf_get_value($this->pdf, "texty"); if($example->result && $example->type != 'iframe' && (empty($example->condition) || isset(${$example->condition})) && (empty($example->required_extension) || extension_loaded($example->required_extension))) { if(!$example->hide) { @@ -1572,11 +1624,11 @@ // don't think we can do these in pdf break; case 'flash': - // Definitely can't do this one + // Definitely can't do this one break; case 'system': // system("DISPLAY=localhost:0 $this->slideDir$example->filename"); - break; + break; default: // Need something to turn html into pdf here? // Perhaps just output buffering and stripslashes @@ -1620,7 +1672,7 @@ } if(!empty($list->start)) { if(is_numeric($list->start)) { - $list->num = (int)$list->start; + $list->num = (int)$list->start; } else { $list->alpha = $list->start; } @@ -1634,7 +1686,7 @@ $this->pdf_cy = pdf_get_value($this->pdf, "texty"); pdf_set_font($this->pdf, $this->pdf_font, -12, 'winansi'); - $height=10; + $height=10; $txt = strip_markups($bullet->text); pdf_save($this->pdf); @@ -1642,7 +1694,7 @@ pdf_scale($this->pdf,1, -1); pdf_set_font($this->pdf, $this->pdf_font , 12, 'winansi'); $leading = pdf_get_value($this->pdf, "leading"); - $inc = $leading; + $inc = $leading; while(pdf_show_boxed($this->pdf, $txt, $this->pdf_cx+30, $this->pdf_y-$this->pdf_cy, $this->pdf_x-2*($this->pdf_cx+20), $height, 'left', 'blind')) $height+=$inc; pdf_restore($this->pdf); @@ -1767,7 +1819,7 @@ $this->pdf_cy = pdf_get_value($this->pdf, "texty"); pdf_set_font($this->pdf, $this->pdf_font, -12, 'winansi'); - $height=10; + $height=10; $txt = strip_markups($row_text[0]); while(pdf_show_boxed($this->pdf, $txt, 60, $this->pdf_cy, $this->pdf_x-120, $height, 'left', 'blind')) $height+=10; if( ($this->pdf_cy + $height) > $this->pdf_y-40 ) { @@ -1787,7 +1839,7 @@ } $this->pdf_cy+=$height; pdf_set_text_pos($this->pdf, $this->pdf_cx, $this->pdf_cy); - pdf_continue_text($this->pdf,""); + pdf_continue_text($this->pdf,""); $row_text = array(); } @@ -1814,7 +1866,7 @@ case 'left': default: - $x = $this->pdf_cx; + $x = $this->pdf_cx; break; } if($link->marginleft) $x += (int)(((float)$link->marginleft) * $cw); http://cvs.php.net/diff.php/pres2/objects.php?r1=1.155&r2=1.156&ty=u Index: pres2/objects.php diff -u pres2/objects.php:1.155 pres2/objects.php:1.156 --- pres2/objects.php:1.155 Thu Sep 2 02:54:14 2004 +++ pres2/objects.php Mon Sep 13 09:36:38 2004 @@ -24,15 +24,15 @@ } /* {{{ string markup_text($str) - *word* Bold - _word_ underline - %word% monospaced word (ie. %function()%) - ~word~ italics + *word* Bold + _word_ underline + %word% monospaced word (ie. %function()%) + ~word~ italics |rrggbb|word| Colour a word - ^N^ Superscript - @N@ Subscript - **word** Blink - #id# Entity + ^N^ Superscript + @N@ Subscript + **word** Blink + #id# Entity */ function markup_text($str) { $ret = $str; @@ -81,7 +81,7 @@ $format = '%'.$lnwidth."d: %s\n"; $lined_text = ''; while (list ($num, $line) = each ($lines)) { - $lined_text .= sprintf($format, $num + 1, $line); + $lined_text .= sprintf($format, $num + 1, $line); } return $lined_text; } @@ -117,12 +117,12 @@ // {{{ Presentation List Classes class _tag { - function display() { - global $mode; - - $class = get_class($this); - $mode->$class($this); - } + function display() { + global $mode; + + $class = get_class($this); + $mode->$class($this); + } } class _presentation extends _tag { @@ -187,17 +187,17 @@ $this->font = 'fonts/Verdana.fdb'; $this->align = 'left'; $this->talign = 'left'; - $this->fontsize = '2.66em'; + $this->fontsize = '2.66em'; $this->marginleft = '1em'; $this->marginright = '1em'; - $this->margintop = '0.2em'; + $this->margintop = '0.2em'; $this->marginbottom = '0em'; - $this->title = ''; + $this->title = ''; $this->titlecolor = '#000000'; - $this->text = ''; - $this->textcolor = '#000000'; - $this->effect = ''; - $this->type = ''; + $this->text = ''; + $this->textcolor = '#000000'; + $this->effect = ''; + $this->type = ''; } } @@ -363,18 +363,18 @@ echo $this->text."\n"; break; case 'perl': - $text = str_replace('"', '\\"', $this->text); + $text = str_replace('"', '\\"', $this->text); print `echo "{$text}" | perl2html -cs`; break; case 'c': - $text = str_replace('"', '\\"', $this->text); + $text = str_replace('"', '\\"', $this->text); print `echo "{$text}" | c2html -cs`; break; case 'xml': $prog = trim(`which code2html`); if (!empty($prog)) { - $text = str_replace('"', '\\"', $this->text); + $text = str_replace('"', '\\"', $this->text); echo "<pre>\n"; print `echo "{$text}" | code2html -lhtml --no-header`; echo "</pre>"; @@ -403,10 +403,22 @@ } // }}} + // {{{ Div Class + class _div extends _tag { + function _div() { + $this->effect = ''; + } + } + + class _div_end extends _tag { + /* empty */ + } + // }}} + // {{{ List Class class _list extends _tag { function _list() { - $this->fontsize = '3em'; + $this->fontsize = '3em'; $this->marginleft = '0em'; $this->marginright = '0em'; $this->num = 1; @@ -432,7 +444,7 @@ // {{{ Table Class class _table extends _tag { function _table() { - $this->fontsize = '3em'; + $this->fontsize = '3em'; $this->marginleft = '0em'; $this->marginright = '0em'; $this->border = 0; @@ -463,11 +475,11 @@ function _link() { $this->href = ''; $this->align = 'left'; - $this->fontsize = '2em'; - $this->textcolor = '#000000'; + $this->fontsize = '2em'; + $this->textcolor = '#000000'; $this->marginleft = '0em'; $this->marginright = '0em'; - $this->margintop = '0em'; + $this->margintop = '0em'; $this->marginbottom = '0em'; } @@ -486,13 +498,13 @@ // {{{ Divider Class class _divide extends _tag { - /* empty */ + /* empty */ } // }}} // {{{ Footer Class class _footer extends _tag { - /* empty */ + /* empty */ } // }}} ?>