Subversion Repositories PHPX

Compare Revisions

Last modification

Ignore whitespace Rev 18 → Rev 19

/trunk/features.class.php
30,6 → 30,14
protected $urns = array();
/**
* <code>true</code> generates form controls for submitting test case
* results
*
* @var bool
*/
protected $testcase = false;
/**
* The list of language features
*
* @var array[Features]
53,7 → 61,8
{
$aVars = get_class_vars(get_class($this));
while ((list($key, $value) = each($aVars)))
 
foreach ($aVars as $key => $value)
{
if (isset($a[$key]))
{
60,7 → 69,7
$this->$key = $a[$key];
}
}
 
/* Inform items of ourself so that URNs can be used for links */
if (is_array($this->items))
{
83,13 → 92,27
}
}
/*
* Protected properties may be read, but not written
*/
public function __get($property)
{
if (property_exists(get_class($this), $property))
{
return $this->$property;
}
}
public function printHeaders()
{
foreach ($this->versions as $ver)
foreach ($this->versions as $key => $ver)
{
if ($key || $this->testcase)
{
?>
<th><?php echo $ver; ?></th>
<?php
}
}
}
222,7 → 245,7
{
$aVars = get_class_vars(__CLASS__);
while ((list($key, $value) = each($aVars)))
foreach ($aVars as $key => $value)
{
if (isset($params[$key]))
{
419,9 → 442,11
?></th>
<?php
$versions = $this->versions;
$testcase = false;
if (!is_null($this->list))
{
$versions =& $this->list->versions;
$testcase = $this->list->testcase;
}
 
static $row = 0;
435,13 → 460,15
$column++;
$id = "td$row-$column";
$ver = isset($thisVersions[$key]) ? $thisVersions[$key] : '';
if ($key || $testcase)
{
?>
<td<?php
if (!$key)
{
echo " id='$id'";
}
if (!$key)
{
echo " id='$id'";
}
echo $this->getAssumed($ver) . $this->getTested($ver);
if (!$key)
459,7 → 486,7
. '"';
}
else
{
{
echo ' title="Not applicable: No automated test case'
. ' is available for this feature. If possible, please'
. ' click the feature code in the first column to run'
466,6 → 493,14
. ' a manual test."';
}
}
else
{
echo ' title="'
. htmlspecialchars(
preg_replace('/<.*?>/', '', $value),
ENT_COMPAT, FEATURES_ENCODING)
. '"';
}
?>><?php
if ($key)
{
478,14 → 513,15
}
}
else
{
if (!empty($ver))
{
if (!empty($ver) && $testcase)
{
?><script type="text/javascript">
// <![CDATA[
var s = test(<?php echo $ver; ?>, '<span title="Supported">+<\/span>',
'<span title="Not supported">&#8722;<\/span>');
tryThis("document.write(s);",
var s = test(<?php echo $ver; ?>,
'<input title="Supported" name="<?php echo htmlspecialchars($this->title, ENT_COMPAT, FEATURES_ENCODING); ?>" value="+" readonly>',
'<input title="Not supported" name="<?php echo htmlspecialchars($this->title, ENT_COMPAT, FEATURES_ENCODING); ?>" value="&#8722;" readonly>');
jsx.tryThis("document.write(s);",
"document.getElementById('<?php echo $id; ?>').appendChild("
+ "document.createTextNode(s));");
// ]]>
492,12 → 528,13
</script><?php
}
else
{
{
echo '<abbr>N/A</abbr>';
}
}
?></td>
<?php
}
}
?>
</tr>