b2evolution PHP Cross Reference Blogging Systems

Source: /inc/items/views/_item_mass.form.php - 220 lines - 7472 bytes - Text - Print

Description: This file is part of b2evolution - {@link http://b2evolution.net/} See also {@link http://sourceforge.net/projects/evocms/}.

   1  <?php
   2  /**
   3   * This file is part of b2evolution - {@link http://b2evolution.net/}
   4   * See also {@link http://sourceforge.net/projects/evocms/}.
   5   *
   6   * @copyright (c)2009-2014 by Francois PLANQUE - {@link http://fplanque.net/}
   7   * Parts of this file are copyright (c)2009 by The Evo Factory - {@link http://www.evofactory.com/}.
   8   *
   9   * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
  10   *
  11   * {@internal Open Source relicensing agreement:
  12   * The Evo Factory grants Francois PLANQUE the right to license
  13   * The Evo Factory's contributions to this file and the b2evolution project
  14   * under any OSI approved OSS license (http://www.opensource.org/licenses/).
  15   * }}
  16   *
  17   * @package collections
  18   *
  19   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  20   * @author efy-maxim: Evo Factory / Maxim.
  21   * @author fplanque: Francois Planque.
  22   *
  23   * @version $Id: _item_mass.form.php 6136 2014-03-08 07:59:48Z manuel $
  24   */
  25  
  26  
  27  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  28  
  29  /**
  30   * @var User
  31   */
  32  global $current_User;
  33  /**
  34   * @var Item
  35   */
  36  global $edited_Item;
  37  /**
  38   * @var Blog
  39   */
  40  global $Blog;
  41  /**
  42   * @var Plugins
  43   */
  44  global $Plugins;
  45  /**
  46   * @var GeneralSettings
  47   */
  48  global $Settings;
  49  
  50  global $pagenow;
  51  
  52  global $mode;
  53  global $post_comment_status, $trackback_url, $item_tags;
  54  global $bozo_start_modified, $creating;
  55  global $item_title, $item_content;
  56  global $redirect_to;
  57  
  58  // Determine if we are creating or updating...
  59  $creating = is_create_action( $action );
  60  
  61  $Form = new Form( NULL, 'item_checkchanges', 'post' );
  62  
  63  $Form->global_icon( T_('Cancel editing!'), 'close', regenerate_url( 'action' ), 4, 2 );
  64  
  65  $Form->labelstart = '<strong>';
  66  $Form->labelend = "</strong>\n";
  67  
  68  // ================================ START OF EDIT FORM ================================
  69  
  70  $params = array();
  71  if( !empty( $bozo_start_modified ) )
  72  {
  73      $params['bozo_start_modified'] = true;
  74  }
  75  $Form->begin_form( '', '', $params );
  76  
  77      $Form->add_crumb( 'item' );
  78      $Form->hidden( 'ctrl', 'items' );
  79      $Form->hidden( 'blog', $Blog->ID );
  80      if( isset( $mode ) )   $Form->hidden( 'mode', $mode ); // used by bookmarklet
  81      if( isset( $edited_Item ) )   $Form->hidden( 'post_ID', $edited_Item->ID );
  82      $Form->hidden( 'redirect_to', $redirect_to );
  83  
  84      // In case we send this to the blog for a preview :
  85      $Form->hidden( 'preview', 1 );
  86      $Form->hidden( 'more', 1 );
  87      $Form->hidden( 'preview_userid', $current_User->ID );
  88  
  89      // Fields used in "advanced" form, but not here:
  90      $Form->hidden( 'post_locale', $edited_Item->get( 'locale' ) );
  91      $Form->hidden( 'item_typ_ID', $edited_Item->ptyp_ID );
  92      $Form->hidden( 'post_url', $edited_Item->get( 'url' ) );
  93      $Form->hidden( 'post_excerpt', $edited_Item->get( 'excerpt' ) );
  94      $Form->hidden( 'post_urltitle', $edited_Item->get( 'urltitle' ) );
  95      $Form->hidden( 'titletag', $edited_Item->get( 'titletag' ) );
  96      $Form->hidden( 'metadesc', $edited_Item->get_setting( 'post_metadesc' ) );
  97      $Form->hidden( 'custom_headers', $edited_Item->get_setting( 'post_custom_headers' ) );
  98  
  99      if( $Blog->get_setting( 'use_workflow' ) )
 100      {    // We want to use workflow properties for this blog:
 101          $Form->hidden( 'item_priority', $edited_Item->priority );
 102          $Form->hidden( 'item_assigned_user_ID', $edited_Item->assigned_user_ID );
 103          $Form->hidden( 'item_st_ID', $edited_Item->pst_ID );
 104          $Form->hidden( 'item_deadline', $edited_Item->datedeadline );
 105      }
 106      $Form->hidden( 'trackback_url', $trackback_url );
 107      $Form->hidden( 'item_featured', $edited_Item->featured );
 108      $Form->hidden( 'item_hideteaser', $edited_Item->get_setting( 'hide_teaser' ) );
 109      $Form->hidden( 'expiry_delay', $edited_Item->get_setting( 'post_expiry_delay' ) );
 110      $Form->hidden( 'item_order', $edited_Item->order );
 111      // CUSTOM FIELDS
 112      display_hidden_custom_fields( $Form, $edited_Item );
 113  
 114      // TODO: Form::hidden() do not add, if NULL?!
 115  
 116  ?>
 117  
 118  <div class="left_col">
 119  
 120      <?php
 121      // ############################ POST CONTENTS #############################
 122  
 123      $Form->begin_fieldset( T_('Mass post contents') );
 124      //$Form->begin_fieldset( T_('Mass post contents').get_manual_link('post_contents_fieldset') );
 125  
 126      $Form->hidden( 'post_title', 'None' );
 127      $Form->hidden( 'mass_create', '1' );
 128  
 129      // ---------------------------- TEXTAREA -------------------------------------
 130      $Form->fieldstart = '<div>';
 131      $Form->fieldend = "</div>\n";
 132      $Form->textarea_input( 'content', $item_content, 16, '', array( 'style' => 'width:99%;', 'note' => T_('Separate posts with a blank line. The first line of each post becomes a title.'), 'cols' => 40 , 'rows' => 33, 'id' => 'itemform_post_content' ) );
 133      $Form->fieldstart = '<div class="tile">';
 134      $Form->fieldend = '</div>';
 135      echo '<div style="height:6px"></div>';
 136  
 137      // ------------------------------- SETTINGS ---------------------------------
 138  
 139      $Form->checkbox( 'paragraphs_linebreak', false, '', T_( 'Create paragraphs at each line break' ), 'compose_layout' );
 140  
 141      // ------------------------------- ACTIONS ----------------------------------
 142  
 143      echo '<div class="edit_actions">';
 144  
 145      $next_action = ($creating ? 'create' : 'update');
 146      $Form->submit( array( 'actionArray['.$next_action.']', /* TRANS: This is the value of an input submit button */ T_('Create posts'), 'SaveButton' ) );
 147  
 148      echo '</div>';
 149  
 150      $Form->end_fieldset();
 151  
 152      ?>
 153  
 154  </div>
 155  
 156  <div class="right_col">
 157  
 158      <?php
 159      // ################### CATEGORIES ###################
 160  
 161      cat_select( $Form );
 162  
 163  
 164      // ################### VISIBILITY / SHARING ###################
 165  
 166      $Form->begin_fieldset( T_('Visibility / Sharing'), array( 'id' => 'itemform_visibility' ) );
 167  
 168      $Form->switch_layout( 'linespan' );
 169      visibility_select( $Form, $edited_Item->status, true );
 170      $Form->switch_layout( NULL );
 171  
 172      $Form->end_fieldset();
 173  
 174      // ################### TEXT RENDERERS ###################
 175  
 176      $Form->begin_fieldset( T_('Text Renderers'), array( 'id' => 'itemform_renderers' ) );
 177  
 178      // fp> TODO: there should be no param call here (shld be in controller)
 179      $edited_Item->renderer_checkboxes( param('renderers', 'array/string', NULL) );
 180  
 181      $Form->end_fieldset();
 182  
 183  
 184      // ################### COMMENT STATUS ###################
 185  
 186      if( ( $Blog->get_setting( 'allow_comments' ) != 'never' ) && ( $Blog->get_setting( 'disable_comments_bypost' ) ) )
 187      {
 188          $Form->begin_fieldset( T_('Comments'), array( 'id' => 'itemform_comments' ) );
 189  
 190          ?>
 191              <label title="<?php echo T_('Visitors can leave comments on this post.') ?>"><input type="radio" name="post_comment_status" value="open" class="checkbox" <?php if( $post_comment_status == 'open' ) echo 'checked="checked"'; ?> />
 192              <?php echo T_('Open') ?></label><br />
 193  
 194              <label title="<?php echo T_('Visitors can NOT leave comments on this post.') ?>"><input type="radio" name="post_comment_status" value="closed" class="checkbox" <?php if( $post_comment_status == 'closed' ) echo 'checked="checked"'; ?> />
 195              <?php echo T_('Closed') ?></label><br />
 196  
 197              <label title="<?php echo T_('Visitors cannot see nor leave comments on this post.') ?>"><input type="radio" name="post_comment_status" value="disabled" class="checkbox" <?php if( $post_comment_status == 'disabled' ) echo 'checked="checked"'; ?> />
 198              <?php echo T_('Disabled') ?></label><br />
 199          <?php
 200  
 201          $Form->end_fieldset();
 202      }
 203  
 204      ?>
 205  
 206  </div>
 207  
 208  <div class="clear"></div>
 209  
 210  <?php
 211  
 212  // ================================== END OF EDIT FORM ==================================
 213  
 214  $Form->end_form();
 215  
 216  // ####################### JS BEHAVIORS #########################
 217  // New category input box:
 218  echo_onchange_newcat();
 219  
 220  ?>

title

Description

title

Description

title

Description

title

title

Body