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


PHP eZWorkflowEventType类代码示例

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


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

示例1: attributes

    function attributes()
    {
        return array_merge( array( 'sections',
                                   'languages',
                                   'users',
                                   'usergroups' ),
                            eZWorkflowEventType::attributes() );

    }
开发者ID:nottavi,项目名称:ezpublish,代码行数:9,代码来源:ezfinishuserregistertype.php

示例2: attribute

 function attribute($attr)
 {
     switch ($attr) {
         case 'state_group':
             return eZContentObjectStateGroup::fetchByOffset();
         default:
             return eZWorkflowEventType::attribute($attr);
     }
 }
开发者ID:gggeek,项目名称:ezworkflowcollection,代码行数:9,代码来源:objectstateupdatetype.php

示例3: attribute

 function attribute($attr)
 {
     switch ($attr) {
         case 'sections':
             $sections = eZSection::fetchList(false);
             foreach ($sections as $key => $section) {
                 $sections[$key]['Name'] = $section['name'];
                 $sections[$key]['value'] = $section['id'];
             }
             return $sections;
             break;
         case 'languages':
             return eZContentLanguage::fetchList();
             break;
     }
     return eZWorkflowEventType::attribute($attr);
 }
开发者ID:gggeek,项目名称:ezworkflowcollection,代码行数:17,代码来源:approvelocationtype.php

示例4: isset

        $deleteNodeIds = isset($parameters['node_id_list']) ? $parameters['node_id_list'] : array();

        $removeLocationNodeIds = array();
        if(isset($parameters['node_list']))
        {
            foreach($parameters['node_list'] as $node)
            {
                $removeLocationNodeIds[] = $node->attribute('node_id');
            }
        }
        
        $nodeIds = array_merge($deleteNodeIds, $removeLocationNodeIds);

        /* @type $selections MMSelections[] */
        $selections = MMSelections::fetchObjectList( 
            MMSelections::definition(), 
            null, 
            array( 'node_id' => array( array( $nodeIds ) ) ) 
        );

        foreach( $selections as $selection )
        {
            $selection->remove();
        }
        
        return self::STATUS_ACCEPTED;
    }
}

eZWorkflowEventType::registerEventType( mySelectionRemoveWorkflowType::WORKFLOW_TYPE_STRING, "mySelectionRemoveWorkflowType" );
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:30,代码来源:myselectionremoveworkflowtype.php

示例5: array

                // smart-cache enabled version
                // get list of nodes whose view-cache is expired
                $assigned_nodes = array();
                eZContentCacheManager::nodeListForObject($object, true, eZContentCacheManager::CLEAR_DEFAULT, $assigned_nodes, $handledObjectList);
                foreach ($assigned_nodes as $i => $nodeID) {
                    $assigned_nodes[$i] = eZContentObjectTreeNode::fetch($nodeID);
                }
            }
            $domains = $ini->variable('ExpireRemoteCacheFlowSettings', 'ExpireDomains');
            foreach ($assigned_nodes as $assigned_node) {
                // for every node, call eZHTTPCacheManager to clean the remote cache
                $url = $assigned_node->urlAlias();
                if (is_array($domains) && (count($domains) > 1 || count($domains) > 0 && $domains[0] != '')) {
                    eZURI::transformURI($url);
                    foreach ($domains as $domain) {
                        eZHTTPCacheManager::execute($domain . $url);
                    }
                } else {
                    eZURI::transformURI($url, false, 'full');
                    eZHTTPCacheManager::execute($url);
                }
            }
        } else {
            eZDebug::writeError('Expire remote cache event triggered for inexisting object: ' . $objectId);
            return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
        }
        return eZWorkflowType::STATUS_ACCEPTED;
    }
}
eZWorkflowEventType::registerEventType(expireremotecacheflowType::WORKFLOW_TYPE_STRING, 'expireremotecacheflowtype');
开发者ID:gggeek,项目名称:ezworkflowcollection,代码行数:30,代码来源:expireremotecacheflowtype.php

示例6: array

    {
        $filter = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
        foreach ($order->productItems() as $item) {
            $dataMap = $item['item_object']->contentObject()->dataMap();
            if (!array_key_exists('paymethod', $dataMap)) {
                return $filter;
            }
            $paymethod = $dataMap['paymethod'];
            $content = $paymethod->content();
            $filter = array_intersect($filter, $content);
        }
        return $filter;
    }
    public function execute($process, $event)
    {
        $parameters = $process->attribute('parameter_list');
        $order = eZOrder::fetch($parameters['order_id']);
        $filter = self::filterOrderPayment($order);
        $process->Template = array();
        $process->Template['templateName'] = 'design:workflow/ezpaymentselect.tpl';
        $process->Template['templateVars'] = array('order' => $order, 'filter' => $filter);
        if (!$this->checkPayment()) {
            return eZWorkflowType::STATUS_FETCH_TEMPLATE_REPEAT;
        } else {
            eZPaymentSelectType::storeOrderData($order, $_POST['payment'], serialize($_POST));
            return eZWorkflowType::STATUS_ACCEPTED;
        }
    }
}
eZWorkflowEventType::registerEventType(eZPaymentSelectType::WORKFLOW_TYPE_STRING, "eZPaymentSelectType");
开发者ID:namestnik,项目名称:ezpaymentselect,代码行数:30,代码来源:ezpaymentselecttype.php

示例7: foreach

            foreach ($createClasses as $class => $name) {
                $result = $this->createObject($class, $parentNodeID, $name);
            }
        }
        return eZWorkflowType::STATUS_ACCEPTED;
    }
    function createObject($classIdentifier, $parentNodeID, $name)
    {
        $user = eZUser::currentUser();
        $Class = eZContentClass::fetchByIdentifier($classIdentifier);
        if (!$Class) {
            eZDebug::writeError("No class with identifier {$classIdentifier}", "classCreation");
            return false;
        }
        $contentObject = $Class->instantiate($user->attribute('contentobject_id'));
        $nodeAssignment = eZNodeAssignment::create(array('contentobject_id' => $contentObject->attribute('id'), 'contentobject_version' => $contentObject->attribute('current_version'), 'parent_node' => $parentNodeID, 'is_main' => 1));
        $nodeAssignment->store();
        $version = $contentObject->version(1);
        $version->setAttribute('modified', eZDateTime::currentTimeStamp());
        $version->setAttribute('status', eZContentObjectVersion::STATUS_DRAFT);
        $version->store();
        $contentObjectID = $contentObject->attribute('id');
        $attributes = $contentObject->attribute('contentobject_attributes');
        $attributes[0]->fromString($name);
        $attributes[0]->store();
        $operationResult = eZOperationHandler::execute('content', 'publish', array('object_id' => $contentObjectID, 'version' => 1));
        return true;
    }
}
eZWorkflowEventType::registerEventType(autocreateObjectType::WORKFLOW_TYPE_STRING, "autocreateObjectType");
开发者ID:rmdev,项目名称:lisautocreateobject,代码行数:30,代码来源:autocreateobjecttype.php

示例8: __construct

<?php

class sCacheCookieType extends eZWorkflowEventType
{
    const WORKFLOW_TYPE_STRING = 'scachecookie';
    const WORKFLOW_TYPE_CLASS = 'sCacheCookieType';
    const WORKFLOW_TYPE_DESC = 'Update Cache Cookie';
    function __construct()
    {
        $this->eZWorkflowEventType(self::WORKFLOW_TYPE_STRING, self::WORKFLOW_TYPE_DESC);
        $this->setTriggerTypes(array('user' => array('preferences' => array('before', 'after')), 'shop' => array('addtobasket' => array('before', 'after'), 'updatebasket' => array('before', 'after'))));
    }
    function execute($process, $event)
    {
        sCacheCookieHelper::setCookie();
        return eZWorkflowType::STATUS_ACCEPTED;
    }
}
eZWorkflowEventType::registerEventType(sCacheCookieType::WORKFLOW_TYPE_STRING, sCacheCookieType::WORKFLOW_TYPE_CLASS);
开发者ID:stevoland,项目名称:ez_scachecookie,代码行数:19,代码来源:scachecookietype.php

示例9: attribute

 function attribute($attr)
 {
     switch ($attr) {
         case 'contentclass_list':
             return eZContentClass::fetchList(eZContentClass::VERSION_STATUS_DEFINED, true);
             break;
         case 'contentclassattribute_list':
             //                $postvarname = 'WorkflowEvent' . '_event_ezwaituntildate_' .'class_' . $workflowEvent->attribute( 'id' ); and $http->hasPostVariable( $postvarname )
             if (isset($GLOBALS['eZWaitUntilDateSelectedClass'])) {
                 $classID = $GLOBALS['eZWaitUntilDateSelectedClass'];
             } else {
                 // if nothing was preselected, we will use the first one:
                 // POSSIBLE ENHANCEMENT: in the common case, the contentclass_list fetch will be called twice
                 $classList = eZWaitUntilDateType::attribute('contentclass_list');
                 if (isset($classList[0])) {
                     $classID = $classList[0]->attribute('id');
                 } else {
                     $classID = false;
                 }
             }
             if ($classID) {
                 return eZContentClassAttribute::fetchListByClassID($classID);
             }
             return array();
             break;
         case 'has_class_attributes':
             // for the backward compatibility:
             return 1;
             break;
         default:
             return eZWorkflowEventType::attribute($attr);
     }
 }
开发者ID:nfrp,项目名称:ezpublish,代码行数:33,代码来源:ezwaituntildatetype.php

示例10: foreach

            $classIdentifier = $version->ContentObject->ClassIdentifier;
            // Verifica se la classe è corretta
            if ($classIdentifier == self::PUBLISH_CLASS) {
                $objectAttributes = $version->attribute('contentobject_attributes');
                // cicla sugl iattributi
                foreach ($objectAttributes as $objectAttribute) {
                    $contentClassAttributeIdentifier = $objectAttribute->ContentClassAttributeIdentifier;
                    if ($contentClassAttributeIdentifier == 'published') {
                        // recupera la data di pubblicazione
                        $publisheddate = $objectAttribute->attribute('content');
                    }
                }
                // set della data di pubblicazione
                if ($publisheddate instanceof eZDateTime || $publisheddate instanceof eZDate) {
                    $object->setAttribute('published', $publisheddate->timeStamp());
                    $object->store();
                    eZContentOperationCollection::registerSearchObject($object->attribute('id'));
                    eZDebug::writeNotice('Workflow change object publish date', __METHOD__);
                }
                //echo('<br>*** die workflow ***');
                //die();
            }
            return eZWorkflowType::STATUS_ACCEPTED;
        } catch (Exception $e) {
            eZDebug::writeError($e->getMessage(), __METHOD__);
            return eZWorkflowType::STATUS_REJECTED;
        }
    }
}
eZWorkflowEventType::registerEventType(ImportComunicatiType::WORKFLOW_TYPE_STRING, 'ImportComunicatiType');
开发者ID:informaticatrentina,项目名称:pat_base,代码行数:30,代码来源:importcomunicatitype.php

示例11: attribute

 function attribute($attr)
 {
     switch ($attr) {
         case 'sections':
             $sections = eZSection::fetchList(false);
             foreach ($sections as $key => $section) {
                 $sections[$key]['Name'] = $section['name'];
                 $sections[$key]['value'] = $section['id'];
             }
             return $sections;
             break;
         case 'languages':
             return eZContentLanguage::fetchList();
             break;
         case 'usergroups':
             $groups = eZPersistentObject::fetchObjectList(eZContentObject::definition(), array('id', 'name'), array('contentclass_id' => 3, 'status' => eZContentObject::STATUS_PUBLISHED), null, null, false);
             foreach ($groups as $key => $group) {
                 $groups[$key]['Name'] = $group['name'];
                 $groups[$key]['value'] = $group['id'];
             }
             return $groups;
             break;
         case 'contentclass_list':
             $classes = eZContentClass::fetchList(eZContentClass::VERSION_STATUS_DEFINED, true, false, array('name' => 'asc'));
             $classList = array();
             for ($i = 0; $i < count($classes); $i++) {
                 $classList[$i]['Name'] = $classes[$i]->attribute('name');
                 $classList[$i]['value'] = $classes[$i]->attribute('id');
             }
             return $classList;
             break;
         case 'workflow_list':
             $workflows = eZWorkflow::fetchList();
             $workflowList = array();
             for ($i = 0; $i < count($workflows); $i++) {
                 $workflowList[$i]['Name'] = $workflows[$i]->attribute('name');
                 $workflowList[$i]['value'] = $workflows[$i]->attribute('id');
             }
             return $workflowList;
             break;
     }
     return eZWorkflowEventType::attribute($attr);
 }
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:43,代码来源:ezmultiplexertype.php

示例12: __construct

 public function __construct()
 {
     parent::eZWorkflowEventType(self::EVENT_TYPE, self::EVENT_NAME);
     $this->setTriggerTypes(array('content' => array('publish' => array('after'))));
 }
开发者ID:gggeek,项目名称:ezworkflowcollection,代码行数:5,代码来源:copynodetoallparentlocationstype.php

示例13: attribute

 function attribute($attr)
 {
     switch ($attr) {
         case 'contentclass_list':
             return eZContentClass::fetchList(eZContentClass::VERSION_STATUS_DEFINED, true);
             break;
         default:
             return eZWorkflowEventType::attribute($attr);
     }
 }
开发者ID:gggeek,项目名称:ezworkflowcollection,代码行数:10,代码来源:multipublishtype.php

示例14: storeEventData

 function storeEventData($event, $version)
 {
     $eventData = eZApprove2Event::fetch($event->attribute('id'), 1);
     switch ($version) {
         case 0:
             $eventData->publish();
             $eventData->removeDraft();
             break;
         case 1:
             $eventData->store();
             break;
     }
     eZWorkflowEventType::storeEventData($event, $version);
 }
开发者ID:brucem,项目名称:ezapprove2,代码行数:14,代码来源:ezapprove2type.php

示例15: execute

     * @param eZWorkflowEvent $event
     * @return int
     */
    function execute( $process, $event )
    {
        // Get some information about the object being passed
        $parameters = $process->attribute( 'parameter_list' );
        $object     = eZContentObject::fetch( $parameters['object_id'] );

        if($object->ClassIdentifier != 'article')
            return self::STATUS_ACCEPTED;

        /* @type $dataMap eZContentObjectAttribute[] */
        $dataMap = $object->dataMap();

        if(isset($dataMap['source']))
        {
            $sourceString = MMNewsSource::getSourceString($object);
            if($sourceString)
            {
                $dataMap['source']->setAttribute('data_text', $sourceString);
                $dataMap['source']->store();
            }
            eZContentCacheManager::clearContentCache($object->attribute('id'));
        }
        return self::STATUS_ACCEPTED;
    }
}

eZWorkflowEventType::registerEventType( updateNewsSourceType::WORKFLOW_TYPE_STRING, "updateNewsSourceType" );
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:30,代码来源:updatenewssourcetype.php


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