b2evolution PHP Cross Reference Blogging Systems

Source: /inc/items/views/_item_mass_edit.view.php - 93 lines - 2814 bytes - Text - Print

Description: This file implements the UI for posts mass edit. This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}. See also {@link http://sourceforge.net/projects/evocms/}.

   1  <?php
   2  /**
   3   * This file implements the UI for posts mass edit.
   4   *
   5   * This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}.
   6   * See also {@link http://sourceforge.net/projects/evocms/}.
   7   *
   8   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}.
   9  *
  10   * @license http://b2evolution.net/about/license.html GNU General Public License (GPL)
  11   *
  12   * {@internal Open Source relicensing agreement:
  13   * EVO FACTORY grants Francois PLANQUE the right to license
  14   * EVO FACTORY contributions to this file and the b2evolution project
  15   * under any OSI approved OSS license (http://www.opensource.org/licenses/).
  16   * }}
  17   *
  18   * @package evocore
  19   *
  20   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  21   * @author asimo: Evo Factory / Attila Simo
  22   *
  23   * @version $Id: _item_mass_edit.view.php 6136 2014-03-08 07:59:48Z manuel $
  24   */
  25  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  26  
  27  /**
  28   * @var Blog
  29   */
  30  global $Blog;
  31  /**
  32   * @var ItemList2
  33   */
  34  global $ItemList;
  35  
  36  global $redirect_to, $current_User, $admin_url;
  37  
  38  $perm_slugs_view = $current_User->check_perm( 'slugs', 'view' );
  39  
  40  $Form = new Form();
  41  
  42  $redirect_to = regenerate_url( 'action', '', '', '&' );
  43  $Form->global_icon( T_('Cancel editing!'), 'close', $redirect_to, 4, 2 );
  44  
  45  $Form->begin_form( 'fform', T_('Mass edit the current post list') );
  46  
  47  // hidden params
  48  $Form->add_crumb( 'item' );
  49  $Form->hidden( 'ctrl', 'items' );
  50  $Form->hidden( 'blog', $Blog->ID );
  51  $Form->hidden( 'redirect_to', $redirect_to );
  52  $Form->hidden( 'filter', 'restore' );
  53  
  54  // Run the query:
  55  $ItemList->query();
  56  
  57  if( $ItemList->get_num_rows() > 100 )
  58  {
  59      $Form->info( '', sprintf( T_('There are %d posts in your selection, only the first 100 are displayed'), $ItemList->get_num_rows() ) );
  60  }
  61  
  62  /*
  63   * Display posts:
  64   */
  65  while( $Item = & $ItemList->get_item() )
  66  {
  67      if( $ItemList->current_idx > 100 )
  68      {
  69          break;
  70      }
  71  
  72      $Form->begin_fieldset( '', array( 'class' => 'fieldset clear' ));
  73  
  74      $edit_slug_link = '';
  75      if( $perm_slugs_view )
  76      {    // user has permission to view slugs:
  77          $edit_slug_link = '&nbsp;'.action_icon( T_('Edit slugs...'), 'edit', $admin_url.'?ctrl=slugs&amp;slug_item_ID='.$Item->ID );
  78      }
  79  
  80      $Form->text( 'mass_title_'.$Item->ID , htmlspecialchars_decode( $Item->get( 'title' ) ), 70, T_('Title'), '', 255 );
  81      $Form->text( 'mass_urltitle_'.$Item->ID, $Item->get_slugs(), 70, T_('URL slugs').$edit_slug_link, '', 255 );
  82      $Form->text( 'mass_titletag_'.$Item->ID, $Item->get( 'titletag' ), 70, htmlspecialchars( T_('<title> tag') ), '', 255 );
  83  
  84      $Form->end_fieldset();
  85  }
  86  
  87  // Submit & reset buttons
  88  $Form->buttons( array(array('submit', 'actionArray[mass_save]', T_('Save changes'), 'SaveButton' ),
  89                      array('reset', '', T_('Reset'), 'ResetButton' ) ) );
  90  
  91  $Form->end_form();
  92  
  93  ?>

title

Description

title

Description

title

Description

title

title

Body