b2evolution PHP Cross Reference Blogging Systems

Source: /inc/collections/views/_coll_list.view.php - 76 lines - 2441 bytes - Text - Print

Description: This file implements the UI view for the blogs list on blog management screens. b2evolution - {@link http://b2evolution.net/} Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}

   1  <?php
   2  /**
   3   * This file implements the UI view for the blogs list on blog management screens.
   4   *
   5   * b2evolution - {@link http://b2evolution.net/}
   6   * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
   7   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
   8   *
   9   * {@internal Open Source relicensing agreement:
  10   * Daniel HAHLER grants Francois PLANQUE the right to license
  11   * Daniel HAHLER's contributions to this file and the b2evolution project
  12   * under any OSI approved OSS license (http://www.opensource.org/licenses/).
  13   * }}
  14   *
  15   * @package admin
  16   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  17   * @author blueyed: Daniel HAHLER
  18   * @author fplanque: Francois PLANQUE.
  19   *
  20   * @version $Id: _coll_list.view.php 6136 2014-03-08 07:59:48Z manuel $
  21   */
  22  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  23  
  24  /**
  25   * @var User
  26   */
  27  global $current_User;
  28  /**
  29   * @var GeneralSettings
  30   */
  31  global $Settings;
  32  
  33  global $dispatcher;
  34  
  35  
  36  $SQL = new SQL();
  37  $SQL->SELECT( 'T_blogs.*, user_login' );
  38  $SQL->FROM( 'T_blogs INNER JOIN T_users ON blog_owner_user_ID = user_ID' );
  39  
  40  if( ! $current_User->check_perm( 'blogs', 'view' ) )
  41  {    // We do not have perm to view all blogs... we need to restrict to those we're a member of:
  42  
  43      $SQL->FROM_add( 'LEFT JOIN T_coll_user_perms ON (blog_advanced_perms <> 0'
  44          . ' AND blog_ID = bloguser_blog_ID'
  45          . ' AND bloguser_user_ID = ' . $current_User->ID . ' )'
  46          . ' LEFT JOIN T_coll_group_perms ON (blog_advanced_perms <> 0'
  47          . ' AND blog_ID = bloggroup_blog_ID'
  48          . ' AND bloggroup_group_ID = ' . $current_User->grp_ID . ' )' );
  49      $SQL->WHERE( 'blog_owner_user_ID = ' . $current_User->ID
  50          . ' OR bloguser_ismember <> 0'
  51          . ' OR bloggroup_ismember <> 0' );
  52  
  53      $no_results = T_('Sorry, you have no permission to edit/view any blog\'s properties.');
  54  }
  55  else
  56  {
  57      $no_results = T_('No blog has been created yet!');
  58  }
  59  
  60  // Create result set:
  61  $Results = new Results( $SQL->get(), 'blog_' );
  62  $Results->Cache = & get_BlogCache();
  63  $Results->title = T_('Blog list');
  64  $Results->no_results_text = $no_results;
  65  
  66  if( $current_User->check_perm( 'blogs', 'create' ) )
  67  {
  68      $Results->global_icon( T_('New blog...'), 'new', url_add_param( $dispatcher, 'ctrl=collections&amp;action=new' ), T_('New blog...'), 3, 4 );
  69  }
  70  
  71  // Initialize Results object
  72  blogs_results( $Results );
  73  
  74  $Results->display( NULL, 'session' );
  75  
  76  ?>

title

Description

title

Description

title

Description

title

title

Body