newsletters
[ class tree: newsletters ] [ index: newsletters ] [ all elements ]

Source for file edition.php

Documentation is available at edition.php

  1. <?php
  2. /**
  3.  * Copyright (c) 2005 bitweaver.org
  4.  * All Rights Reserved. See below for details and a complete list of authors.
  5.  * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details
  6.  *
  7.  * created 2005/12/10
  8.  *
  9.  * @package newsletters
  10.  * @author spider <spider@steelsun.com>
  11.  */
  12.  
  13. /** 
  14.  * Initialization
  15.  */
  16. require_once( '../kernel/setup_inc.php' );
  17.  
  18. $gBitSystem->verifyPackage( 'newsletters' );
  19.  
  20. require_once( NEWSLETTERS_PKG_PATH.'lookup_newsletter_edition_inc.php' );
  21.  
  22. $listHash = array();
  23. $newsletters = $gContent->mNewsletter->getList( $listHash );
  24. $gBitSmarty->assign( 'newsletters', $newsletters );
  25.  
  26. if (isset($_REQUEST["remove"] ) && $gContent->isValid() ) {
  27.     if( !empty( $_REQUEST['cancel'] ) ) {
  28.         // user cancelled - just continue on, doing nothing
  29.     } elseif( empty( $_REQUEST['confirm'] ) ) {
  30.         $formHash['remove'] = TRUE;
  31.         $formHash['edition_id'] = $gContent->mEditionId;
  32.         $gBitSystem->confirmDialog( $formHash, 
  33.             array( 
  34.                 'warning' => tra('Are you sure you want to delete this newsletter edition?'). ' ' . $gContent->getTitle()
  35.             )
  36.         );
  37.     } else {
  38.         if( $gContent->expunge() ) {
  39.             header( "Location: ".NEWSLETTERS_PKG_URL.'edition.php' );
  40.             die;
  41.         }
  42.     }
  43. }
  44.  
  45. if( $gContent->isValid() ) {
  46.     $title = $gContent->mInfo['title'];
  47.     $mid = 'bitpackage:newsletters/view_edition.tpl';
  48. } else {
  49.     $listHash = array();
  50.     $editions = $gContent->getList( $listHash );
  51.     $gBitSmarty->assign_by_ref( 'editionList', $editions );
  52.     $gBitSmarty->assign( 'listInfo', $listHash );
  53.     $title = tra("List Editions");
  54.     $mid = 'bitpackage:newsletters/list_editions.tpl';
  55. }
  56.  
  57. // Display the template
  58. $gBitSystem->display( $mid, $title , array( 'display_mode' => 'edit' ));
  59.  
  60. ?>

Documentation generated on Wed, 29 Jul 2015 13:56:25 +0000 by phpDocumentor 1.5.0-lsces