[ Index ]
 

Code source de b2evolution 2.1.0-beta

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/blogs/inc/items/views/ -> _item_list_table.view.php (source)

   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-2007 by Francois PLANQUE - {@link http://fplanque.net/}.

   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,v 1.3 2007/09/26 20:26:36 fplanque Exp $

  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  
  33  if( $highlight = param( 'highlight', 'integer', NULL ) )
  34  {    // There are lines we want to highlight:
  35      $result_fadeout = array( 'post_ID' => array($highlight) );
  36  }
  37  else
  38  {    // Nothing to highlight
  39      $result_fadeout = NULL;
  40  }
  41  
  42  
  43  // Display title depending on selection params:

  44  echo $ItemList->get_filter_title( '<h2>', '</h2>', '<br />', NULL, 'htmlbody' );
  45  
  46  
  47  /*

  48      **

  49       * Callback to add filters on top of the result set

  50       *

  51      function filter_on_post_title( & $Form )

  52      {

  53          global $pagenow, $post_filter;

  54  

  55          $Form->hidden( 'filter_on_post_title', 1 );

  56          $Form->text( 'post_filter', $post_filter, 20, T_('Task title'), '', 60 );

  57      }

  58      $ItemList->filters_callback = 'filter_on_post_title';

  59  */
  60  
  61  
  62  $ItemList->title = T_('Post list');
  63  
  64  // Issue date:

  65  $ItemList->cols[] = array(
  66          'th' => T_('Date'),
  67          'order' => 'datestart',
  68          'default_dir' => 'D',
  69          'th_class' => 'nowrap',
  70          'td_class' => 'nowrap',
  71          'td' => '@get_permanent_link( get_icon(\'permalink\') )@ <span class="date">@get_issue_date()@</span>',
  72      );
  73  
  74  
  75  // Blog name:

  76  if( $Blog->get_setting( 'aggregate_coll_IDs' ) )
  77  { // Aggregated blog: display name of blog
  78      $ItemList->cols[] = array(
  79              'th' => T_('Blog'),
  80              'th_class' => 'nowrap',
  81              'td_class' => 'nowrap',
  82              'td' => '@load_Blog()@<a href="¤regenerate_url( \'blog,results_order\', \'blog=@blog_ID@\' )¤">@Blog->dget(\'shortname\')@</a>',
  83          );
  84  }
  85  
  86  
  87  // Author:

  88  $ItemList->cols[] = array(
  89          'th' => T_('Author'),
  90          'th_class' => 'nowrap',
  91          'td_class' => 'nowrap',
  92          'order' => 'creator_user_ID',
  93          'td' => '@get(\'t_author\')@',
  94      );
  95  
  96  
  97  /**

  98   * Task title

  99   */
 100  function task_title_link( $Item )
 101  {
 102      global $current_User;
 103  
 104      $col = locale_flag( $Item->locale, 'w16px', 'flag', '', false ).' ';
 105  
 106      $Item->get_Blog();
 107  
 108      if( $Item->Blog->allowcomments != 'never' )
 109      {    // The current blog can have comments:
 110          $nb_comments = generic_ctp_number($Item->ID, 'feedback');
 111          $col .= '<a href="?ctrl=items&amp;blog='.$Item->blog_ID.'&amp;p='.$Item->ID.'"
 112                          title="'.sprintf( T_('%d feedbacks'), $nb_comments ).'" class="">';
 113          if( $nb_comments )
 114          {
 115              $col .= get_icon( 'comments' );
 116          }
 117          else
 118          {
 119              $col .= get_icon( 'nocomment' );
 120          }
 121          $col .= '</a> ';
 122      }
 123  
 124      $col .= '<a href="?ctrl=items&amp;blog='.$Item->blog_ID.'&amp;p='.$Item->ID.'" class="" title="'.
 125                                  T_('View this post...').'">'.$Item->dget('title').'</a></strong>';
 126  
 127      return $col;
 128  }
 129  $ItemList->cols[] = array(
 130                          'th' => T_('Title'),
 131                          'order' => 'title',
 132                          'td_class' => 'tskst_$post_pst_ID$',
 133                          'td' => '<strong lang="@get(\'locale\')@">%task_title_link( {Obj} )%</strong>',
 134                      );
 135  
 136  
 137  /**

 138   * Visibility:

 139   */
 140  function item_visibility( $Item )
 141  {
 142      // Display publish NOW button if current user has the rights:

 143      $r = $Item->get_publish_link( ' ', ' ', get_icon( 'publish' ), '#', '' );
 144  
 145      // Display deprecate if current user has the rights:

 146      $r .= $Item->get_deprecate_link( ' ', ' ', get_icon( 'deprecate' ), '#', '' );
 147  
 148      if( empty($r) )
 149      {    // for IE
 150          $r = '&nbsp;';
 151      }
 152  
 153      return $r;
 154  }
 155  $ItemList->cols[] = array(
 156                          'th' => T_('Visibility'),
 157                          'order' => 'status',
 158                          'td_class' => 'shrinkwrap',
 159                          'td' => '%item_visibility( {Obj} )%',
 160                  );
 161  $ItemList->cols[] = array(
 162                          'th' => T_('Visibility'),
 163                          'order' => 'status',
 164                          'td_class' => 'tskst_$post_pst_ID$ nowrap',
 165                          'td' => '@get( \'t_status\' )@',
 166                  );
 167  
 168  
 169  $ItemList->cols[] = array(
 170      'th' => /* TRANS: abbrev for info */ T_('i'),
 171      'order' => 'datemodified',
 172      'default_dir' => 'D',
 173      'th_class' => 'shrinkwrap',
 174      'td_class' => 'shrinkwrap',
 175      'td' => '@history_info_icon()@',
 176  );
 177  
 178  
 179  
 180  /**

 181   * Edit Actions:

 182   *

 183   * @param Item

 184   */
 185  function item_edit_actions( $Item )
 186  {
 187      // Display edit button if current user has the rights:

 188      $r = $Item->get_edit_link( ' ', ' ', get_icon( 'edit' ), '#', '' );
 189  
 190      // Display delete button if current user has the rights:

 191      $r .= $Item->get_delete_link( ' ', ' ', get_icon( 'delete' ), '#', '', false );
 192  
 193      return $r;
 194  }
 195  $ItemList->cols[] = array(
 196          'th' => T_('Act.'),
 197          'td_class' => 'shrinkwrap',
 198          'td' => '%item_edit_actions( {Obj} )%',
 199      );
 200  
 201  
 202  if( $ItemList->is_filtered() )
 203  {    // List is filtered, offer option to reset filters:
 204      $ItemList->global_icon( T_('Reset all filters!'), 'reset_filters', '?ctrl=items&amp;blog='.$Blog->ID.'&amp;filter=reset', T_('Reset filters') );
 205  }
 206  
 207  if( $current_User->check_perm( 'blog_post_statuses', 'edit', false, $Blog->ID ) )
 208  {    // We have permission to add a post with at least one status:
 209      $ItemList->global_icon( T_('Write a new post...'), 'new', '?ctrl=items&amp;action=new&amp;blog='.$Blog->ID, T_('New post').' &raquo;', 3, 4 );
 210  }
 211  
 212  
 213  // EXECUTE the query now:

 214  $ItemList->restart();
 215  
 216  // Initialize funky display vars now:

 217  global $postIDlist, $postIDarray;
 218  $postIDlist = $ItemList->get_page_ID_list();
 219  $postIDarray = $ItemList->get_page_ID_array();
 220  
 221  // DISPLAY table now:

 222  $ItemList->display( NULL, $result_fadeout );
 223  
 224  
 225  /*

 226   * $Log: _item_list_table.view.php,v $

 227   * Revision 1.3  2007/09/26 20:26:36  fplanque

 228   * improved ItemList filters

 229   *

 230   * Revision 1.2  2007/09/08 20:23:04  fplanque

 231   * action icons / wording

 232   *

 233   * Revision 1.1  2007/06/25 11:00:31  fplanque

 234   * MODULES (refactored MVC)

 235   *

 236   * Revision 1.24  2007/06/11 01:54:39  fplanque

 237   * minor

 238   *

 239   * Revision 1.23  2007/05/28 01:33:22  fplanque

 240   * permissions/fixes

 241   *

 242   * Revision 1.22  2007/04/26 00:11:06  fplanque

 243   * (c) 2007

 244   *

 245   * Revision 1.21  2007/03/21 02:21:37  fplanque

 246   * item controller: highlight current (step 2)

 247   *

 248   * Revision 1.20  2007/03/05 02:12:56  fplanque

 249   * minor

 250   *

 251   * Revision 1.19  2007/01/19 10:57:46  fplanque

 252   * UI

 253   *

 254   * Revision 1.18  2006/12/19 20:33:35  blueyed

 255   * doc/todo

 256   *

 257   * Revision 1.17  2006/12/17 23:42:39  fplanque

 258   * Removed special behavior of blog #1. Any blog can now aggregate any other combination of blogs.

 259   * Look into Advanced Settings for the aggregating blog.

 260   * There may be side effects and new bugs created by this. Please report them :]

 261   *

 262   * Revision 1.16  2006/12/12 02:53:57  fplanque

 263   * Activated new item/comments controllers + new editing navigation

 264   * Some things are unfinished yet. Other things may need more testing.

 265   *

 266   * Revision 1.15  2006/12/07 23:59:31  fplanque

 267   * basic dashboard stuff

 268   *

 269   * Revision 1.14  2006/12/07 22:29:26  fplanque

 270   * reorganized menus / basic dashboard

 271   */
 272  ?>


Généré le : Thu Nov 29 23:58:50 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics