b2evolution PHP Cross Reference Blogging Systems

Source: /inc/items/views/_item_list_table.view.php - 151 lines - 4276 bytes - Text - Print

Description: This file implements the post browsing in tracker mode 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 post browsing in tracker mode
   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   * Parts of this file are copyright (c)2005 by Daniel HAHLER - {@link http://thequod.de/contact}.
  10   *
  11   * @license http://b2evolution.net/about/license.html GNU General Public License (GPL)
  12   *
  13   * @package admin
  14   *
  15   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  16   * @author fplanque: Francois PLANQUE.
  17   *
  18   * @version $Id: _item_list_table.view.php 6136 2014-03-08 07:59:48Z manuel $
  19   */
  20  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  21  
  22  /**
  23   * @var Blog
  24   */
  25  global $Blog;
  26  /**
  27   * @var ItemList2
  28   */
  29  global $ItemList;
  30  
  31  global $edit_item_url, $delete_item_url;
  32  global $tab;
  33  global $Session;
  34  
  35  if( $highlight = param( 'highlight', 'integer', NULL ) )
  36  {    // There are lines we want to highlight:
  37      $result_fadeout = array( 'post_ID' => array($highlight) );
  38  
  39  } 
  40  elseif ( $highlight = $Session->get( 'highlight_id' ) )
  41  {
  42      $result_fadeout = array( 'post_ID' => array($highlight) );
  43      $Session->delete( 'highlight_id' );
  44  }
  45  else
  46  {    // Nothing to highlight
  47      $result_fadeout = NULL;
  48  }
  49  
  50  
  51  // Display title depending on selection params:
  52  echo $ItemList->get_filter_title( '<h2>', '</h2>', '<br />', NULL, 'htmlbody' );
  53  
  54  
  55  /*
  56      **
  57       * Callback to add filters on top of the result set
  58       *
  59      function filter_on_post_title( & $Form )
  60      {
  61          global $pagenow, $post_filter;
  62  
  63          $Form->hidden( 'filter_on_post_title', 1 );
  64          $Form->text( 'post_filter', $post_filter, 20, T_('Task title'), '', 60 );
  65      }
  66      $ItemList->filters_callback = 'filter_on_post_title';
  67  */
  68  
  69  
  70  $ItemList->title = T_('Post list');
  71  
  72  // Initialize Results object
  73  items_results( $ItemList, array(
  74          'tab' => $tab,
  75      ) );
  76  
  77  if( $ItemList->is_filtered() )
  78  {    // List is filtered, offer option to reset filters:
  79      $ItemList->global_icon( T_('Reset all filters!'), 'reset_filters', '?ctrl=items&amp;blog='.$Blog->ID.'&amp;filter=reset', T_('Reset filters'), 3, 3 );
  80  }
  81  
  82  if( $current_User->check_perm( 'blog_post_statuses', 'edit', false, $Blog->ID ) )
  83  {    // We have permission to add a post with at least one status:
  84      switch( $tab )
  85      {
  86          case 'pages':
  87              $label = T_('New page');
  88              $title = T_('Create a new page...');
  89              $new_ptyp_ID = 1000;
  90              $perm = 'page';
  91              break;
  92  
  93          case 'intros':
  94              $label = T_('New intro');
  95              $title = T_('Write a new intro text...');
  96              $new_ptyp_ID = 1600;
  97              $perm = 'intro';
  98              break;
  99  
 100          case 'podcasts':
 101              $label = T_('New episode');
 102              $title = T_('Package a new podcast episode...');
 103              $new_ptyp_ID = 2000;
 104              $perm = 'podcast';
 105              break;
 106  
 107          case 'links':
 108              $label = T_('New link');
 109              $title = T_('Add a sidebar link...');
 110              $new_ptyp_ID = 3000;
 111              $perm = 'sidebar';
 112              break;
 113  
 114          case 'ads':
 115              $label = T_('New advertisement');
 116              $title = T_('Add an advertisement...');
 117              $new_ptyp_ID = 4000;
 118              $perm = 'sidebar';
 119              break;
 120  
 121          default:
 122              $label = T_('New post');
 123              $title = T_('Write a new post...');
 124              $new_ptyp_ID = 1;
 125              $perm = ''; // No need to check
 126  
 127              $ItemList->global_icon( T_( 'Create multiple posts...' ), 'new', '?ctrl=items&amp;action=new_mass&amp;blog='.$Blog->ID.'&amp;item_typ_ID='.$new_ptyp_ID, T_( 'Mass create' ).' &raquo;', 3, 4 );
 128  
 129              break;
 130      }
 131  
 132      if( empty( $perm ) || $current_User->check_perm( 'blog_'.$perm, 'edit', false, $Blog->ID ) )
 133      {    // We have the permission to create and edit posts with this post type:
 134          $ItemList->global_icon( T_('Mass edit the current post list...'), '', '?ctrl=items&amp;action=mass_edit&amp;filter=restore&amp;blog='.$Blog->ID.'&amp;redirect_to='.regenerate_url( 'action', '', '', '&'), T_('Mass edit').' &raquo;', 3, 4 );
 135          $ItemList->global_icon( $title, 'new', '?ctrl=items&amp;action=new&amp;blog='.$Blog->ID.'&amp;item_typ_ID='.$new_ptyp_ID, $label.' &raquo;', 3, 4 );
 136      }
 137  }
 138  
 139  
 140  // EXECUTE the query now:
 141  $ItemList->restart();
 142  
 143  // Initialize funky display vars now:
 144  global $postIDlist, $postIDarray;
 145  $postIDlist = $ItemList->get_page_ID_list();
 146  $postIDarray = $ItemList->get_page_ID_array();
 147  
 148  // DISPLAY table now:
 149  $ItemList->display( NULL, $result_fadeout );
 150  
 151  ?>

title

Description

title

Description

title

Description

title

title

Body