$th){ if( isset($th['condition']) ){ $c = @eval( 'return '.addslashes($th['condition']).';' ); if (!$c){ unset($_thead[$key]); continue; } } if( isset($th['_th']) ){ $class = $th['_th']; } if ( $i==1 && strpos($key,'_')!==false ) { $class .= ' row-selected'; }else{ $class=''; } $class = 'class="'.$class.'"'; echo "'; $i++; } ?>
"; if ( !is_array($th) ) { echo "$th"; }else if( strpos($key,'_')===0 ){ echo $th['th']; }else if( isset($th['_title'] )){ echo $th['_title']; if ( !isset($th['tag']) ) { $_thead[$key]['tag'] = 'a'; } }else{ echo $key; $operator[$key]=$th; } echo '
createElement('img'); $img->setAttribute('src',$td); $ele = $Doc->createElement($_thead[$key]['tag']); $ele->appendChild($img); }else{ $ele = $Doc->createElement($_thead[$key]['tag'],$td); } //为元素添加属性 foreach ($_thead[$key] as $k=>$v) { if(strtolower($k)!='_title' && strtolower($k)!='_img' &&strtolower($k)!='tag' && strtolower($k)!='func'){ $_bool = true; $_v = preg_replace_callback('/\$([a-zA-Z_]+)/',function($matches) use($row,&$_bool) { if ($row[$matches[1]]===null || !is_scalar($row[$matches[1]])) { $_bool = false; } return ($row[$matches[1]]); },$v); if ($_bool) { if( strtolower($k)=='url' || strtolower($k)=='href' ){ $_v = U($_v); } }else{ $_v=''; } $ele->setAttribute($k,$_v); } } $Doc->appendChild($ele); echo $Doc->saveHTML(); }else{ echo $td; } ?> $v){ if(is_array($v)){ if( !isset($v['tag']) ){ $v['tag']='a'; } $Doc = new DOMDocument('1.0','utf-8'); $ele = $Doc->createElement($v['tag'],$k); foreach ($v as $attr=>$value){ $_bool = true; $_value = preg_replace_callback('/\$([a-zA-Z_]+)/',function($matches) use($row,&$_bool,$attr) { if ($row[$matches[1]]===null || !is_scalar($row[$matches[1]])) { $_bool=false; } return ($row[$matches[1]]); },$value); if( strtolower($attr)=='condition' ){ if ( $_bool ) { $_c = @eval( 'return '.addslashes($_value).';' ); if (!$_c){ continue 2; } }else{ continue 2; } } if( strtolower($attr)!='tag' && strtolower($attr)!='condition' ){ if( strtolower($attr)=='url' || strtolower($attr)=='href' ){ $_value = U($_value); } $ele->setAttribute($attr,$_value); } } $Doc->appendChild($ele); echo $Doc->saveHTML(); }else{ $_v = preg_replace_callback('/\$([a-zA-Z_]+)/',function($matches) use($row) { return ($row[$matches[1]]); },$v); $_v = U($_v); echo "".$k.''.PHP_EOL; } } ?>
aOh! 暂时还没有内容!