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

Source for file edition_edit.php

Documentation is available at edition_edit.php

  1. <?php
  2. /**
  3.  *
  4.  * Copyright (c) 2005 bitweaver.org
  5.  * All Rights Reserved. See copyright.txt for details and a complete list of authors.
  6.  * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
  7.  *
  8.  * created 2005/12/10
  9.  *
  10.  * @package newsletters
  11.  * @author spider <spider@steelsun.com>
  12.  */
  13.  
  14. /** 
  15.  * Initialization
  16.  */
  17. require_once'../bit_setup_inc.php' );
  18. $gBitSystem->verifyPackage'newsletters' );
  19. $gBitSystem->verifyPermission'p_newsletters_create_editions' );
  20.  
  21. require_onceNEWSLETTERS_PKG_PATH.'lookup_newsletter_edition_inc.php' );
  22.  
  23. $listHash array();
  24. $newsletters $gContent->mNewsletter->getList$listHash );
  25.  
  26. ifempty$newsletters ) ) {
  27.     header'Location: '.NEWSLETTERS_PKG_URL.'newsletters.php' );
  28.     die;
  29. }
  30.  
  31. $gBitSmarty->assign'newsletters'$newsletters );
  32.  
  33. #edit preview needs this
  34. if!isset$_REQUEST['title'&& isset$gContent->mInfo['title') ) {
  35.     $_REQUEST['title'$gContent->mInfo['title'];
  36. }
  37.  
  38. if!empty$gContent->mInfo ) ) {
  39.     $formInfo $gContent->mInfo;
  40.     $formInfo['edit'!empty$gContent->mInfo['data')$gContent->mInfo['data''';
  41. }
  42.  
  43. ifisset$_REQUEST["edit") ) {
  44.     $formInfo['data'$_REQUEST["edit"];
  45. }
  46. ifisset$_REQUEST['title') ) {
  47.     $formInfo['title'$_REQUEST['title'];
  48. }
  49.  
  50. ifisset$_REQUEST['is_draft'&& $_REQUEST['is_draft']=='y' {
  51.     $formInfo['is_draft''y';
  52. }
  53.  
  54. ifisset$_REQUEST['reply_to') ) {
  55.     $formInfo['reply_to'$_REQUEST['reply_to'];
  56. }
  57.  
  58. if (isset($_REQUEST["preview"])) {
  59.     $gBitSmarty->assign('preview''y');
  60.  
  61.     $gBitSmarty->assign'title',!empty$_REQUEST["title"$_REQUEST["title"]:$gContent->mPageName );
  62.  
  63.     $parsed $gContent->parseData$formInfo['data'],!empty$_REQUEST['format_guid'$_REQUEST['format_guid':
  64.         isset$gContent->mInfo['format_guid'$gContent->mInfo['format_guid''tikiwiki' ) ) );
  65.     $gBitSmarty->assign_by_ref'parsed'$parsed );
  66.  
  67.     $gContent->invokeServices'content_preview_function' );
  68. elseif (isset($_REQUEST["save"])) {
  69.     if$gContent->store$_REQUEST ) ) {
  70.         // Add the content to the search index
  71. //        if( $gBitSystem->isPackageActive( 'search' ) and $gBitSystem->isFeatureActive("search_index_on_submit")) {
  72. //            require_once( SEARCH_PKG_PATH.'refresh_functions.php');
  73. //            refresh_index_tiki_content($gContent->mContentId);
  74. //        }
  75.         
  76.         header'Location: '.$gContent->getDisplayUrl() );
  77.         die;
  78.     else {
  79.         $formInfo $_REQUEST;
  80.         $formInfo['data'&$_REQUEST['edit'];
  81.     }
  82. else {
  83.     $gContent->invokeServices'content_edit_function' );
  84. }
  85.  
  86. // WYSIWYG and Quicktag variable
  87. $gBitSmarty->assign'textarea_id'LIBERTY_TEXT_AREA );
  88.  
  89. // formInfo might be set due to a error on submit
  90. ifempty$formInfo ) ) {
  91.     $formInfo &$gContent->mInfo;
  92. }
  93.  
  94. $gBitSmarty->assign_by_ref'pageInfo'$formInfo );
  95. $gBitSmarty->assign'errors'$gContent->mErrors );
  96.  
  97. // Configure quicktags list
  98. if$gBitSystem->isPackageActive'quicktags' ) ) {
  99.     include_onceQUICKTAGS_PKG_PATH.'quicktags_inc.php' );
  100. }
  101.  
  102. // load the ajax library for this page
  103. $gBitSmarty->assign'loadAjax''prototype' );
  104. // Display the template
  105. $gBitSystem->display'bitpackage:newsletters/edit_edition.tpl'($gContent->isValid(tra'Edit Edition' ).': '.$gContent->getTitle(tra'Create New Edition' )) );
  106.  
  107.  
  108. ?>

Documentation generated on Thu, 15 Feb 2007 20:38:25 +0000 by phpDocumentor 1.3.0