function onPublish($attribute, $contentObject, $publishedNodes)
 {
     $user = eZUser::currentUser();
     $address = $user->attribute('email');
     $userID = $user->attribute('contentobject_id');
     $nodeIDList = eZSubtreeNotificationRule::fetchNodesForUserID($user->attribute('contentobject_id'), false);
     if ($attribute->attribute('data_int') == '1') {
         $newSubscriptions = array();
         foreach ($publishedNodes as $node) {
             if (!in_array($node->attribute('node_id'), $nodeIDList)) {
                 $newSubscriptions[] = $node->attribute('node_id');
             }
         }
         foreach ($newSubscriptions as $nodeID) {
             $rule = eZSubtreeNotificationRule::create($nodeID, $userID);
             $rule->store();
         }
     } else {
         foreach ($publishedNodes as $node) {
             if (in_array($node->attribute('node_id'), $nodeIDList)) {
                 eZSubtreeNotificationRule::removeByNodeAndUserID($user->attribute('contentobject_id'), $node->attribute('node_id'));
             }
         }
     }
     return true;
 }