public function saveItem($existingItem = false, $input, SimplePortal_ItemHandler_Abstract $handler, $data, $modAction = SimplePortal_Static::MOD_ACTION_EDIT) { $dm = XenForo_DataWriter::create('SimplePortal_DataWriter_PortalItem'); if ($existingItem) { $dm->setExistingData($existingItem); } $this->setDwFieldsFromInput($dm, $input); $handler->processAdditonalSaveData($dm, $input); $dm->save(); XenForo_Model_Log::logModeratorAction($input['content_type'], $data, $modAction); return $dm; }
/** * returns array with all handlers * @return array */ public function getPortalItemHandlerClasses() { if (($classes = $this->_getLocalCacheData('simpleportal_handlers')) !== false) { return $classes; } $handlers = $this->getPortalItemHandlers(); $classes = array(); foreach ($handlers as $contentType => $handler) { $class = SimplePortal_ItemHandler_Abstract::create($handler); $classes[$contentType] = $class; } $this->setLocalCacheData('simpleportal_handlers', $classes); return $classes; }