b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (0.9.x) [ class tree: admin ] [ index: admin ] [ all elements ]

Source for file _blogs_list.php

Documentation is available at _blogs_list.php

  1. <?php
  2. /**
  3.  * Displays list of blogs for editing
  4.  *
  5.  * b2evolution - {@link http://b2evolution.net/}
  6.  * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
  7.  * @copyright (c)2003-2005 by Francois PLANQUE - {@link http://fplanque.net/}
  8.  *
  9.  * @package admin
  10.  */
  11. if!defined('DB_USER') ) die'Please, do not access this page directly.' );
  12.  
  13. $count 0;
  14. for$curr_blog_ID blog_list_start()$curr_blog_ID != false$curr_blog_ID blog_list_next() )
  15. {
  16.     if$current_User->check_perm'blog_properties''any'false$curr_blog_ID ) )
  17.     {    // Current user is not allowed to edit properties...
  18.         continue;
  19.     }
  20.     if!isset$atleastoneshown ) )
  21.     {    // Display headers the first time we find an viewable blog
  22.         // TODO 0.9.1 : prewalk th elist, this will also allow to know if at least one blog can be deleted
  23.         $atleastoneshown true;
  24.         ?>
  25.         <div class="panelblock">
  26.         <h2><?php echo T_('Blogs'?>:</h2>
  27.         <table class="grouped" cellspacing="0">
  28.         <tr>
  29.             <th class="firstcol"><?php echo T_('Blog'?></th>
  30.             <th><?php echo T_('Full Name'?></th>
  31.             <th><?php echo T_('Blog URL'?></th>
  32.             <th><?php echo T_('Static File'?></th>
  33.             <th><?php echo T_('Locale'?></th>
  34.             <th><?php echo /* TRANS: Abbrev. for Delete */ T_('Del'?></th>
  35.         </tr>
  36.         <?php
  37.     }
  38.     ?>
  39.     <tr <?php if$count == echo 'class="odd"' ?>>
  40.         <td class="firstcol"><strong>
  41.             <?php
  42.             blog_list_iteminfo('ID');
  43.             echo '&nbsp;';
  44.             if$current_User->check_perm'blog_properties''edit'false$curr_blog_ID ) )
  45.             {
  46.                 ?>
  47.                 <a href="b2blogs.php?action=edit&amp;blog=<?php blog_list_iteminfo('ID'?>"><img src="img/properties.png" width="18" height="13" class="middle" alt="<?php echo  T_('Properties'?>" />&nbsp;<?php blog_list_iteminfo('shortname')?></a>
  48.                 <?php
  49.             }
  50.             else
  51.             {
  52.                 blog_list_iteminfo('shortname');
  53.             ?>
  54.             </strong>
  55.             <?php
  56.             if$curr_blog_ID == $Settings->get('default_blog_ID') )
  57.             {
  58.                 echo ' <span title="'.T_('Default blog on index.php').'">('.T_('Default').')</span>';
  59.             }
  60.             ?>
  61.         </td>
  62.  
  63.         <td><?php blog_list_iteminfo('name'?></td>
  64.  
  65.         <td><a href="<?php blog_list_iteminfo('blogurl'?>"><?php blog_list_iteminfo('suburl'?></a></td>
  66.  
  67.         <td>
  68.             <?php if( ($staticfilename blog_list_iteminfo('staticfilename',false)) )
  69.             // It is possible to generate a static page
  70.             ?>
  71.             <a href="<?php blog_list_iteminfo('staticurl'?>"><?php echo $staticfilename ?></a>
  72.             <?php if$current_User->check_perm'blog_genstatic''any'false$curr_blog_ID ) )
  73.                 // Permission to generate a static page ?>
  74.                     [<a href="b2blogs.php?action=GenStatic&amp;blog=<?php blog_list_iteminfo('ID'?>"><?php
  75.                         /* TRANS: abbrev. for "generate !" */ echo T_('Gen!'?></a>]
  76.                     <?php
  77.                 }
  78.             }
  79.             ?>
  80.         </td>
  81.         
  82.         <td class="center"><?php locale_flagblog_list_iteminfo('locale'false) ) ?></td>
  83.         
  84.         <?php if( ($curr_blog_ID == 1|| (!$current_User->check_perm'blog_properties''edit'false$curr_blog_ID )) )
  85.         // display empty cell for blog #1 and non deletable blogs
  86.             echo '<td></td>';
  87.         }
  88.         elseif$current_User->check_perm'blog_properties''edit'false$curr_blog_ID ) )
  89.         ?>
  90.         <td class="center">
  91.             <a href="b2blogs.php?action=delete&amp;blog=<?php blog_list_iteminfo('ID'?>" style="color:red;font-weight:bold;" onclick="return confirm('<?php printf/* TRANS: Warning this is a javascript string */ T_('Are you sure you want to delete blog #%d ?\\n\\nWARNING: This will delete ALL POST, COMMENTS,\\nCATEGORIES and other data related to that Blog!\\n\\nThis CANNOT be undone!')$curr_blog_ID?>')"><img src="img/xross.gif" width="13" height="13" class="middle" alt="<?php echo /* TRANS: Abbrev. for Delete */ T_('Del'?>" title="<?php echo T_('Delete this blog!'?>" /></a>
  92.             <!--<a href="b2blogs.php?action=copy&amp;blog=<?php blog_list_iteminfo('ID'?>" style="color:red;font-weight:bold;" title="<?php echo T_('Copy this blog!'?>" ><img src="img/copy.gif" width="13" height="13" class="middle" alt="<?php echo /* TRANS: Abbrev. for Copy */ T_('Copy'?>" /></a>-->
  93.         </td>
  94.         <?php
  95.         ?>
  96.     </tr>
  97.     <?php
  98.     $count++;
  99. }
  100.  
  101. if!isset$atleastoneshown ) )
  102. // no blog was listed because user has no rights
  103.     echo '<div class="panelinfo">';
  104.     echo '<P>'.T_('Sorry, you have no permission to edit/view any blog\'s properties.' ).'</p>';
  105. }
  106. else
  107. // close table
  108.     ?>
  109.     </table>
  110.     <?php
  111. }
  112.  
  113. if$current_User->check_perm'blogs''create' ) )
  114. ?>
  115.     <p class="center"><a href="b2blogs.php?action=new"><img src="img/new.gif" width="13" height="13" class="middle" alt="" /> <?php echo T_('New blog...'?></a></p>
  116.     <?php 
  117. ?>
  118. </div>

Documentation generated on Tue, 20 May 2008 01:52:21 +0200 by phpDocumentor 1.4.2