[ 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_full.view.php (source)

   1  <?php
   2  /**

   3   * This file implements the post browsing

   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_full.view.php,v 1.9 2007/11/04 01:10:57 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   * Note: definition only (does not need to be a global)

  32   * @var Item

  33   */
  34  global $Item;
  35  
  36  global $action, $dispatcher, $blog, $posts, $poststart, $postend, $ReqURI;
  37  global $edit_item_url, $delete_item_url, $htsrv_url, $p;
  38  global $comment_allowed_tags, $comments_use_autobr;
  39  
  40  if( $highlight = param( 'highlight', 'integer', NULL ) )
  41  {    // There are lines we want to highlight:
  42      global $rsc_url;
  43      echo '<script type="text/javascript" src="'.$rsc_url.'js/fadeout.js"></script>';
  44      echo '<script type="text/javascript">addEvent( window, "load", Fat.fade_all, false);</script>';
  45  }
  46  
  47  
  48  // Run the query:

  49  $ItemList->query();
  50  
  51  // Old style globals for category.funcs:

  52  global $postIDlist;
  53  $postIDlist = $ItemList->get_page_ID_list();
  54  global $postIDarray;
  55  $postIDarray = $ItemList->get_page_ID_array();
  56  
  57  
  58  
  59  $block_item_Widget = & new Widget( 'block_item' );
  60  
  61  if( $action == 'view' )
  62  {    // We are displaying a single post:
  63      $block_item_Widget->title = $ItemList->get_filter_title( '', '', ' - ', NULL, 'htmlbody' );
  64      $block_item_Widget->global_icon( T_('Close post'), 'close',
  65                  regenerate_url( 'p,action', 'filter=restore&amp;highlight='.$p ), T_('close'), 4, 1 );
  66  }
  67  else
  68  {    // We are displaying multiple posts
  69      $block_item_Widget->title = T_('Full posts');
  70      if( $ItemList->is_filtered() )
  71      {    // List is filtered, offer option to reset filters:
  72          $block_item_Widget->global_icon( T_('Reset all filters!'), 'reset_filters', '?ctrl=items&amp;blog='.$Blog->ID.'&amp;filter=reset', T_('Reset filters') );
  73      }
  74      $block_item_Widget->global_icon( T_('Write a new post...'), 'new', '?ctrl=items&amp;action=new&amp;blog='.$blog, T_('New post').' &raquo;', 3, 4 );
  75  }
  76  
  77  $block_item_Widget->disp_template_replaced( 'block_start' );
  78  
  79  
  80  
  81  if( $action == 'view' )
  82  {
  83      // Initialize things in order to be ready for displaying.

  84      $display_params = array(
  85                      'header_start' => '',
  86                          'header_text_single' => '',
  87                      'header_end' => '',
  88                      'footer_start' => '',
  89                          'footer_text_single' => '',
  90                      'footer_end' => ''
  91                  );
  92  }
  93  else
  94  { // Not a single post!
  95      // Display title depending on selection params:

  96      echo $ItemList->get_filter_title( '<h3>', '</h3>', '<br />', NULL, 'htmlbody' );
  97  
  98      // Initialize things in order to be ready for displaying.

  99      $display_params = array(
 100                      'header_start' => '<div class="NavBar center">',
 101                          'header_text' => '<strong>'.T_('Pages').'</strong>: $prev$ $first$ $list_prev$ $list$ $list_next$ $last$ $next$',
 102                          'header_text_single' => T_('1 page'),
 103                      'header_end' => '</div>',
 104                      'footer_start' => '',
 105                          'footer_text' => '<div class="NavBar center"><strong>'.T_('Pages').'</strong>: $prev$ $first$ $list_prev$ $list$ $list_next$ $last$ $next$</div>',
 106                          'footer_text_single' => '',
 107                              'prev_text' => T_('Previous'),
 108                              'next_text' => T_('Next'),
 109                              'list_prev_text' => T_('...'),
 110                              'list_next_text' => T_('...'),
 111                              'list_span' => 11,
 112                              'scroll_list_range' => 5,
 113                      'footer_end' => ''
 114                  );
 115  }
 116  
 117  $ItemList->display_init( $display_params );
 118  
 119  // Display navigation:

 120  $ItemList->display_nav( 'header' );
 121  
 122  /*

 123   * Display posts:

 124   */
 125  while( $Item = & $ItemList->get_item() )
 126  {
 127      ?>
 128      <div class="bPost bPost<?php $Item->status_raw() ?>" lang="<?php $Item->lang() ?>">
 129          <?php
 130          // We don't switch locales in the backoffice, since we use the user pref anyway

 131          // Load item's creator user:

 132          $Item->get_creator_User();
 133          $Item->anchor(); ?>
 134          <div class="bSmallHead <?php
 135          if( $Item->ID == $highlight )
 136          {
 137              echo 'fadeout-ffff00" id="fadeout-1';
 138          }
 139           ?>">
 140              <?php
 141                  echo '<div class="bSmallHeadRight">';
 142                  $Item->locale_flag();
 143                  echo '</div>';
 144  
 145                  $Item->issue_date( array(
 146                          'before'      => '<span class="bDate">',
 147                          'after'       => '</span>',
 148                          'date_format' => '#',
 149                      ) );
 150  
 151                  $Item->issue_time( array(
 152                          'before'      => ' @ <span class="bTime">',
 153                          'after'      => '</span>',
 154                      ) );
 155  
 156                  // TRANS: backoffice: each post is prefixed by "date BY author IN categories"

 157                  echo ' ', T_('by'), ' <acronym title="';
 158                  $Item->creator_User->login();
 159                  echo ', '.T_('level:');
 160                  $Item->creator_User->level();
 161                  echo '"><span class="bAuthor">';
 162                  $Item->creator_User->preferred_name();
 163                  echo '</span></acronym>';
 164  
 165                  echo '<div class="bSmallHeadRight">';
 166                  $Item->status( array(
 167                          'before' => T_('Visibility').': <span class="bStatus">',
 168                          'after'  => '</span>',
 169                      ) );
 170                  echo '</div>';
 171  
 172                  echo '<br />';
 173                  $Item->type( T_('Type').': <span class="bType">', '</span> &nbsp; ' );
 174                  $Item->priority( T_('Priority').': <span class="bPriority">', '</span> &nbsp; ' );
 175                  $Item->assigned_to( T_('Assigned to:').' <span class="bAssignee">', '</span> &nbsp; ' );
 176                  $Item->extra_status( T_('Task Status').': <span class="bExtStatus">', '</span>' );
 177                  echo '&nbsp;';
 178  
 179                  echo '<div class="bSmallHeadRight"><span class="bViews">';
 180                  $Item->views();
 181                  echo '</span></div>';
 182  
 183                  echo '<br />';
 184  
 185                  $Item->categories( array(
 186                      'before'          => T_('Categories').': <span class="bCategories">',
 187                      'after'           => '</span>',
 188                      'include_main'    => true,
 189                      'include_other'   => true,
 190                      'include_external'=> true,
 191                      'link_categories' => false,
 192                  ) );
 193              ?>
 194          </div>
 195  
 196          <div class="bContent">
 197              <h3 class="bTitle"><?php $Item->title() ?></h3>
 198  
 199              <?php
 200                  // Display images that are linked to this post:

 201                  $Item->images( array(
 202                          'before' =>              '<div class="bImages">',
 203                          'before_image' =>        '<div class="image_block">',
 204                          'before_image_legend' => '<div class="image_legend">',
 205                          'after_image_legend' =>  '</div>',
 206                          'after_image' =>         '</div>',
 207                          'after' =>               '</div>',
 208                          'image_size' =>          'fit-320x320'
 209                      ) );
 210              ?>
 211  
 212              <div class="bText">
 213                  <?php
 214                      // Uncomment this in case you wnt to count view in backoffice:

 215                      /*

 216                      $Item->count_view( array(

 217                              'allow_multiple_counts_per_page' => false,

 218                          ) );

 219                      */
 220  
 221                      // Display CONTENT:

 222                      $Item->content_teaser( array(
 223                              'before'      => '',
 224                              'after'       => '',
 225                          ) );
 226                      $Item->more_link();
 227                      $Item->content_extension( array(
 228                              'before'      => '',
 229                              'after'       => '',
 230                          ) );
 231  
 232                      // Links to post pages (for multipage posts):

 233                      $Item->page_links( '<p class="right">'.T_('Pages:').' ', '</p>', ' &middot; ' );
 234                  ?>
 235              </div>
 236          </div>
 237  
 238          <div class="PostActionsArea">
 239              <?php
 240              $Item->permanent_link( array(
 241                      'class' => 'permalink_right',
 242                  ) );
 243  
 244              echo '<a href="?ctrl=items&amp;blog='.$Blog->ID.'&amp;p='.$Item->ID.'" class="ActionButton">'.T_('View...').'</a>';
 245  
 246              echo '<a href="'.url_add_param( $Blog->get_filemanager_link(), 'fm_mode=link_item&amp;item_ID='.$Item->ID )
 247                              .'" class="ActionButton">'.T_('Files...').'</a>';
 248  
 249              // Display edit button if current user has the rights:

 250              $Item->edit_link( array( // Link to backoffice for editing
 251                      'before'    => ' ',
 252                      'after'     => ' ',
 253                      'class'     => 'ActionButton'
 254                  ) );
 255  
 256              // Display publish NOW button if current user has the rights:

 257              $Item->publish_link( ' ', ' ', '#', '#', 'PublishButton');
 258  
 259              // Display deprecate button if current user has the rights:

 260              $Item->deprecate_link( ' ', ' ', '#', '#', 'DeleteButton');
 261  
 262              // Display delete button if current user has the rights:

 263              $Item->delete_link( ' ', ' ', '#', '#', 'DeleteButton', false );
 264  
 265              if( $Blog->allowcomments != 'never' )
 266              {
 267                  echo '<a href="?ctrl=items&amp;blog='.$Blog->ID.'&amp;p='.$Item->ID.'#comments" class="ActionButton">';
 268                  // TRANS: Link to comments for current post

 269                  comments_number(T_('no comment'), T_('1 comment'), T_('%d comments'), $Item->ID );
 270                  load_funcs('comments/_trackback.funcs.php'); // TODO: use newer call below

 271                  trackback_number('', ' &middot; '.T_('1 Trackback'), ' &middot; '.T_('%d Trackbacks'), $Item->ID);
 272                  echo '</a>';
 273              } ?>
 274  
 275             <div class="clear"></div>
 276          </div>
 277  
 278          <?php
 279  
 280          // _____________________________________ Displayed in SINGLE VIEW mode only _____________________________________

 281  
 282          if( $action == 'view' )
 283          { // We are looking at a single post, include files and comments:
 284  
 285              // Files:

 286              echo '<div class="bFeedback">';    // TODO

 287  
 288              /**

 289               * Needed by file display funcs

 290               * @var Item

 291               */
 292              global $edited_Item;
 293              $edited_Item = $Item;    // COPY or it will be out of scope for display funcs

 294              require dirname(__FILE__).'/inc/_item_links.inc.php';
 295              echo '</div>';
 296  
 297  
 298  
 299            // ---------- comments ----------

 300              ?>
 301              <div class="bFeedback">
 302              <a id="comments"></a>
 303              <h4><?php echo T_('Comments'), ', ', T_('Trackbacks'), ', ', T_('Pingbacks') ?>:</h4>
 304              <?php
 305              global $CommentList;
 306  
 307              $CommentList = new CommentList( NULL, "'comment','trackback','pingback'", array(), $Item->ID, '', 'ASC' );
 308  
 309              $CommentList->display_if_empty( array(
 310                      'before'    => '<div class="bComment"><p>',
 311                      'after'     => '</p></div>',
 312                      'msg_empty' => T_('No feedback for this post yet...'),
 313                  ) );
 314  
 315              // Display list of comments:

 316              require $inc_path.'comments/views/_comment_list.inc.php';
 317  
 318              if( $Item->can_comment() )
 319              { // User can leave a comment
 320              ?>
 321              <!-- ========== FORM to add a comment ========== -->
 322              <h4><?php echo T_('Leave a comment') ?>:</h4>
 323  
 324              <?php
 325  
 326              $Form = & new Form( $htsrv_url.'comment_post.php', 'comment_checkchanges' );
 327  
 328              $Form->begin_form( 'bComment' );
 329  
 330              $Form->hidden( 'comment_post_ID', $Item->ID );
 331              $Form->hidden( 'redirect_to', $ReqURI );
 332              ?>
 333                  <fieldset>
 334                      <div class="label"><?php echo T_('User') ?>:</div>
 335                      <div class="info">
 336                          <strong><?php $current_User->preferred_name()?></strong>
 337                          <?php user_profile_link( ' [', ']', T_('Edit profile') ) ?>
 338                          </div>
 339                  </fieldset>
 340              <?php
 341              $Form->textarea( 'p', '', 12, T_('Comment text'),
 342                                                  T_('Allowed XHTML tags').': '.htmlspecialchars(str_replace( '><',', ', $comment_allowed_tags)), 40, 'bComment' );
 343  
 344              if(substr($comments_use_autobr,0,4) == 'opt-')
 345              {
 346                  echo $Form->fieldstart;
 347                  echo $Form->labelstart;
 348              ?>
 349              <label><?php echo T_('Options') ?>:</label>
 350  
 351              <?php
 352                  echo $Form->labelend;
 353                  echo $Form->inputstart;
 354                  $Form->checkbox( 'comment_autobr', 1, T_('Auto-BR'), T_('(Line breaks become &lt;br&gt;)'), 'checkbox' );
 355                  echo $Form->inputend;
 356                  $Form->end_fieldset();
 357  
 358              }
 359  
 360                  echo $Form->fieldstart;
 361                  echo $Form->inputstart;
 362                  $Form->submit( array ('submit', T_('Send comment'), 'SaveButton' ) );
 363                  echo $Form->inputend;
 364                  $Form->end_fieldset();
 365  
 366              ?>
 367  
 368                  <div class="clear"></div>
 369              <?php
 370                  $Form->end_form();
 371              ?>
 372              <!-- ========== END of FORM to add a comment ========== -->
 373              <?php
 374              } // / can comment

 375          ?>
 376          </div>
 377          <?php
 378      } // / comments requested

 379  ?>
 380  </div>
 381  <?php
 382  }
 383  
 384  // Display navigation:

 385  $ItemList->display_nav( 'footer' );
 386  
 387  
 388  $block_item_Widget->disp_template_replaced( 'block_end' );
 389  
 390  /*

 391   * $Log: _item_list_full.view.php,v $

 392   * Revision 1.9  2007/11/04 01:10:57  fplanque

 393   * skin cleanup continued

 394   *

 395   * Revision 1.8  2007/11/03 23:54:39  fplanque

 396   * skin cleanup continued

 397   *

 398   * Revision 1.7  2007/11/03 21:04:27  fplanque

 399   * skin cleanup

 400   *

 401   * Revision 1.6  2007/11/03 04:56:03  fplanque

 402   * permalink / title links cleanup

 403   *

 404   * Revision 1.5  2007/09/26 20:26:36  fplanque

 405   * improved ItemList filters

 406   *

 407   * Revision 1.4  2007/09/08 20:23:04  fplanque

 408   * action icons / wording

 409   *

 410   * Revision 1.3  2007/09/07 21:11:10  fplanque

 411   * superstylin' (not even close)

 412   *

 413   * Revision 1.2  2007/09/03 19:36:06  fplanque

 414   * chicago admin skin

 415   *

 416   * Revision 1.1  2007/06/25 11:00:30  fplanque

 417   * MODULES (refactored MVC)

 418   *

 419   * Revision 1.36  2007/04/26 00:11:06  fplanque

 420   * (c) 2007

 421   *

 422   * Revision 1.35  2007/03/21 02:21:37  fplanque

 423   * item controller: highlight current (step 2)

 424   *

 425   * Revision 1.34  2007/03/21 01:44:51  fplanque

 426   * item controller: better return to current filterset - step 1

 427   *

 428   * Revision 1.33  2007/03/06 12:18:09  fplanque

 429   * got rid of dirty Item::content()

 430   * Advantage: the more link is now independant. it can be put werever people want it

 431   *

 432   * Revision 1.32  2007/03/05 02:12:56  fplanque

 433   * minor

 434   *

 435   * Revision 1.31  2007/01/19 10:57:46  fplanque

 436   * UI

 437   *

 438   * Revision 1.30  2007/01/19 10:45:42  fplanque

 439   * images everywhere :D

 440   * At this point the photoblogging code can be considered operational.

 441   *

 442   * Revision 1.29  2006/12/17 23:42:39  fplanque

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

 444   * Look into Advanced Settings for the aggregating blog.

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

 446   *

 447   * Revision 1.28  2006/12/12 21:19:31  fplanque

 448   * UI fixes

 449   *

 450   * Revision 1.27  2006/12/12 19:39:07  fplanque

 451   * enhanced file links / permissions

 452   *

 453   * Revision 1.26  2006/12/12 02:53:57  fplanque

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

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

 456   *

 457   * Revision 1.25  2006/12/07 22:29:26  fplanque

 458   * reorganized menus / basic dashboard

 459   *

 460   * Revision 1.24  2006/12/04 18:16:51  fplanque

 461   * Each blog can now have its own "number of page/days to display" settings

 462   *

 463   * Revision 1.23  2006/11/27 19:14:14  fplanque

 464   * i18n

 465   *

 466   * Revision 1.22  2006/10/23 22:19:03  blueyed

 467   * Fixed/unified encoding of redirect_to param. Use just rawurlencode() and no funky &amp; replacements

 468   */
 469  ?>


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