cvs: pres2 / display.php keyboard.js.php

From: Date: Sat, 22 Apr 2006 10:31:37 +0000
Subject: cvs: pres2 / display.php keyboard.js.php
Groups: php.pres 
Request: Send a blank email to pres+get-1296@lists.php.net to get a copy of this message
derick Sat Apr 22 10:31:37 2006 UTC Modified files: /pres2 display.php keyboard.js.php Log: - Allow CSS styling of tables and cells - If the GET parameter effects is set to no, do not render dhtml effects. http://cvs.php.net/viewcvs.cgi/pres2/display.php?r1=1.36&r2=1.37&diff_format=u Index: pres2/display.php diff -u pres2/display.php:1.36 pres2/display.php:1.37 --- pres2/display.php:1.36 Mon Apr 17 00:44:47 2006 +++ pres2/display.php Sat Apr 22 10:31:37 2006 @@ -697,12 +697,18 @@ if(!empty($table->width)) { $width = $table->width; } - echo '<table '.$align.' width="'.$width.'" border="'.$table->border.'" '.(isset($table->bgcolor)?"bgcolor=\"{$table->bgcolor}\"":'').'>'; + if ($this->pres->template == 'css') { + $class = isset($table->class) ? " class='{$table->class}'" : ""; + echo "<table$class>"; + } else { + echo '<table '.$align.' width="'.$width.'" border="'.$table->border.'" '.(isset($table->bgcolor)?"bgcolor=\"{$table->bgcolor}\"":'').'>'; + } while(list($k,$cell)=each($table->cells)) { if(!($i % $table->columns)) { echo "<tr>\n"; } echo " <td "; + if(isset($cell->class)) echo "class=\"".$cell->class."\""; if(isset($cell->align)) echo "align=\"".$cell->align."\""; if(isset($cell->bgcolor)) echo "bgcolor=\"".$cell->bgcolor."\""; echo ">"; @@ -717,6 +723,10 @@ } function _cell(&$cell) { + if ($this->pres->template = "css") { + echo markup_text($cell->text); + return; + } $style=''; if(!empty($cell->fontsize)) $style .= "font-size: ".$cell->fontsize.';'; else if(!empty($this->objs[$this->coid]->fontsize)) $style .= "font-size: ".(2*(float)$this->objs[$this->coid]->fontsize/3).'em;'; http://cvs.php.net/viewcvs.cgi/pres2/keyboard.js.php?r1=1.18&r2=1.19&diff_format=u Index: pres2/keyboard.js.php diff -u pres2/keyboard.js.php:1.18 pres2/keyboard.js.php:1.19 --- pres2/keyboard.js.php:1.18 Thu Jul 1 11:42:03 2004 +++ pres2/keyboard.js.php Sat Apr 22 10:31:37 2006 @@ -52,6 +52,7 @@ } ?> +<?php if (!isset($_GET['effects']) || ($_GET['effects'] != 'no')) { ?> // find any div objects with an effect attribute var divs = document.getElementsByTagName('div'); for (var i=0; i < divs.length; i++) { @@ -70,6 +71,7 @@ effects[effects.length] = divs[i]; } } +<?php } ?> } function fixNavigation() { //helper function for making navbar sticky

« previous php.pres (#1296) next »