b2evolution PHP Cross Reference Blogging Systems

Source: /inc/items/views/_item_history_compare.view.php - 100 lines - 4021 bytes - Text - Print

Description: This file implements the Item history view to compare two revisions

   1  <?php
   2  /**

   3   * This file implements the Item history view to compare two revisions

   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   * @package admin

  13   *

  14   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}

  15   * @author fplanque: Francois PLANQUE.

  16   *

  17   * @version $Id: _item_history_compare.view.php 849 2012-02-16 09:09:09Z attila $

  18   */
  19  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  20  
  21  global $admin_url;
  22  
  23  global $edited_Item, $Revision_1, $Revision_2;
  24  
  25  global $revisions_difference_title, $revisions_difference_content;
  26  
  27  $post_statuses = get_visibility_statuses();
  28  
  29  $Form = new Form( NULL, 'history', 'post', 'compact' );
  30  
  31  $Form->global_icon( T_('Cancel comparing!'), 'close', regenerate_url( 'action', 'action=history' ) );
  32  
  33  $Form->begin_form( 'fform', sprintf( T_('Difference between revisions for: %s'), $edited_Item->get_title() ) );
  34  
  35  ?>
  36  <table border="0" width="100%" cellpadding="0" cellspacing="4" class="diff">
  37      <col class="diff-marker" />
  38      <col class="diff-content" />
  39      <col class="diff-marker" />
  40      <col class="diff-content" />
  41      <tr>
  42          <td colspan="2" class="diff-otitle">
  43              <p><?php
  44                  $iver_editor_user_link = get_user_identity_link( NULL, $Revision_1->iver_edit_user_ID );
  45                  printf( T_('Revision #%s as of %s by %s'),
  46                      $Revision_1->iver_ID == 0 ? '(<b>'.T_('Current version').'</b>)' : $Revision_1->iver_ID,
  47                      mysql2localedatetime( $Revision_1->iver_edit_datetime, 'Y-m-d', 'H:i:s' ),
  48                      ( empty( $iver_editor_user_link ) ? T_( 'Deleted user' ) : $iver_editor_user_link ) );
  49              ?>
  50              (<a href="<?php echo url_add_param( $admin_url, 'ctrl=items&amp;action=history_details&amp;p='.$edited_Item->ID.'&amp;r='.$Revision_1->iver_ID ) ?>" title="<?php echo T_('View this revision') ?>"><?php echo T_('View'); ?></a>)
  51              </p>
  52              <div class="center"><small><?php echo T_('Status').': '.$post_statuses[ $Revision_1->iver_status ]; ?></small></div>
  53          </td>
  54          <td colspan="2" class="diff-ntitle">
  55              <p><?php
  56                  $iver_editor_user_link = get_user_identity_link( NULL, $Revision_2->iver_edit_user_ID );
  57                  printf( T_('Revision #%s as of %s by %s'),
  58                      $Revision_2->iver_ID == 0 ? '(<b>'.T_('Current version').'</b>)' : $Revision_2->iver_ID,
  59                      mysql2localedatetime( $Revision_2->iver_edit_datetime, 'Y-m-d', 'H:i:s' ),
  60                      ( empty( $iver_editor_user_link ) ? T_('(deleted user)') : $iver_editor_user_link ) );
  61              ?>
  62              (<a href="<?php echo url_add_param( $admin_url, 'ctrl=items&amp;action=history_details&amp;p='.$edited_Item->ID.'&amp;r='.$Revision_2->iver_ID ) ?>" title="<?php echo T_('View this revision') ?>"><?php echo T_('View'); ?></a>)
  63              </p>
  64              <div class="center"><small<?php echo $Revision_1->iver_status != $Revision_2->iver_status ? ' style="color:#F00;font-weight:bold"' : ''; ?>><?php echo T_('Status').': '.$post_statuses[ $Revision_2->iver_status ]; ?></small></div>
  65          </td>
  66      </tr>
  67  <?php
  68      if( !empty( $revisions_difference_title ) )
  69      {    // Display title difference
  70          echo $revisions_difference_title;
  71      }
  72      else
  73      {    // No title difference
  74      ?>
  75      <tr>
  76          <td colspan="2" class="diff-title-deletedline"><?php echo $Revision_1->iver_title ?></td>
  77          <td colspan="2" class="diff-title-addedline"><?php echo $Revision_2->iver_title ?></td>
  78      </tr>
  79      <?php
  80      }
  81  ?>
  82      <tr><td colspan="4">&nbsp;</td></tr>
  83  <?php
  84  if( !empty( $revisions_difference_content ) )
  85  {    // Dispay content difference
  86      echo $revisions_difference_content;
  87  }
  88  else
  89  {    // No content difference
  90      echo '<tr><td colspan="4" class="center red"><b>';
  91      echo T_('No difference between contents of the selected revisions');
  92      echo '</b></td></tr>';
  93  }
  94  ?>
  95  </table>
  96  <?php
  97  
  98  $Form->end_form();
  99  
 100  ?>

title

Description

title

Description

title

Description

title

title

Body