Skip to content

Commit

Permalink
EZP-26182: Support class limitation in block custom attributes (#79)
Browse files Browse the repository at this point in the history
(cherry picked from commit f27c268)
  • Loading branch information
peterkeung authored and andrerom committed Feb 14, 2017
1 parent 124b0f6 commit 5f0e056
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -890,6 +890,7 @@ function customObjectAttributeHTTPAction( $http, $action, $contentObjectAttribut
$page = $contentObjectAttribute->content();
$zone = $page->getZone( $params[1] );
$block = $zone->getBlock( $params[2] );
$customAttributeIdentifier = $params[3];
$blockINI = eZINI::instance( 'block.ini' );

$browseParameters = array( 'action_name' => 'CustomAttributeBrowse',
Expand All @@ -902,12 +903,15 @@ function customObjectAttributeHTTPAction( $http, $action, $contentObjectAttribut
if( $blockINI->hasVariable( $block->attribute( 'type' ), 'CustomAttributeStartBrowseNode' ) )
{
$customAttributeStartBrowseNode = $blockINI->variable( $block->attribute( 'type' ), 'CustomAttributeStartBrowseNode' );
$customAttributeIdentifier = $params[3];
if( isset( $customAttributeStartBrowseNode[$customAttributeIdentifier] ) )
{
$browseParameters['start_node'] = $customAttributeStartBrowseNode[$customAttributeIdentifier];
}
}
if( $blockINI->hasVariable( $block->attribute( 'type' ), 'CustomAttributeAllowedClasses_' . $customAttributeIdentifier ) )
{
$browseParameters['class_array'] = $blockINI->variable( $block->attribute( 'type' ), 'CustomAttributeAllowedClasses_' . $customAttributeIdentifier );
}

eZContentBrowse::browse( $browseParameters, $module );
break;
Expand Down
Expand Up @@ -78,6 +78,8 @@ RootSubtree=1
# UseBrowseMode[node_id]=true
# Optional: set the browse mode start node for a custom attribute
# CustomAttributeStartBrowseNode[node_id]=<node_id>
# Optional: limit the browse mode selection to specific classes
# CustomAttributeAllowedClasses_node_id[]=image
# ViewList[]=variation1
# ViewName[variation1]=Main story 1
#
Expand Down

0 comments on commit 5f0e056

Please sign in to comment.