PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTML » HTML_QuickForm » Bug #1860

Change order of blockname matching in ITDynamic renderer

Details

Request #1860Change order of blockname matching in ITDynamic renderer
Submitted2004-07-13 11:52 UTC
Fromc dot herold at o-xygen dot de
StatusWont fix
PackageHTML_QuickForm
PHP Version4.3.7
Roadmaps(Not assigned)

Comments

[2004-07-13 11:52 UTC] c dot herold at o-xygen dot de

Description:
------------
The ITDynamic renderer first tries to find a block named {prefix}_{element_type} and then {prefix}_{element_name}. I would expect the order to be reversed, as an element's name is definitely more precise than it's type.

Reproduce code:
---------------
in file ITDynamic.php
---------------------
function _matchBlock(&$element)
{
[...]
if ($this->_tpl->blockExists($prefix . '_' . $type)) {
return $prefix . '_' . $type;
} elseif ($this->_tpl->blockExists($prefix . '_' . $name)) {
return $prefix . '_' . $name;
} else {
return $prefix . '_element';
}
}

replace with:
-------------
function _matchBlock(&$element)
{
[...]
if ($this->_tpl->blockExists($prefix . '_' . $name)) {
return $prefix . '_' . $name;
} elseif ($this->_tpl->blockExists($prefix . '_' . $type)) {
return $prefix . '_' . $type;
} else {
return $prefix . '_element';
}
}