break; case 'post': // Putting the values about the ITEM in the ITEM object // print_r($itemObj->getVars()); $itemObj->setVarsFromRequest(); //print_r($_POST); //print_r($itemObj->getVars()); //exit; // Storing the item object in the database if (!$itemObj->store()) { redirect_header('javascript:history.go(-1)', 2, _MD_PUBLISHER_SUBMIT_ERROR); // exit(); } // attach file if any if ($itemUploadFile && $itemUploadFile['name'] != '') { $fileUploadResult = publisherUploadFile(false, true, $itemObj); if ($fileUploadResult !== true) { redirect_header('javascript:history.go(-1)', 3, $fileUploadResult); exit; } } // if autoapprove_submitted. This does not apply if we are editing an article if (!$itemId) { if ($itemObj->getVar('status') == PublisherConstants::PUBLISHER_STATUS_PUBLISHED) { // We do not not subscribe user to notification on publish since we publish it right away // Send notifications $itemObj->sendNotifications(array(PublisherConstants::PUBLISHER_NOTIFY_ITEM_PUBLISHED)); $redirect_msg = _MD_PUBLISHER_ITEM_RECEIVED_AND_PUBLISHED; redirect_header($itemObj->getItemUrl(), 2, $redirect_msg); } else { // Subscribe the user to On Published notification, if requested
$error_msg = _AM_PUBLISHER_ITEMNOTUPDATED; } else { $error_msg = _AM_PUBLISHER_ITEMNOTCREATED; } $redirect_msg = _AM_PUBLISHER_ITEM_REJECTED; break; } $itemObj->setVar('status', $newStatus); // Storing the item if (!$itemObj->store()) { redirect_header('javascript:history.go(-1)', 3, $error_msg . publisherFormatErrors($itemObj->getErrors())); // exit; } // attach file if any if (($item_upload_file = XoopsRequest::getArray('item_upload_file', '', 'FILES')) && $item_upload_file['name'] !== '') { $file_upload_result = publisherUploadFile(false, false, $itemObj); if ($file_upload_result !== true) { redirect_header('javascript:history.go(-1)', 3, $file_upload_result); // exit; } } // Send notifications if ($notifToDo) { $itemObj->sendNotifications($notifToDo); } redirect_header('item.php', 2, $redirect_msg); break; case 'del': $itemObj =& $publisher->getHandler('item')->get($itemid); $confirm = XoopsRequest::getInt('confirm', '', 'POST'); if ($confirm) {
$uploadForm->display(); if ($fileid != 0) { publisherCloseCollapsableBar('editfile', 'editfileicon'); } else { publisherCloseCollapsableBar('addfile', 'addfileicon'); } } $false = false; /* -- Available operations -- */ switch ($op) { case 'uploadfile': publisherUploadFile(false, true, $false); exit; break; case 'uploadanother': publisherUploadFile(true, true, $false); exit; break; case 'mod': $fileid = XoopsRequest::getInt('fileid', 0, 'GET'); $itemid = XoopsRequest::getInt('itemid', 0, 'GET'); if ($fileid == 0 && $itemid == 0) { redirect_header('javascript:history.go(-1)', 3, _AM_PUBLISHER_NOITEMSELECTED); // exit(); } publisherCpHeader(); include_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); publisher_editFile(true, $fileid, $itemid); break; case 'modify': $fileid = XoopsRequest::getInt('fileid', 0, 'POST');