Tuesday 24 January 2006 11:18:22 am
Thanks Xavier, Great extension and absolutely perfect for my needs. Hopefully it will be included in eZ before too long. As suggested I made some changes, which were basically to check for dom elements called "embed" and to also check if they have an attribute of "object_id". So the function "modify" is now as follows:
function modify( &$tpl, &$operatorName, &$operatorParameters, &$rootNamespace, &$currentNamespace, &$operatorValue, &$namedParameters )
{
if (!isset($namedParameters['xmlattribute']->DataText))
return "should be an attribute";
$xmldata =& $namedParameters['xmlattribute']->DataText;
$xml = new eZXML();
$dom =& $xml->domTree( $xmldata );
if ( is_object ($dom) )
{
$objects =& $dom->elementsByName( "embed" );
foreach ($objects as $object)
{
$attributes=& $object->attributes();
foreach ($attributes as $attribute)
{
if ($attribute->Name == "object_id")
$operatorValue[] = $attribute->content;
}
}
}
}
I haven't done a check for the eZ version, but this is working perfectly on my 3.6 installation. Thanks again, Ben Pirt
|