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


PHP eZWorkflowEvent::attribute方法代码示例

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


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

示例1: validateHTTPInput

 /**
  * @param eZHTTPTool $http
  * @param $base
  * @param eZWorkflowEvent $workflowEvent
  * @param $validation
  *
  * @return bool|int
  */
 function validateHTTPInput($http, $base, $workflowEvent, &$validation)
 {
     $returnState = eZInputValidator::STATE_ACCEPTED;
     $reason = array();
     if (!$http->hasSessionVariable('BrowseParameters')) {
         // No validation when deleting to avoid blocking deletion of invalid items
         if ($http->hasPostVariable('DeleteApproveUserIDArray_' . $workflowEvent->attribute('id')) || $http->hasPostVariable('DeleteApproveGroupIDArray_' . $workflowEvent->attribute('id'))) {
             return eZInputValidator::STATE_ACCEPTED;
         }
         // check approve-users
         $approversIDs = array_unique($this->attributeDecoder($workflowEvent, 'approve_users'));
         if (is_array($approversIDs) and count($approversIDs) > 0) {
             $returnState = eZApproveType::validateUserIDList($approversIDs, $reason);
         } else {
             $returnState = false;
         }
         if ($returnState != eZInputValidator::STATE_INVALID) {
             // check approve-groups
             $userGroupIDList = array_unique($this->attributeDecoder($workflowEvent, 'approve_groups'));
             if (is_array($userGroupIDList) and count($userGroupIDList) > 0) {
                 $returnState = eZApproveType::validateGroupIDList($userGroupIDList, $reason);
             } else {
                 if ($returnState === false) {
                     // if no one user or user-group was passed as approvers
                     $returnState = eZInputValidator::STATE_INVALID;
                     $reason['text'] = "There must be passed at least one valid user or user group who approves content for the event.";
                 }
             }
             // check excluded-users
             /*
             if ( $returnState != eZInputValidator::STATE_INVALID )
             {
                 // TODO:
                 // ....
             }
             */
             // check excluded-groups
             if ($returnState != eZInputValidator::STATE_INVALID) {
                 $userGroupIDList = array_unique($this->attributeDecoder($workflowEvent, 'selected_usergroups'));
                 if (is_array($userGroupIDList) and count($userGroupIDList) > 0) {
                     $returnState = eZApproveType::validateGroupIDList($userGroupIDList, $reason);
                 }
             }
         }
     } else {
         $browseParameters = $http->sessionVariable('BrowseParameters');
         if (isset($browseParameters['custom_action_data'])) {
             $customData = $browseParameters['custom_action_data'];
             if (isset($customData['event_id']) and $customData['event_id'] == $workflowEvent->attribute('id')) {
                 if (!$http->hasPostVariable('BrowseCancelButton') and $http->hasPostVariable('SelectedObjectIDArray')) {
                     $objectIDArray = $http->postVariable('SelectedObjectIDArray');
                     if (is_array($objectIDArray) and count($objectIDArray) > 0) {
                         switch ($customData['browse_action']) {
                             case "AddApproveUsers":
                                 $returnState = eZApproveType::validateUserIDList($objectIDArray, $reason);
                                 break;
                             case 'AddApproveGroups':
                             case 'AddExcludeUser':
                                 $returnState = eZApproveType::validateGroupIDList($objectIDArray, $reason);
                                 break;
                             case 'AddExcludedGroups':
                                 // TODO:
                                 // .....
                                 break;
                         }
                     }
                 }
             }
         }
     }
     if ($returnState == eZInputValidator::STATE_INVALID) {
         $validation['processed'] = true;
         $validation['events'][] = array('id' => $workflowEvent->attribute('id'), 'placement' => $workflowEvent->attribute('placement'), 'workflow_type' => &$this, 'reason' => $reason);
     }
     return $returnState;
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:84,代码来源:ezapprovetype.php


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