return $Result; } $contentID = $comment->attribute('contentobject_id'); // get if notification is enabled and notification value $ini = eZINI::instance('ezcomments.ini'); $formSettings = $ini->variable('FormSettings', 'AvailableFields'); $notificationEnabled = in_array('notificationField', $formSettings); $emailEnabled = in_array('email', $formSettings); $notified = null; if ($notificationEnabled) { $notified = ezcomSubscription::exists($contentID, $languageID, 'ezcomcomment', $comment->attribute('email')); $tpl->setVariable('notified', $notified); } if ($Module->isCurrentAction('UpdateComment')) { // Validate given input date against form setup $formTool = ezcomEditCommentTool::instance(); $formStatus = $formTool->checkVars(); if (!$formStatus) { // missing form data $tpl->setVariable('error_message', ezpI18n::tr('ezcomments/comment/add/form', 'There is a problem with your comment form ')); $tpl->setVariable('validation_messages', $formTool->messages()); return showComment($comment, $tpl); } //TODO: code from 93 can be implement in a class, see another TODO in add.php $formTool->fillObject($comment); $time = time(); $comment->setAttribute('modified', $time); // update comments $commentManager = ezcomCommentManager::instance(); $clientNotified = $formTool->fieldValue('notificationField'); $updateResult = null;
public static function instance() { if (is_null(self::$instance)) { $ini = eZINI::instance('ezcomments.ini'); $className = $ini->variable('ManagerClasses', 'EditCommentToolClass'); self::$instance = new $className(); } return self::$instance; }