if (!$gContent->isvalid() && !empty($_REQUEST['notated_content_id'])) { if ($viewContent = $gContent->getLibertyObject($_REQUEST['notated_content_id'])) { $gBitSmarty->assign_by_ref('pageInfo', $viewContent->mInfo); $gContent =& $viewContent; $gBitSmarty->assign_by_ref('gContent', $gContent); } } if (!$gContent->isvalid()) { $gBitSystem->fatalError(tra('Unknown content to create sticky note')); } $gSticky = new BitSticky(isset($_REQUEST['sticky_id']) ? $_REQUEST['sticky_id'] : '', NULL, $gContent->mContentId); if (!$gSticky->load()) { $gSticky->mInfo['notated_content_id'] = $gContent->mContentId; } if (!empty($_REQUEST['save_sticky'])) { if ($gSticky->store($_REQUEST)) { header('Location: ' . $gContent->getDisplayUrl()); } } elseif (!empty($_REQUEST['preview'])) { } elseif (!empty($_REQUEST['delete'])) { $formHash['content_id'] = $gContent->mContentId; $formHash['sticky_id'] = $gSticky->mStickyId; $formHash['delete'] = TRUE; if (!empty($_POST['confirm'])) { if ($gSticky->expunge()) { header('Location: ' . $gContent->getDisplayUrl()); die; } else { $gBitSystem->confirmDialog($formHash, array('error' => implode($gContent->mErrors), 'warning' => tra('Are you sure you want to remove this sticky note?') . ' ' . $gSticky->mInfo['title'])); } } else {