当前位置: 首页>>代码示例>>PHP>>正文


PHP eZPolicyLimitation::createNew方法代码示例

本文整理汇总了PHP中eZPolicyLimitation::createNew方法的典型用法代码示例。如果您正苦于以下问题:PHP eZPolicyLimitation::createNew方法的具体用法?PHP eZPolicyLimitation::createNew怎么用?PHP eZPolicyLimitation::createNew使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eZPolicyLimitation的用法示例。


在下文中一共展示了eZPolicyLimitation::createNew方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

    public function setUp()
    {
        parent::setUp();

        $this->policy = eZPolicy::createNew(
            1, array( 'ModuleName' => 'foo', 'FunctionName' => 'bar' )
        );

        eZPolicyLimitation::createNew(
            $this->policy->attribute( 'id' ), 'Owner'
        );
    }
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:12,代码来源:ezsubtreenotificationrule_regression.php

示例2: processDropdownLimitations

/**
 * Applies the POST submitted limitations as found in the dropdowns
 * @param eZPolicy $policy
 * @param string $currentModule
 * @param string $currentFunction
 * @param array $currentFunctionLimitations
 *
 * @return bool True if limitations were found, false otherwise
 */
function processDropdownLimitations( &$policy, $currentModule, $currentFunction, $currentFunctionLimitations )
{
    $hasLimitation = false;

    $http = eZHTTPTool::instance();

    $db = eZDB::instance();
    $db->begin();

    foreach ( $currentFunctionLimitations as $functionLimitation )
    {
        if ( $http->hasPostVariable( $functionLimitation['name'] ) and
            $functionLimitation['name'] != 'Node' and
            $functionLimitation['name'] != 'Subtree' )
        {
            $limitationValueList = $http->postVariable( $functionLimitation['name'] );

            if ( !in_array('-1', $limitationValueList ) )
            {
                $hasLimitation = true;
                $policyLimitation = eZPolicyLimitation::createNew( $policy->attribute( 'id' ),
                                                                   $functionLimitation['name'] );
                foreach ( $limitationValueList as $limitationValue )
                {
                    eZPolicyLimitationValue::createNew( $policyLimitation->attribute( 'id' ), $limitationValue );
                }
            }
        }
    }

    $db->commit();

    return $hasLimitation;
}
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:43,代码来源:policyedit.php

示例3: array

             $node = eZContentObjectTreeNode::fetch($nodeID);
             $nodeList[] = $node;
         }
     }
 }
 if ($http->hasPostVariable('SelectedNodeIDArray') and $http->postVariable('BrowseActionName') == 'FindLimitationSubtree' and !$http->hasPostVariable('BrowseCancelButton')) {
     $selectedSubtreeIDList = $http->postVariable('SelectedNodeIDArray');
     if ($http->hasSessionVariable('BrowsePolicyID')) {
         $policy = eZPolicy::fetch($http->sessionVariable('BrowsePolicyID'));
     } else {
         $policy = eZPolicy::createNew($roleID, array('ModuleName' => $currentModule, 'FunctionName' => $currentFunction, 'Limitation' => ''));
         $http->setSessionVariable('BrowsePolicyID', $policy->attribute('id'));
     }
     $subtreeLimitation = eZPolicyLimitation::fetchByIdentifier($policy->attribute('id'), 'Subtree');
     if ($subtreeLimitation == null) {
         $subtreeLimitation = eZPolicyLimitation::createNew($policy->attribute('id'), 'Subtree');
     }
     foreach ($selectedSubtreeIDList as $nodeID) {
         if (!in_array($nodeID, $subtreeIDList)) {
             $subtree = eZContentObjectTreeNode::fetch($nodeID);
             $pathString = $subtree->attribute('path_string');
             $policyLimitationValue = eZPolicyLimitationValue::createNew($subtreeLimitation->attribute('id'), $pathString);
             $subtreeList[] = $subtree;
         }
     }
 }
 if ($http->hasPostVariable('Limitation') && count($currentFunctionLimitations) == 0) {
     $currentModule = $http->postVariable('CurrentModule');
     $currentFunction = $http->postVariable('ModuleFunction');
     eZDebugSetting::writeDebug('kernel-role-edit', $currentModule, 'currentModule');
     $policy = eZPolicy::createNew($roleID, array('ModuleName' => $currentModule, 'FunctionName' => $currentFunction));
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:31,代码来源:edit.php

示例4: array

             $node = eZContentObjectTreeNode::fetch($nodeID);
             $nodeList[] = $node;
         }
     }
 }
 if ($http->hasPostVariable('SelectedNodeIDArray') and $http->postVariable('BrowseActionName') == 'FindLimitationSubtree' and !$http->hasPostVariable('BrowseCancelButton')) {
     $selectedSubtreeIDList = $http->postVariable('SelectedNodeIDArray');
     if ($http->hasSessionVariable('BrowsePolicyID')) {
         $policy = eZPolicy::fetch($http->sessionVariable('BrowsePolicyID'));
     } else {
         $policy = eZPolicy::createNew($roleID, array('ModuleName' => $currentModule, 'FunctionName' => $currentFunction, 'Limitation' => ''));
         $http->setSessionVariable('BrowsePolicyID', $policy->attribute('id'));
     }
     $subtreeLimitation = eZPolicyLimitation::fetchByIdentifier($policy->attribute('id'), 'Subtree');
     if ($subtreeLimitation == null) {
         $subtreeLimitation = eZPolicyLimitation::createNew($policy->attribute('id'), 'Subtree', $currentModule, $currentFunction);
     }
     foreach ($selectedSubtreeIDList as $nodeID) {
         if (!in_array($nodeID, $subtreeIDList)) {
             $subtree = eZContentObjectTreeNode::fetch($nodeID);
             $pathString = $subtree->attribute('path_string');
             $policyLimitationValue = eZPolicyLimitationValue::createNew($subtreeLimitation->attribute('id'), $pathString);
             $subtreeList[] = $subtree;
         }
     }
 }
 if ($http->hasPostVariable('Limitation') && count($currentFunctionLimitations) == 0) {
     $currentModule = $http->postVariable('CurrentModule');
     $currentFunction = $http->postVariable('ModuleFunction');
     eZDebugSetting::writeDebug('kernel-role-edit', $currentModule, 'currentModule');
     $policy = eZPolicy::createNew($roleID, array('ModuleName' => $currentModule, 'FunctionName' => $currentFunction));
开发者ID:nlenardou,项目名称:ezpublish,代码行数:31,代码来源:edit.php

示例5: copy

 function copy($policyID)
 {
     $newParameter = eZPolicyLimitation::createNew($policyID, $this->attribute('identifier'));
     foreach ($this->attribute('values') as $value) {
         $value->copy($newParameter->attribute('id'));
     }
 }
开发者ID:nfrp,项目名称:ezpublish,代码行数:7,代码来源:ezpolicylimitation.php

示例6: foreach

        $nodeLimitation = eZPolicyLimitation::createNew($policyID, "Node", $currentModule, $currentFunction);
    }
    foreach ($selectedNodeIDList as $nodeID) {
        if (!in_array($nodeID, $nodeIDList)) {
            $nodeLimitationValue = eZPolicyLimitationValue::createNew($nodeLimitation->attribute('id'), $nodeID);
            $node = eZContentObjectTreeNode::fetch($nodeID);
            $nodeList[] = $node;
        }
    }
}
if ($http->hasPostVariable("SelectedNodeIDArray") and $http->postVariable("BrowseActionName") == "FindLimitationSubtree" and !$http->hasPostVariable('BrowseCancelButton')) {
    $selectedSubtreeIDList = $http->postVariable("SelectedNodeIDArray");
    $db = eZDB::instance();
    $db->begin();
    if ($subtreeLimitation == null) {
        $subtreeLimitation = eZPolicyLimitation::createNew($policyID, "Subtree", $currentModule, $currentFunction);
    }
    foreach ($selectedSubtreeIDList as $nodeID) {
        if (!isset($subtreeIDList) or !in_array($nodeID, $subtreeIDList)) {
            $subtree = eZContentObjectTreeNode::fetch($nodeID);
            $pathString = $subtree->attribute('path_string');
            $policyLimitationValue = eZPolicyLimitationValue::createNew($subtreeLimitation->attribute('id'), $pathString);
            $subtreeList[] = $subtree;
        }
    }
    $db->commit();
}
$currentLimitationList = array();
foreach ($currentFunctionLimitations as $currentFunctionLimitation) {
    $currentLimitationList[$currentFunctionLimitation['name']] = "-1";
}
开发者ID:runelangseid,项目名称:ezpublish,代码行数:31,代码来源:policyedit.php


注:本文中的eZPolicyLimitation::createNew方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。