summaryrefslogtreecommitdiff
path: root/edition.php
diff options
context:
space:
mode:
authorChristian Fowler <spider@viovio.com>2005-12-10 22:24:23 +0000
committerChristian Fowler <spider@viovio.com>2005-12-10 22:24:23 +0000
commit34a8fac038f903976d5696a1e2cdaad2100232ca (patch)
treeb881d2c993cba0c6a43bbf3ea76d95fac721f3cf /edition.php
parent845c78b116b1074200c4a4d198aeddd8cfbc0376 (diff)
downloadnewsletters-34a8fac038f903976d5696a1e2cdaad2100232ca.tar.gz
newsletters-34a8fac038f903976d5696a1e2cdaad2100232ca.tar.bz2
newsletters-34a8fac038f903976d5696a1e2cdaad2100232ca.zip
break out edition editing
Diffstat (limited to 'edition.php')
-rw-r--r--edition.php54
1 files changed, 54 insertions, 0 deletions
diff --git a/edition.php b/edition.php
new file mode 100644
index 0000000..655da4b
--- /dev/null
+++ b/edition.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ *
+ * Copyright (c) 2005 bitweaver.org
+ * All Rights Reserved. See copyright.txt for details and a complete list of authors.
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
+ *
+ * created 2005/12/10
+ *
+ * @author spider <spider@steelsun.com>
+ */
+
+// Initialization
+require_once( '../bit_setup_inc.php' );
+include_once( NEWSLETTERS_PKG_PATH.'nl_lib.php' );
+include_once( UTIL_PKG_PATH.'htmlMimeMail.php' );
+
+$gBitSystem->verifyPackage( 'newsletters' );
+
+require_once( NEWSLETTERS_PKG_PATH.'lookup_newsletter_edition_inc.php' );
+
+$listHash = array();
+$newsletters = $gContent->mNewsletter->getList( $listHash );
+$gBitSmarty->assign( 'newsletters', $newsletters );
+
+if (isset($_REQUEST["remove"] ) && $gContent->isValid() ) {
+ if( !empty( $_REQUEST['cancel'] ) ) {
+ // user cancelled - just continue on, doing nothing
+ } elseif( empty( $_REQUEST['confirm'] ) ) {
+ $formHash['remove'] = TRUE;
+ $formHash['edition_id'] = $gContent->mEditionId;
+ $gBitSystem->confirmDialog( $formHash, array( 'warning' => 'Are you sure you want to delete the newsletter edition '.$gContent->getTitle().'?' ) );
+ } else {
+ if( $gContent->expunge() ) {
+ header( "Location: ".NEWSLETTERS_PKG_URL.'edition.php' );
+ die;
+ }
+ }
+}
+
+if( $gContent->isValid() ) {
+ $mid = 'bitpackage:bitcommerce/view_edition.tpl';
+} else {
+ $listHash = array();
+ $editions = $gContent->getList( $listHash );
+ $gBitSmarty->assign_by_ref( 'editions', $editions );
+ $gBitSmarty->assign( 'listInfo', $listHash );
+ $mid = 'bitpackage:bitcommerce/list_editions.tpl';
+}
+
+// Display the template
+$gBitSystem->display( $mid );
+
+?> \ No newline at end of file