Friday 25 September 2009 9:24:28 am
Hi guys, first of all I wanna thank you for your guidelines, I solved almost all my problems... I have another question... I have to validate an object (in a custom edit handler), but in validateinput function I'm not able to retrieve the parent node id until I don't publish it. I check conditions in publish function, I can remove the node but I'm not able to alert the user after redirect.
function publish( $contentObjectID, $contentObjectVersion ){
$object =& eZContentObject::fetch( $contentObjectID );
$contentClass =& $object->attribute('content_class');
if($contentClass->attribute('id') == 51){
include_once( 'lib/ezutils/classes/ezoperationhandler.php' );
$nodooffertaID = $object->attribute('main_node_id');
$offerta = eZContentObject::fetchByNodeID($nodooffertaID);
$parentNodeID = $object->attribute('main_node_id');
$oggettoofferta = eZContentObjectTreeNode::fetch($parentNodeID);
$nodoastaID = $oggettoofferta->attribute('parent_node_id');
$oggettoasta = eZContentObject::fetchByNodeID($nodoastaID);
$dataMapasta = $oggettoasta->dataMap();
$chiusuraasta = $dataMapasta['data_chiusura'];
$datachiusura = $chiusuraasta->attribute('data_int');
if($datachiusura < mktime()){
//remove object
eZContentObjectTreeNode::removeNode($nodooffertaID);
}
}
}
I think if I can validate the object in validateinput I can alert user and then redirect him on the edit page with the alert message... Thankyou in advance
|