cvs: pres2 / display.php

From: Date: Wed, 30 Jun 2004 08:46:41 +0000
Subject: cvs: pres2 / display.php
Groups: php.pres 
Request: Send a blank email to pres+get-1002@lists.php.net to get a copy of this message
derick Wed Jun 30 04:46:41 2004 EDT Modified files: /pres2 display.php Log: - Allow example's to be CSS-styled too when a class attribute is set for them. If not we fall back to the 'default' behavior. http://cvs.php.net/diff.php/pres2/display.php?r1=1.15&r2=1.16&ty=u Index: pres2/display.php diff -u pres2/display.php:1.15 pres2/display.php:1.16 --- pres2/display.php:1.15 Wed Jun 23 22:52:01 2004 +++ pres2/display.php Wed Jun 30 04:46:41 2004 @@ -362,10 +362,14 @@ if(!empty($this->objs[1]->examplebackground)) $_html_examplebackground = $this->objs[1]->examplebackground; if(!empty($example->examplebackground)) $_html_examplebackground = $example->examplebackground; - 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;' : ''). - '">'; + if (($this->pres->template == 'css') and (isset($example->class))) { + echo "<div class='{$example->class}'>"; + } else { + echo '<div class="'. $class. '" 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;' : ''). + '">'; + } $example->highlight($this->slideDir);

« previous php.pres (#1002) next »