function diasalsa_content_store(&$pObject, &$pParamHash) { global $gBitSystem, $gLibertySystem, $gBitUser; $errors = NULL; if ($gBitSystem->isPackageActive('diasalsa') && !empty($pParamHash['link_action_content_id']) && is_numeric($pParamHash['link_action_content_id'])) { // check if it was already linked $action = new SalsaAction(); if ($action_content_id = $action->getActionLink($pObject->mContentId)) { // delete it $action->mContentId = $action_content_id; $action->load(); $action->expungeContentLink($pObject->mContentId); } // store the new link $action2 = new SalsaAction(NULL, $pParamHash['link_action_content_id']); $action2->load(); $action2->linkContent($pObject->mContentId); } }