summaryrefslogtreecommitdiff
path: root/edition_edit.php
blob: b7360ca55b86c57ccff95e55cd49c99fe382def6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?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["preview"])) {
	$gBitSmarty->assign('preview', 'y');

	//$parsed = $tikilib->parse_data($_REQUEST["content"]);
	$parsed = $_REQUEST["edit"];
	$gBitSmarty->assign('parsed', $parsed);
	$info["data"] = $_REQUEST['edit'];
	$info["subject"] = $_REQUEST['title'];
	$gBitSmarty->assign('info', $info);
} elseif (isset($_REQUEST["save"])) {
	// Now send the newsletter to all the email addresses and save it in sent_newsletters
	$gBitSmarty->assign('presend', 'y');

	$subscribers = $nllib->get_subscribers($_REQUEST["nl_id"]);
	$gBitSmarty->assign('nl_id', $_REQUEST["nl_id"]);
	$gBitSmarty->assign('edit', $_REQUEST['edit']);
	$gBitSmarty->assign('subject', $_REQUEST['title']);
	$cant = count($subscribers);
	$gBitSmarty->assign('subscribers', $cant);
}

// Display the template
$gBitSystem->display( 'bitpackage:newsletters/edit_edition.tpl' );


?>