Пример #1
0
if ( $http->hasPostVariable( 'DeleteSubtreeButton' ) )
{
    processDropdownLimitations( $policy, $currentModule, $currentFunction, $currentFunctionLimitations );

    // store the temporary policy
    if ( $http->hasPostVariable( 'DeleteSubtreeIDArray' ) )
    {
        $deletedIDList = $http->postVariable( 'DeleteSubtreeIDArray' );

        $db = eZDB::instance();
        $db->begin();
        foreach ( $deletedIDList as $deletedID )
        {
            $subtree = eZContentObjectTreeNode::fetch( $deletedID, false, false );
            $path = $subtree['path_string'];
            eZPolicyLimitationValue::removeByValue( $path, $policyID );
        }
        $db->commit();
    }

    /* Clean up policy cache */
    eZUser::cleanupCache();
}

// Fetch node limitations
$nodeIDList = array();
$nodeLimitation = eZPolicyLimitation::fetchByIdentifier( $policyID, 'Node' );
if ( $nodeLimitation != null )
{
    $nodeLimitationID = $nodeLimitation->attribute( 'id' );
    $nodeLimitationValues = eZPolicyLimitationValue::fetchList( $nodeLimitationID );
Пример #2
0
 $db->begin();
 if ($http->hasPostVariable('DeleteNodeButton') and $http->hasSessionVariable('BrowsePolicyID')) {
     if ($http->hasPostVariable('DeleteNodeIDArray')) {
         $deletedIDList = $http->postVariable('DeleteNodeIDArray');
         foreach ($deletedIDList as $deletedID) {
             eZPolicyLimitationValue::removeByValue($deletedID, $http->sessionVariable('BrowsePolicyID'));
         }
     }
 }
 if ($http->hasPostVariable('DeleteSubtreeButton') and $http->hasSessionVariable('BrowsePolicyID')) {
     if ($http->hasPostVariable('DeleteSubtreeIDArray')) {
         $deletedIDList = $http->postVariable('DeleteSubtreeIDArray');
         foreach ($deletedIDList as $deletedID) {
             $subtree = eZContentObjectTreeNode::fetch($deletedID, false, false);
             $path = $subtree['path_string'];
             eZPolicyLimitationValue::removeByValue($path, $http->sessionVariable('BrowsePolicyID'));
         }
     }
 }
 if ($http->hasPostVariable('Limitation') and $http->hasSessionVariable('BrowsePolicyID')) {
     $http->removeSessionVariable('BrowsePolicyID');
 }
 if ($http->hasSessionVariable('BrowseCurrentModule')) {
     $currentModule = $http->sessionVariable('BrowseCurrentModule');
 }
 if ($http->hasPostVariable('CurrentModule')) {
     $currentModule = $http->postVariable('CurrentModule');
 }
 $mod = eZModule::exists($currentModule);
 $functions = $mod->attribute('available_functions');
 $functionNames = array_keys($functions);