From 0d913f57582229279916b9ff29645389e4b13a2c Mon Sep 17 00:00:00 2001 From: Christian Fowler Date: Sat, 6 Jan 2007 06:22:12 +0000 Subject: massive clean up to newsletters - improve usability for listing, editing, creating, and subscriptions --- BitNewsletter.php | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'BitNewsletter.php') diff --git a/BitNewsletter.php b/BitNewsletter.php index 4d7390c..345f432 100644 --- a/BitNewsletter.php +++ b/BitNewsletter.php @@ -1,12 +1,12 @@ , spiderr * - * @version $Revision: 1.23 $ $Date: 2006/10/13 09:22:47 $ $Author: lsces $ + * @version $Revision: 1.24 $ $Date: 2007/01/06 06:22:12 $ $Author: spiderr $ */ /** @@ -78,6 +78,12 @@ vd( 'not done yet' ); return( count( $this->mInfo ) ); } + function loadEditions() { + if( $this->isValid() ) { + $this->mEditions = $this->getEditions(); + } + } + function store( &$pParamHash ) { //$nl_id, $name, $description, $allow_user_sub, $allow_any_sub, $unsub_msg, $validate_addr) { if( $this->verify( $pParamHash ) ) { $this->mDb->StartTrans(); @@ -414,10 +420,15 @@ vd( 'not done yet' ); } - function getEditions() { + function getEditions( $pNewsletterId = NULL ) { $ret = array(); - if( $this->isValid() ) { - $listHash = array( 'nl_id' => $this->mNewsletterId ); + if( empty( $pNewsletterId ) ) { + $nlId = $this->mNewsletterId; + } elseif( BitBase::verifyId( $pNewsletterId ) ) { + $nlId = $pNewsletterId; + } + if( !empty( $nlId ) ) { + $listHash = array( 'nl_id' => $nlId ); $ret = BitNewsletterEdition::getList( $listHash ); } return $ret; -- cgit v1.3