// Public License along with this program; if not, write to the Free // Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. // // // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ## // /*! \file edit_newslettertype.php */ $extension = 'eznewsletter'; $base = eZExtension::baseDirectory(); $baseDir = "{$base}/{$extension}/classes/"; $Module = $Params['Module']; $http = eZHTTPTool::instance(); $newsletterTypeID = $Params['NewsletterTypeID']; $newsletterType = eZNewsletterType::fetchDraft($newsletterTypeID); if (!$newsletterType) { $newsletterType = eZNewsletterType::create(); $Module->redirectToView('edit_type', array($newsletterType->attribute('id'))); } if (!$newsletterType->siteaccessAllowed()) { return $Module->handleError(eZError::KERNEL_ACCESS_DENIED, 'kernel'); } $warning = array(); if ($http->hasPostVariable('StoreButton') || $http->hasPostVariable('BrowseArticlePool') || $http->hasPostVariable('DeleteArticlePool') || $http->hasPostVariable('BrowseRelatedObject_1') || $http->hasPostVariable('DeleteRelatedObject_1') || $http->hasPostVariable('BrowseRelatedObject_2') || $http->hasPostVariable('DeleteRelatedObject_2') || $http->hasPostVariable('BrowseRelatedObject_3') || $http->hasPostVariable('DeleteRelatedObject_3') || $http->hasPostVariable('BrowseInbox') || $http->hasPostVariable('DeleteInbox')) { if (0 < strlen($http->postVariable('NewsletterTypeName'))) { $newsletterType->setAttribute('name', $http->postVariable('NewsletterTypeName')); } else { $warning[] = ezpI18n::tr('eznewsletter/edit_newslettertype', 'You have not defined a name for this newslettertype'); } $modifierDays = $http->hasPostVariable('SendModifierDays') ? $http->postVariable('SendModifierDays') : 0;
function removeDraft() { $newsletterTypeDraft = eZNewsletterType::fetchDraft($this->attribute('id')); $newsletterTypeDraft->remove(); }