} redirect_header("item.php", 2, $redirect_msg); exit; break; case "del": global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $_GET; $module_id = $xoopsModule->getVar('mid'); $gperm_handler =& xoops_gethandler('groupperm'); $itemid = isset($_POST['itemid']) ? intval($_POST['itemid']) : 0; $itemid = isset($_GET['itemid']) ? intval($_GET['itemid']) : $itemid; $itemObj = new ssItem($itemid); $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0; $title = isset($_POST['title']) ? $_POST['title'] : ''; if ($confirm) { if (!$smartsection_item_handler->delete($itemObj)) { redirect_header("item.php", 2, _AM_SS_ITEM_DELETE_ERROR . ss_formatErrors($itemObj->getErrors())); exit; } redirect_header("item.php", 2, sprintf(_AM_SS_ITEMISDELETED, $itemObj->title())); exit; } else { // no confirm: show deletion condition $itemid = isset($_GET['itemid']) ? intval($_GET['itemid']) : 0; xoops_cp_header(); xoops_confirm(array('op' => 'del', 'itemid' => $itemObj->itemid(), 'confirm' => 1, 'name' => $itemObj->title()), 'item.php', _AM_SS_DELETETHISITEM . " <br />'" . $itemObj->title() . "'. <br /> <br />", _AM_SS_DELETE); xoops_cp_footer(); } exit; break; case "default": default:
break; case "modify": global $xoopsUser; $fileid = isset($_POST['fileid']) ? intval($_POST['fileid']) : 0; // Creating the file object if ($fileid != 0) { $fileObj =& new ssFile($fileid); } else { $fileObj = $smartsection_file_handler->create(); } // Putting the values in the file object $fileObj->setVar('name', $_POST['name']); $fileObj->setVar('description', $_POST['description']); // Storing the file if (!$fileObj->store()) { redirect_header("item.php?op=mod&itemid=" . $fileObj->itemid(), 3, _AM_SS_FILE_EDITING_ERROR . ss_formatErrors($fileObj->getErrors())); exit; } redirect_header("item.php?op=mod&itemid=" . $fileObj->itemid(), 2, _AM_SS_FILE_EDITING_SUCCESS); exit; break; case "del": global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $_GET; $module_id = $xoopsModule->getVar('mid'); $gperm_handler =& xoops_gethandler('groupperm'); $fileid = isset($_POST['fileid']) ? intval($_POST['fileid']) : 0; $fileid = isset($_GET['fileid']) ? intval($_GET['fileid']) : $fileid; $fileObj = new ssFile($fileid); $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0; $title = isset($_POST['title']) ? $_POST['title'] : ''; if ($confirm) {
ss_saveCategory_Permissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read'); //ss_saveCategory_Permissions($groups_admin, $categoriesObj->categoryid(), 'category_admin'); if ($applyall) { // TODO : put this function in the category class ss_overrideItemsPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid()); } //Added by fx2024 $parentCat = $categoryObj->categoryid(); for ($i = 0; $i < sizeof($_POST['scname']); $i++) { if ($_POST['scname'][$i] != '') { $categoryObj = $smartsection_category_handler->create(); $categoryObj->setVar('name', $_POST['scname'][$i]); $categoryObj->setVar('parentid', $parentCat); $categoryObj->setGroups_read($grpread); if (!$categoryObj->store()) { redirect_header("javascript:history.go(-1)", 3, _AM_SS_SUBCATEGORY_SAVE_ERROR . ss_formatErrors($categoryObj->getErrors())); exit; } // TODO : put this function in the category class ss_saveCategory_Permissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read'); //ss_saveCategory_Permissions($groups_admin, $categoriesObj->categoryid(), 'category_admin'); if ($applyall) { // TODO : put this function in the category class ss_overrideItemsPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid()); } } } //end of fx2024 code redirect_header($redirect_to, 2, $redirect_msg); exit; break;
redirect_header("index.php", 3, _NOPERM); exit; } } else { $uid = $xoopsUser->uid(); } $fileObj = $smartsection_file_handler->create(); $fileObj->setVar('name', $_POST['name']); $fileObj->setVar('description', $_POST['description']); $fileObj->setVar('filename', $uploader->getSavedFileName()); $fileObj->setVar('mimetype', $uploader->getMediaType()); $fileObj->setVar('uid', $uid); $fileObj->setVar('itemid', $itemid); // Storing the file if (!$fileObj->store()) { redirect_header("javascript:history.go(-1)", 3, _MD_SS_FILEUPLOAD_ERROR . ss_formatErrors($fileObj->getErrors())); exit; } redirect_header("item.php?op=mod&itemid=" . $fileObj->itemid(), 2, _MD_SS_FILEUPLOAD_SUCCESS); } else { echo _MD_SS_FILEUPLOAD_ERROR . $uploader->getErrors(); } } exit; break; case 'form': default: global $xoopsUser, $myts; $name = $xoopsUser ? ucwords($xoopsUser->getVar("uname")) : 'Anonymous'; $sectionname = $myts->makeTboxData4Show($xoopsModule->getVar('name')); echo "<table width='100%' style='padding: 0; margin: 0; border-bottom: 1px solid #2F5376;'><tr>";