Source for file edition_edit.php
Documentation is available at edition_edit.php
* Copyright (c) 2005 bitweaver.org
* All Rights Reserved. See below for details and a complete list of authors.
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details
* @author spider <spider@steelsun.com>
require_once( '../kernel/setup_inc.php' );
$gBitSystem->verifyPackage( 'newsletters' );
require_once( NEWSLETTERS_PKG_PATH. 'lookup_newsletter_edition_inc.php' );
$newsletters = $gContent->mNewsletter->getList( $listHash );
if( empty( $newsletters ) ) {
header( 'Location: '. NEWSLETTERS_PKG_URL. 'newsletters.php' );
$gBitSmarty->assign( 'newsletters', $newsletters );
if( !isset ( $_REQUEST['title'] ) && isset ( $gContent->mInfo['title'] ) ) {
$_REQUEST['title'] = $gContent->mInfo['title'];
if( !empty( $gContent->mInfo ) ) {
$formInfo = $gContent->mInfo;
$formInfo['edit'] = !empty( $gContent->mInfo['data'] )? $gContent->mInfo['data'] : '';
if( isset ( $_REQUEST["edit"] ) ) {
$formInfo['data'] = $_REQUEST["edit"];
if( isset ( $_REQUEST['title'] ) ) {
$formInfo['title'] = $_REQUEST['title'];
if( isset ( $_REQUEST['is_draft'] ) && $_REQUEST['is_draft']== 'y' ) {
$formInfo['is_draft'] = 'y';
if( isset ( $_REQUEST['reply_to'] ) ) {
$formInfo['reply_to'] = $_REQUEST['reply_to'];
if (isset ($_REQUEST["preview"])) {
$gBitSmarty->assign('preview', 'y');
$gBitSmarty->assign( 'title',!empty( $_REQUEST["title"] ) ? $_REQUEST["title"] : $gContent->getTitle() );
$parsed = $gContent->parseData( $formInfo['data'],( !empty( $_REQUEST['format_guid'] ) ? $_REQUEST['format_guid'] :
( isset ( $gContent->mInfo['format_guid'] ) ? $gContent->mInfo['format_guid'] : 'tikiwiki' ) ) );
$gBitSmarty->assign_by_ref( 'parsed', $parsed );
$gContent->invokeServices( 'content_preview_function' );
} elseif (isset ($_REQUEST["save"])) {
if( $gContent->store( $_REQUEST ) ) {
// Add the content to the search index
// if( $gBitSystem->isPackageActive( 'search' ) and $gBitSystem->isFeatureActive("search_index_on_submit")) {
// require_once( SEARCH_PKG_PATH.'refresh_functions.php');
// refresh_index_tiki_content($gContent->mContentId);
$formInfo['data'] = &$_REQUEST['edit'];
$gContent->invokeServices( 'content_edit_function' );
// WYSIWYG and Quicktag variable
// formInfo might be set due to a error on submit
if( empty( $formInfo ) ) {
$formInfo = &$gContent->mInfo;
$gBitSmarty->assign_by_ref( 'pageInfo', $formInfo );
$gBitSmarty->assign( 'errors', $gContent->mErrors );
$gBitSystem->display( 'bitpackage:newsletters/edit_edition.tpl', ($gContent->isValid() ? tra( 'Edit Edition' ). ': '. $gContent->getTitle() : tra( 'Create New Edition' )) , array( 'display_mode' => 'edit' ));
|