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


PHP eZDebugSetting::writeError方法代码示例

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


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

示例1: execute

    function execute( $process, $event )
    {
        $parameters = $process->attribute( 'parameter_list' );
        $object = eZContentObject::fetch( $parameters['object_id'] );

        if ( !$object )
        {
            eZDebugSetting::writeError( 'kernel-workflow-waituntildate','The object with ID '.$parameters['object_id'].' does not exist.', 'eZApproveType::execute() object is unavailable' );
            return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
        }

        $version = $object->version( $parameters['version'] );
        $objectAttributes = $version->attribute( 'contentobject_attributes' );
        $waitUntilDateObject = $this->workflowEventContent( $event );
        $waitUntilDateEntryList = $waitUntilDateObject->attribute( 'classattribute_id_list' );
        $modifyPublishDate = $event->attribute( 'data_int1' );

        foreach ( array_keys( $objectAttributes ) as $key )
        {
            $objectAttribute = $objectAttributes[$key];
            $contentClassAttributeID = $objectAttribute->attribute( 'contentclassattribute_id' );
            if ( in_array( $objectAttribute->attribute( 'contentclassattribute_id' ), $waitUntilDateEntryList ) )
            {
                $dateTime = $objectAttribute->attribute( 'content' );
                if ( $dateTime instanceof eZDateTime or
                     $dateTime instanceof eZTime or
                     $dateTime instanceof eZDate )
                {
                    if ( time() < $dateTime->timeStamp() )
                    {
                        $this->setInformation( "Event delayed until " . $dateTime->toString( true ) );
                        $this->setActivationDate( $dateTime->timeStamp() );
                        return eZWorkflowType::STATUS_DEFERRED_TO_CRON_REPEAT;
                    }
                    else if ( $dateTime->isValid() and $modifyPublishDate )
                    {
                        $object->setAttribute( 'published', $dateTime->timeStamp() );
                        $object->store();
                    }
                    else
                    {
                        return eZWorkflowType::STATUS_ACCEPTED;
//                        return eZWorkflowType::STATUS_WORKFLOW_DONE;
                    }
                }
                else
                {
                    return eZWorkflowType::STATUS_ACCEPTED;
//                   return eZWorkflowType::STATUS_WORKFLOW_DONE;
                }
            }
        }
        return eZWorkflowType::STATUS_ACCEPTED;
//        return eZWorkflowType::STATUS_WORKFLOW_DONE;
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:55,代码来源:ezwaituntildatetype.php

示例2: doSeek

 function doSeek($offset, $whence)
 {
     if ($whence == SEEK_SET) {
         $offset = $offset - gztell($this->File);
     } else {
         if ($whence == SEEK_END) {
             eZDebugSetting::writeError('lib-ezfile-gziplibz', "Seeking from end is not supported for gzipped files");
             return false;
         }
     }
     return @gzseek($this->File, $offset);
 }
开发者ID:legende91,项目名称:ez,代码行数:12,代码来源:ezgzipshellcompressionhandler.php

示例3: execute

    function execute( $process, $event )
    {
        eZDebugSetting::writeDebug( 'kernel-workflow-approve', $process, 'eZApproveType::execute' );
        eZDebugSetting::writeDebug( 'kernel-workflow-approve', $event, 'eZApproveType::execute' );
        $parameters = $process->attribute( 'parameter_list' );
        $versionID = $parameters['version'];
        $objectID = $parameters['object_id'];
        $object = eZContentObject::fetch( $objectID );

        if ( !$object )
        {
            eZDebugSetting::writeError( 'kernel-workflow-approve', "No object with ID $objectID", 'eZApproveType::execute' );
            return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
        }

        $version = $object->version( $versionID );

        if ( !$version )
        {
            eZDebugSetting::writeError( 'kernel-workflow-approve', "No version $versionID for object with ID $objectID", 'eZApproveType::execute' );
            return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
        }

        // only check this in cronjob
        if( $process->attribute( 'status' ) == eZWorkflow::STATUS_DEFERRED_TO_CRON )
        {
            $nodeAssignmentList = $version->attribute( 'node_assignments' );
            if( !empty( $nodeAssignmentList ) )
            {
                foreach ( $nodeAssignmentList as $nodeAssignment )
                {
                    $parentNode = $nodeAssignment->getParentNode();
                    if( $parentNode === null )
                    {
                        eZDebugSetting::writeError( 'kernel-workflow-approve', "No parent node for object with ID $objectID version $versionID", 'eZApproveType::execute' );
                        return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
                    }
                }
            }
        }

        // version option checking
        $version_option = $event->attribute( 'version_option' );
        if ( ( $version_option == eZApproveType::VERSION_OPTION_FIRST_ONLY and $parameters['version'] > 1 ) or
             ( $version_option == eZApproveType::VERSION_OPTION_EXCEPT_FIRST and $parameters['version'] == 1 ) )
        {
            return eZWorkflowType::STATUS_ACCEPTED;
        }

        /*
          If we run event first time ( when we click publish in admin ) we do not have user_id set in workflow process,
          so we take current user and store it in workflow process, so next time when we run event from cronjob we fetch
          user_id from there.
         */
        if ( $process->attribute( 'user_id' ) == 0 )
        {
            $user = eZUser::currentUser();
            $process->setAttribute( 'user_id', $user->id() );
        }
        else
        {
            $user = eZUser::instance( $process->attribute( 'user_id' ) );
        }

        $userGroups = array_merge( $user->attribute( 'groups' ), array( $user->attribute( 'contentobject_id' ) ) );
        $workflowSections = explode( ',', $event->attribute( 'data_text1' ) );
        $workflowGroups =   $event->attribute( 'data_text2' ) == '' ? array() : explode( ',', $event->attribute( 'data_text2' ) );
        $editors =          $event->attribute( 'data_text3' ) == '' ? array() : explode( ',', $event->attribute( 'data_text3' ) );
        $approveGroups =    $event->attribute( 'data_text4' ) == '' ? array() : explode( ',', $event->attribute( 'data_text4' ) );
        $languageMask = $event->attribute( 'data_int2' );

        eZDebugSetting::writeDebug( 'kernel-workflow-approve', $user, 'eZApproveType::execute::user' );
        eZDebugSetting::writeDebug( 'kernel-workflow-approve', $userGroups, 'eZApproveType::execute::userGroups' );
        eZDebugSetting::writeDebug( 'kernel-workflow-approve', $editors, 'eZApproveType::execute::editor' );
        eZDebugSetting::writeDebug( 'kernel-workflow-approve', $approveGroups, 'eZApproveType::execute::approveGroups' );
        eZDebugSetting::writeDebug( 'kernel-workflow-approve', $workflowSections, 'eZApproveType::execute::workflowSections' );
        eZDebugSetting::writeDebug( 'kernel-workflow-approve', $workflowGroups, 'eZApproveType::execute::workflowGroups' );
        eZDebugSetting::writeDebug( 'kernel-workflow-approve', $languageMask, 'eZApproveType::execute::languageMask' );
        eZDebugSetting::writeDebug( 'kernel-workflow-approve', $object->attribute( 'section_id'), 'eZApproveType::execute::section_id' );

        $section = $object->attribute( 'section_id' );
        $correctSection = false;

        if ( !in_array( $section, $workflowSections ) && !in_array( -1, $workflowSections ) )
        {
            $assignedNodes = $object->attribute( 'assigned_nodes' );
            if ( $assignedNodes )
            {
                foreach( $assignedNodes as $assignedNode )
                {
                    $parent = $assignedNode->attribute( 'parent' );
                    $parentObject = $parent->object();
                    $section = $parentObject->attribute( 'section_id');

                    if ( in_array( $section, $workflowSections ) )
                    {
                        $correctSection = true;
                        break;
                    }
                }
//.........这里部分代码省略.........
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:101,代码来源:ezapprovetype.php

示例4: logError

 /**
  * Logs $errMsg.
  *
  * @param string $errMsg Error message to be logged
  * @param string $context Context where the error occurred
  * @return void
  */
 public function logError($errMsg, $context = null)
 {
     eZDebugSetting::writeError('kernel-clustering', $errMsg, $context);
 }
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:11,代码来源:ezclustereventloggerezdebug.php

示例5: execute

 function execute($process, $event)
 {
     eZDebugSetting::writeDebug('kernel-workflow-approve', $process, 'eZApprove2Type::execute');
     eZDebugSetting::writeDebug('kernel-workflow-approve', $event, 'eZApprove2Type::execute');
     $parameters = $process->attribute('parameter_list');
     $versionID = $parameters['version'];
     $object = eZContentObject::fetch($parameters['object_id']);
     if (!$object) {
         eZDebugSetting::writeError('kernel-workflow-approve', $parameters['object_id'], 'eZApprove2Type::execute');
         return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
     }
     /*
       If we run event first time ( when we click publish in admin ) we do not have user_id set in workflow process,
       so we take current user and store it in workflow process, so next time when we run event from cronjob we fetch
       user_id from there.
     */
     if ($process->attribute('user_id') == 0) {
         $user = eZUser::currentUser();
         $process->setAttribute('user_id', $user->id());
     } else {
         $user = eZUser::instance($process->attribute('user_id'));
     }
     $eventData = eZApprove2Event::fetch($event->attribute('id'), $event->attribute('version'));
     $userGroups = array_merge((array) $user->attribute('groups'), (array) $user->attribute('contentobject_id'));
     $workflowSections = explode(',', $eventData->attribute('selected_sections'));
     $workflowGroups = explode(',', $eventData->attribute('selected_usergroups'));
     $editors = explode(',', $eventData->attribute('approve_users'));
     $approveGroups = explode(',', $eventData->attribute('approve_groups'));
     eZDebugSetting::writeDebug('kernel-workflow-approve', $user, 'eZApprove2Type::execute::user');
     eZDebugSetting::writeDebug('kernel-workflow-approve', $userGroups, 'eZApprove2Type::execute::userGroups');
     eZDebugSetting::writeDebug('kernel-workflow-approve', $editors, 'eZApprove2Type::execute::editor');
     eZDebugSetting::writeDebug('kernel-workflow-approve', $workflowSections, 'eZApprove2Type::execute::workflowSections');
     eZDebugSetting::writeDebug('kernel-workflow-approve', $workflowGroups, 'eZApprove2Type::execute::workflowGroups');
     eZDebugSetting::writeDebug('kernel-workflow-approve', $object->attribute('section_id'), 'eZApprove2Type::execute::section_id');
     $section = $object->attribute('section_id');
     $correctSection = false;
     if (!in_array($section, $workflowSections) && !in_array(-1, $workflowSections)) {
         $assignedNodes = $object->attribute('assigned_nodes');
         if ($assignedNodes) {
             foreach ($assignedNodes as $assignedNode) {
                 $parent = $assignedNode->attribute('parent');
                 $parentObject = $parent->object();
                 $section = $parentObject->attribute('section_id');
                 if (in_array($section, $workflowSections)) {
                     $correctSection = true;
                     break;
                 }
             }
         }
     } else {
         $correctSection = true;
     }
     switch ($eventData->attribute('approve_type')) {
         case eZApprove2Event::ApproveTypeUser:
             $inExcludeGroups = false;
             $userIsEditor = false;
             break;
         default:
         case eZApprove2Event::ApproveTypePredefined:
             $inExcludeGroups = count(array_intersect($userGroups, $workflowGroups)) != 0;
             $userIsEditor = in_array($user->id(), $editors) || count(array_intersect($userGroups, $approveGroups)) != 0;
             break;
     }
     if (!$inExcludeGroups && !$userIsEditor && $correctSection) {
         switch ($eventData->attribute('approve_type')) {
             case eZApprove2Event::ApproveTypeUser:
                 $contentObjectVersionID = $parameters['version'];
                 $contentObjectID = $parameters['object_id'];
                 $approveStatus = eZXApproveStatus::fetchByContentObjectID($contentObjectID, $contentObjectVersionID);
                 if (!$approveStatus || $approveStatus->attribute('approve_status') == eZXApproveStatus::StatusSelectApprover) {
                     if (!$approveStatus) {
                         $approveStatus = eZXApproveStatus::create($contentObjectID, $contentObjectVersionID, $process->attribute('id'), $process->attribute('event_position'));
                         $approveStatus->store();
                         $approveStatus->setCreator($user->attribute('contentobject_id'));
                     }
                     $approveStatus->setAttribute('active_version', $contentObjectVersionID);
                     $approveStatus->sync();
                     $process->Template = array();
                     $process->Template['templateName'] = 'design:workflow/eventtype/ezapprove2/select_approver.tpl';
                     $process->Template['templateVars'] = array('event' => $event, 'approval_status' => $approveStatus, 'object' => $object);
                     // Set object version to draft untill approvers are selected successfully in case user exists in the wrong way.
                     #include_once( 'kernel/classes/ezcontentobjectversion.php' );
                     $contentObjectVersion = eZContentObjectVersion::fetchVersion($contentObjectVersionID, $contentObjectID);
                     $contentObjectVersion->setAttribute('status', eZContentObjectVersion::STATUS_DRAFT);
                     $contentObjectVersion->sync();
                     return eZWorkflowType::STATUS_FETCH_TEMPLATE_REPEAT;
                 } else {
                     switch ($approveStatus->attribute('approve_status')) {
                         case eZXApproveStatus::StatusSelectApprover:
                             // Do nothing, continue processing in next cronjob run.
                             return eZWorkflowType::STATUS_DEFERRED_TO_CRON_REPEAT;
                             break;
                         case eZXApproveStatus::StatusInApproval:
                             // Check if enough users have approves the workflow, or any has discarded it.
                             $discardCount = $approveStatus->discardedUserCount();
                             $collaborationItem = $approveStatus->attribute('collaboration_item');
                             #include_once( eZExtension::baseDirectory() . '/ezapprove2/collaboration/ezapprove2/ezapprove2collaborationhandler.php' );
                             if ($discardCount > 0) {
                                 $approveStatus->cancel();
                                 $approveINI = eZINI::instance('ezapprove2.ini');
//.........这里部分代码省略.........
开发者ID:brucem,项目名称:ezapprove2,代码行数:101,代码来源:ezapprove2type.php

示例6: execute

 function execute($process, $event)
 {
     // Get some information about the object being passed
     $parameters = $process->attribute('parameter_list');
     $object = eZContentObject::fetch($parameters['object_id']);
     // Because this is also run by the cronjob, check to make sure the object hasn't been deleted
     if (!$object) {
         eZDebugSetting::writeError('workflow-hideuntildate', 'The object with ID ' . $parameters['object_id'] . ' does not exist.', 'eZApproveType::execute() object is unavailable');
         return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
     }
     // if the current version of an object is not the version the workflow pertains to, cancel the workflow
     $currentVersion = $object->attribute('current_version');
     $version = $parameters['version'];
     if ($currentVersion != $version) {
         return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
     }
     // Get the data map for this object
     $objectAttributes = $object->attribute('data_map');
     // Get the user configuration with class and attribute mapping and the boolean modify publish date setting
     $workflowSettings = $this->getWorkflowSettings($event);
     foreach ($objectAttributes as $objectAttribute) {
         if (in_array($objectAttribute->attribute('contentclassattribute_id'), $workflowSettings['classattribute_map'])) {
             // Make sure this is of a date or datetime attribute
             if (in_array($objectAttribute->attribute('data_type_string'), array('ezdate', 'ezdatetime'))) {
                 // If the publish date is in the future, hide the node
                 if (time() < $objectAttribute->toString()) {
                     // Set a time for when this workflow should be tested again via the cronjob
                     // Store a description to be displayed in the Setup > Workflow processes list
                     // This must also be accompanied by overriding the workflow/processlist.tpl template
                     $parameters = array_merge($parameters, array('event_description' => 'Publishing of object delayed until ' . $objectAttribute->attribute('content')->toString(true)));
                     $process->setParameters($parameters);
                     $process->store();
                     // Hide the object's nodes
                     $nodes = $object->attribute('assigned_nodes');
                     foreach ($nodes as $node) {
                         if (!$node->attribute('is_hidden')) {
                             eZContentObjectTreeNode::hideSubTree($node);
                         }
                     }
                     return eZWorkflowType::STATUS_DEFERRED_TO_CRON_REPEAT;
                 } elseif ($objectAttribute->hasContent()) {
                     if ($workflowSettings['modify_publish_date']) {
                         $object->setAttribute('published', $objectAttribute->toString());
                         $object->store();
                     }
                     $nodes = $object->attribute('assigned_nodes');
                     foreach ($nodes as $node) {
                         eZContentObjectTreeNode::unhideSubTree($node);
                         eZContentCacheManager::clearContentCache($parameters['object_id']);
                         eZContentCacheManager::clearObjectViewCache($parameters['object_id']);
                     }
                     return eZWorkflowType::STATUS_ACCEPTED;
                 }
             } else {
                 // Attribute that matched was not a valid date or datetime attribute, so ignore
                 return eZWorkflowType::STATUS_ACCEPTED;
             }
         }
     }
     // No attributes matched the workflow configured by the user
     return eZWorkflowType::STATUS_ACCEPTED;
 }
开发者ID:mugoweb,项目名称:hideuntildate,代码行数:62,代码来源:hideuntildatetype.php

示例7: execute

 /**
  * Workflow Event Type execute method
  */
 function execute($process, $event)
 {
     /**
      * Fetch workflow process parameters
      */
     $parameters = $process->attribute('parameter_list');
     $objectID = $parameters['object_id'];
     $version = $parameters['version'];
     /**
      * Fetch workflow event execution settings
      */
     $workflowEventRegenerateCreation = eZINI::instance('bcimagealias.ini')->variable('BCImageAliasSettings', 'WorkflowEventRegenerateAliasImageVariations') == 'enabled' ? true : false;
     $workflowEventTroubleshootCreation = eZINI::instance('bcimagealias.ini')->variable('BCImageAliasSettings', 'WorkflowEventTroubleshootAliasImageVariationCreation') == 'enabled' ? true : false;
     $workflowEventVerboseCreationLevel = eZINI::instance('bcimagealias.ini')->variable('BCImageAliasSettings', 'WorkflowEventTroubleshootAliasImageVariationCreationLevel') != '1' ? eZINI::instance('bcimagealias.ini')->variable('BCImageAliasSettings', 'WorkflowEventTroubleshootAliasImageVariationCreationLevel') : 1;
     $workflowEventCurrentSiteAccessCreation = eZINI::instance('bcimagealias.ini')->variable('BCImageAliasSettings', 'WorkflowEventCurrentSiteAccessAliasImageVariationCreation') == 'enabled' ? true : false;
     $workflowEventSubtreeImageAliasCreation = eZINI::instance('bcimagealias.ini')->variable('BCImageAliasSettings', 'WorkflowEventSubtreeImageAliasImageVariationCreation') == 'enabled' ? true : false;
     /**
      * BCImageAlias execution parameters
      */
     $BCImageAliasExecutionParams = array('verbose' => false, 'verboseLevel' => 1, 'dry' => false, 'iterate' => false, 'regenerate' => $workflowEventRegenerateCreation, 'troubleshoot' => $workflowEventTroubleshootCreation, 'current-siteaccess' => $workflowEventCurrentSiteAccessCreation);
     /**
      * Optional debug output
      */
     if ($BCImageAliasExecutionParams['troubleshoot'] == true) {
         echo "Workflow parameters: \n\n";
         print_r($parameters);
         echo "\n\n";
     }
     /**
      * Fetch content object
      */
     $object = eZContentObject::fetch($objectID, $version);
     /**
      * Test for the rare chance we would not have been given an object. Terminate workflow event execution after writing debug error report
      */
     if (!$object) {
         eZDebugSetting::writeError('extension-bcimagealias-create-image-alias-variations-workflow-on-non-object', $objectID, 'BCImageAliasCreateObjectImageVariationsType::execute');
         return eZWorkflowEventType::STATUS_WORKFLOW_CANCELLED;
     }
     /**
      * Create image alias image variation image files by content object
      */
     if ($workflowEventSubtreeImageAliasCreation) {
         $result = BCImageAlias::instance($BCImageAliasExecutionParams)->createByNodeSubtree($object->attribute('main_node'));
     } else {
         $result = BCImageAlias::instance($BCImageAliasExecutionParams)->createByObject($object);
     }
     /**
      * Optional debug output
      */
     if ($BCImageAliasExecutionParams['troubleshoot'] == true) {
         die("\nTroubleshooting exection option enabled: Ending workflow event just before the end of it's execution to allow you to read related output.\n\n\n");
     }
     /**
      * Test result for failure to create image aliases. Non-fatal workflow event execution result. Write debug error report just in case this is a problem
      */
     if ($result == false) {
         eZDebugSetting::writeError('extension-bcimagealias-create-image-alias-variations-workflow-object-failure-to-create', $objectID, 'BCImageAliasCreateObjectImageVariationsType::execute');
     }
     /**
      * Return default succesful workflow event status code, by default, regardless of results of execution, always.
      * Image alias image variation image files may not always need to be created. Also returning any other status
      * will result in problems with the succesfull and normal completion of the workflow event process
      */
     return eZWorkflowType::STATUS_ACCEPTED;
 }
开发者ID:philandteds,项目名称:bcimagealias,代码行数:69,代码来源:bcimagealiascreateobjectimagevariationstype.php

示例8: execute

 function execute($process, $event)
 {
     eZDebugSetting::writeDebug('ezworkflowcollection-workflow-approve-location', $process, 'approveLocationType::execute');
     eZDebugSetting::writeDebug('ezworkflowcollection-workflow-approve-location', $event, 'approveLocationType::execute');
     $parameters = $process->attribute('parameter_list');
     $userID = $parameters['user_id'];
     $objectID = $parameters['object_id'];
     $object = eZContentObject::fetch($objectID);
     if (!$object) {
         eZDebugSetting::writeError('ezworkflowcollection-workflow-approve-location', "No object with ID {$objectID}", 'approveLocationType::execute');
         return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
     }
     $version = $object->currentversion();
     if (!$version) {
         eZDebugSetting::writeError('ezworkflowcollection-workflow-approve-location', "No version for object with ID {$objectID}", 'approveLocationType::execute');
         return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
     } else {
         $versionID = $version->attribute('version');
     }
     // version option checking
     $version_option = $event->attribute('version_option');
     if ($version_option == self::VERSION_OPTION_FIRST_ONLY and $versionID > 1 or $version_option == self::VERSION_OPTION_EXCEPT_FIRST and $versionID == 1) {
         return eZWorkflowType::STATUS_ACCEPTED;
     }
     // Target nodes
     $targetNodeIDs = $parameters['select_node_id_array'];
     if (!is_array($targetNodeIDs) || count($targetNodeIDs) == 0) {
         return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
     }
     /*
      Check userID or get user_id from process object
     */
     if ($userID == 0) {
         $user = eZUser::currentUser();
         $process->setAttribute('user_id', $user->id());
     } else {
         $user = eZUser::instance($userID);
     }
     $userGroups = array_merge($user->attribute('groups'), array($user->attribute('contentobject_id')));
     $workflowSections = explode(',', $event->attribute('data_text1'));
     $workflowGroups = $event->attribute('data_text2') == '' ? array() : explode(',', $event->attribute('data_text2'));
     $editors = $event->attribute('data_text3') == '' ? array() : explode(',', $event->attribute('data_text3'));
     $approveGroups = $event->attribute('data_text4') == '' ? array() : explode(',', $event->attribute('data_text4'));
     $languageMask = $event->attribute('data_int2');
     eZDebugSetting::writeDebug('ezworkflowcollection-workflow-approve-location', $user, 'approveLocationType::execute::user');
     eZDebugSetting::writeDebug('ezworkflowcollection-workflow-approve-location', $userGroups, 'approveLocationType::execute::userGroups');
     eZDebugSetting::writeDebug('ezworkflowcollection-workflow-approve-location', $editors, 'approveLocationType::execute::editor');
     eZDebugSetting::writeDebug('ezworkflowcollection-workflow-approve-location', $approveGroups, 'approveLocationType::execute::approveGroups');
     eZDebugSetting::writeDebug('ezworkflowcollection-workflow-approve-location', $workflowSections, 'approveLocationType::execute::workflowSections');
     eZDebugSetting::writeDebug('ezworkflowcollection-workflow-approve-location', $workflowGroups, 'approveLocationType::execute::workflowGroups');
     eZDebugSetting::writeDebug('ezworkflowcollection-workflow-approve-location', $languageMask, 'approveLocationType::execute::languageMask');
     eZDebugSetting::writeDebug('ezworkflowcollection-workflow-approve-location', $object->attribute('section_id'), 'approveLocationType::execute::section_id');
     $section = $object->attribute('section_id');
     $correctSection = false;
     if (!in_array($section, $workflowSections) && !in_array(-1, $workflowSections)) {
         $assignedNodes = $object->attribute('assigned_nodes');
         if ($assignedNodes) {
             foreach ($assignedNodes as $assignedNode) {
                 $parent = $assignedNode->attribute('parent');
                 $parentObject = $parent->object();
                 $section = $parentObject->attribute('section_id');
                 if (in_array($section, $workflowSections)) {
                     $correctSection = true;
                     break;
                 }
             }
         }
     } else {
         $correctSection = true;
     }
     $inExcludeGroups = count(array_intersect($userGroups, $workflowGroups)) != 0;
     $userIsEditor = in_array($user->id(), $editors) || count(array_intersect($userGroups, $approveGroups)) != 0;
     // All languages match by default
     $hasLanguageMatch = true;
     if ($languageMask != 0) {
         // Examine if the published version contains one of the languages we
         // match for.
         // If the language ID is part of the mask the result is non-zero.
         $languageID = (int) $version->attribute('initial_language_id');
         $hasLanguageMatch = (bool) ($languageMask & $languageID);
     }
     if ($hasLanguageMatch and !$userIsEditor and !$inExcludeGroups and $correctSection) {
         /* Get user IDs from approve user groups */
         $userClassIDArray = eZUser::contentClassIDs();
         $approveUserIDArray = array();
         foreach ($approveGroups as $approveUserGroupID) {
             if ($approveUserGroupID != false) {
                 $approveUserGroup = eZContentObject::fetch($approveUserGroupID);
                 if (isset($approveUserGroup)) {
                     foreach ($approveUserGroup->attribute('assigned_nodes') as $assignedNode) {
                         $userNodeArray = $assignedNode->subTree(array('ClassFilterType' => 'include', 'ClassFilterArray' => $userClassIDArray, 'Limitation' => array()));
                         foreach ($userNodeArray as $userNode) {
                             $approveUserIDArray[] = $userNode->attribute('contentobject_id');
                         }
                     }
                 }
             }
         }
         $approveUserIDArray = array_merge($approveUserIDArray, $editors);
         $approveUserIDArray = array_unique($approveUserIDArray);
//.........这里部分代码省略.........
开发者ID:gggeek,项目名称:ezworkflowcollection,代码行数:101,代码来源:approvelocationtype.php


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