Thursday 13 September 2007 6:39:12 am
I did this worflow event just to learn but i get an error, and i dont know how to fix it so if somebody can help?? in the file ezexampletype.php :
<?php
define("EZ_WORKFLOW_TYPE_EXAMPLE_ID", "ezexample");
class eZExampleType extends eZWorkflowEventType
{
/*!
Constructor
*/
function eZExampleType()
{
$this->eZWorkflowEventType("EZ_WORKFLOW_TYPE_EXAMPLE_ID","Example");
$this->setTriggerTypes(array('content'=>array('read'=>array('before'))));
}
/*
On doit implémenter la fonction execute
*/
function execute( &$process, &$event )
{
$parameters =& $process->attribute('parameter_list');
$http =& eZHTTPTool::instance();
if($http->hasPostVariable('ContinueButton'))
{
return EZ_WORKFLOW_TYPE_STATUS_ACCEPTED;
}
$node=& eZContentObjectTreeNode::fetch($parameters['node_id']);
$requestUri = eZSys::requestUri();
$process->Template = array('templateName'=>'design:workflow/eventtype/result/event_ezexample.tpl','templateVars'=>array('node'=>$node,'request_uri'=>$resquestUri));
return EZ_WORKFLOW_TYPE_STATUS_FETCH_TEMPLATE_REPEAT;
}
}
eZWorkflowEventType::registerType(EZ_WORKFLOW_TYPE_EXAMPLE_ID,'ezexampletype'); ?>
in the workflow.ini.append.php :
<?php /*
[EventSettings]
ExtensionDirectories[]=myevent
AvailableEventTypes[]=event_ezexample
*/ ?> and i active the extension.
but when i try to create a new workflow by th admin interface i have this erreur Error: eZWorkflowType::loadAndRegisterType Sep 13 2007 15:30:27 Workflow type not found: event_EZ_WORKFLOW_TYPE_EXAMPLE_ID, searched in these directories: kernel/classes/workflowtypes, extension/myevent/eventtypes so if sommbody know why???
|