Skip to content

Commit 9ecd577

Browse files
committed
Adds checks for eztags contstants to improve use of 'eep at' across different versions of eZ Tags
1 parent a6fd550 commit 9ecd577

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

lib/AttributeFunctions.php

+21-5
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
</browse_location>
9595
</ezobjectrelationlist>
9696
97+
<!-- options depend on the eZ Tags version used; some may not or no longer be available; check extension/eztags/datatypes/eztags/eztagstype.php -->
9798
<eztags>
9899
<subtree>0</subtree>
99100
<hideroot>1</hideroot>
@@ -380,11 +381,26 @@ static function updateParameters( $classAttribute, $newAttributeXPath )
380381
break;
381382

382383
case "eztags":
383-
$classAttribute->setAttribute( eZTagsType::SUBTREE_LIMIT_FIELD, (integer )trim( $newAttributeXPath->query( "//newattribute/additional_for_specific_datatype/eztags/subtree" )->item( 0 )->nodeValue ) );
384-
$classAttribute->setAttribute( eZTagsType::SHOW_DROPDOWN_FIELD, (integer )trim( $newAttributeXPath->query( "//newattribute/additional_for_specific_datatype/eztags/dropdown" )->item( 0 )->nodeValue ) );
385-
$classAttribute->setAttribute( eZTagsType::HIDE_ROOT_TAG_FIELD, (integer )trim( $newAttributeXPath->query( "//newattribute/additional_for_specific_datatype/eztags/hideroot" )->item( 0 )->nodeValue ) );
386-
$classAttribute->setAttribute( eZTagsType::MAX_TAGS_FIELD, (integer )trim( $newAttributeXPath->query( "//newattribute/additional_for_specific_datatype/eztags/maxtags" )->item( 0 )->nodeValue ) );
387-
$classAttribute->setAttribute( eZTagsType::EDIT_VIEW_FIELD, (string )trim( $newAttributeXPath->query( "//newattribute/additional_for_specific_datatype/eztags/editview" )->item( 0 )->nodeValue ) );
384+
if( defined( 'eZTagsType::SUBTREE_LIMIT_FIELD' ) )
385+
{
386+
$classAttribute->setAttribute( eZTagsType::SUBTREE_LIMIT_FIELD, (integer )trim( $newAttributeXPath->query( "//newattribute/additional_for_specific_datatype/eztags/subtree" )->item( 0 )->nodeValue ) );
387+
}
388+
if( defined( 'eZTagsType::SHOW_DROPDOWN_FIELD' ) )
389+
{
390+
$classAttribute->setAttribute( eZTagsType::SHOW_DROPDOWN_FIELD, (integer )trim( $newAttributeXPath->query( "//newattribute/additional_for_specific_datatype/eztags/dropdown" )->item( 0 )->nodeValue ) );
391+
}
392+
if( defined( 'eZTagsType::HIDE_ROOT_TAG_FIELD' ) )
393+
{
394+
$classAttribute->setAttribute( eZTagsType::HIDE_ROOT_TAG_FIELD, (integer )trim( $newAttributeXPath->query( "//newattribute/additional_for_specific_datatype/eztags/hideroot" )->item( 0 )->nodeValue ) );
395+
}
396+
if( defined( 'eZTagsType::MAX_TAGS_FIELD' ) )
397+
{
398+
$classAttribute->setAttribute( eZTagsType::MAX_TAGS_FIELD, (integer )trim( $newAttributeXPath->query( "//newattribute/additional_for_specific_datatype/eztags/maxtags" )->item( 0 )->nodeValue ) );
399+
}
400+
if( defined( 'eZTagsType::EDIT_VIEW_FIELD' ) )
401+
{
402+
$classAttribute->setAttribute( eZTagsType::EDIT_VIEW_FIELD, (string )trim( $newAttributeXPath->query( "//newattribute/additional_for_specific_datatype/eztags/editview" )->item( 0 )->nodeValue ) );
403+
}
388404
break;
389405

390406
case "ezmatrix":

0 commit comments

Comments
 (0)