function _insert(&$object, $caption) { if (class_exists('XoopsMultiTokenHandler') && !XoopsMultiTokenHandler::quickValidate($this->mName . '_' . $this->mOp)) { if (is_object($object)) { return $this->_showForm($object, $caption, $this->__e('Token Error')); } else { $this->mErrorMsg = $this->__e('Token Error'); return NBFRAME_ACTION_ERROR; } } if (is_object($object)) { $this->mObject =& $object; if (is_object($this->mObjectForm)) { $this->mObjectForm->bindAction($this, 1); $this->mObjectForm->prepare(); $this->mObjectForm->setupRequests('POST'); if ($this->mObjectForm->canVerify()) { $object->enableVerify(); } } if ($this->mRequest->hasError()) { return $this->_showForm($object, $caption, $this->mRequest->getErrors()); } $object->SetRequestVars($this->mRequest); if (!$object->checkGroupPerm('write', $this->mBypassAdminCheck)) { $this->mErrorMsg = $this->__e('Permission Error'); return NBFRAME_ACTION_ERROR; } if ($this->mObjectHandler->insert($object, false, true)) { return NBFRAME_ACTION_SUCCESS; } else { return $this->_showForm($object, $caption, $this->mObjectHandler->getErrors()); } } else { $this->mErrorMsg = $this->__e('No Record is found'); return NBFRAME_ACTION_ERROR; } }