| [ Index ] |
PHP Cross Reference of Web Application Component Toolkit |
[Summary view] [Print] [Text view]
1 <?php 2 //-------------------------------------------------------------------------------- 3 // Copyright 2003 Procata, Inc. 4 // Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) 5 //-------------------------------------------------------------------------------- 6 /** 7 * @package WACT_TAG 8 * @version $Id: rowodd.prop.php,v 1.2 2004/11/18 04:22:49 jeffmoore Exp $ 9 */ 10 11 PropertyDictionary::registerProperty( 12 new PropertyInfo('ListRowOdd', 'list:LIST', 'ListRowOddProperty'), __FILE__); 13 14 class ListRowOddProperty extends CompilerProperty { 15 16 var $tempvar; 17 var $hasIncrement = FALSE; 18 19 function generateScopeEntry(&$code) { 20 $this->tempvar = $code->getTempVariable(); 21 $code->writePHP('$' . $this->tempvar . ' = 0;'); 22 } 23 24 /** 25 * Generate setup code for an expression reference 26 * @param CodeWriter 27 * @return void 28 * @access protected 29 */ 30 function generatePreStatement(&$code) { 31 if (!$this->hasIncrement) { 32 $this->hasIncrement = TRUE; 33 $code->writePHP('$' . $this->tempvar . '++;'); 34 } 35 } 36 37 /** 38 * Generate the code to read the data value at run time 39 * Must generate only a valid PHP Expression. 40 * @param CodeWriter 41 * @return void 42 * @access protected 43 */ 44 function generateExpression(&$code) { 45 $code->writePHP('(Boolean) ( $' . $this->tempvar . ' % 2)'); 46 } 47 48 } 49 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Sun Nov 28 19:36:09 2004 | Cross-referenced by PHPXref 0.5 |