| [ Index ] |
|
Code source de b2evolution 2.1.0-beta |
1 <?php 2 /** 3 * This file implements the UI view for the available plugins. 4 * 5 * This file is part of the evoCore framework - {@link http://evocore.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)2004-2006 by Daniel HAHLER - {@link http://thequod.de/contact}. 10 * 11 * {@internal License choice 12 * - If you have received this file as part of a package, please find the license.txt file in 13 * the same folder or the closest folder above for complete license terms. 14 * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/) 15 * then you must choose one of the following licenses before using the file: 16 * - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php 17 * - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php 18 * }} 19 * 20 * {@internal Open Source relicensing agreement: 21 * Daniel HAHLER grants Francois PLANQUE the right to license 22 * Daniel HAHLER's contributions to this file and the b2evolution project 23 * under any OSI approved OSS license (http://www.opensource.org/licenses/). 24 * }} 25 * 26 * @package admin 27 * 28 * {@internal Below is a list of authors who have contributed to design/coding of this file: }} 29 * @author fplanque: Francois PLANQUE. 30 * @author blueyed: Daniel HAHLER. 31 * 32 * @version $Id: _plugin_list_available.view.php,v 1.1 2007/06/25 11:00:54 fplanque Exp $ 33 */ 34 if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' ); 35 36 /** 37 * @var User 38 */ 39 global $current_User; 40 /** 41 * @var Plugins 42 */ 43 global $admin_Plugins; 44 45 $Table = & new Table(); 46 47 $Table->title = T_('Plugins available for installation'); 48 49 $Table->global_icon( T_('Cancel install!'), 'close', regenerate_url(), T_('Cancel'), 3, 4 ); 50 51 $Table->cols = array( 52 array( 'th' => T_('Plugin') ), 53 array( 'th' => T_('Description') ), 54 array( 'th' => T_('Version') ), 55 array( 'th' => T_('Help'), 56 'td_class' => 'nowrap' ), 57 array( 'th' => T_('Actions'), 58 'td_class' => 'nowrap' ), 59 ); 60 61 $Table->display_init(); 62 63 $Table->display_list_start(); 64 65 // TITLE / COLUMN HEADERS: 66 $Table->display_head(); 67 68 // BODY START: 69 $Table->display_body_start(); 70 71 if( empty($AvailablePlugins) || ! is_a( $AvailablePlugins, 'Plugins_admin_no_DB' ) ) 72 { // (may have been instantiated for action 'info') 73 load_class('plugins/model/_plugins_admin_no_db.class.php'); 74 $AvailablePlugins = & new Plugins_admin_no_DB(); // do not load registered plugins/events from DB 75 $AvailablePlugins->discover(); 76 } 77 78 // Sort the plugins by group 79 $AvailablePlugins->sort('group'); 80 // Grouping 81 $current_group = false; // False so it does the header once 82 $current_sub_group = ''; 83 84 $number_of_groups = count($AvailablePlugins->get_plugin_groups()); 85 86 while( $loop_Plugin = & $AvailablePlugins->get_next() ) 87 { 88 89 if( $loop_Plugin->group !== $current_group && $number_of_groups ) 90 { // Reason why $current_group is false 91 $current_group = $loop_Plugin->group; 92 $current_sub_group = ''; 93 ?> 94 <tr class="group"> 95 <td colspan="5" class="first"><?php 96 if( $current_group == '' || $current_group == 'Un-Grouped' ) 97 { 98 echo T_('Un-Classified'); 99 } 100 else 101 { 102 echo $current_group; 103 } 104 ?></td> 105 </tr> 106 <?php 107 } 108 109 if( $loop_Plugin->sub_group != $current_sub_group ) 110 { 111 $current_sub_group = $loop_Plugin->sub_group; 112 ?> 113 <tr class="PluginsSubGroup"> 114 <th colspan="5"><?php echo $current_sub_group; ?></th> 115 </tr> 116 <?php 117 } 118 119 // fp> TODO: support for table.grouped tr.PluginsSubGroup td.firstcol (maybe... subgroups seem crazy anyway - where does it stop?). 120 $Table->display_line_start(); 121 122 $Table->display_col_start(); 123 ?> 124 <strong><a title="<?php echo T_('Display info') ?>" href="<?php echo regenerate_url( 'action,plugin_class', 'action=info&plugin_class='.$loop_Plugin->classname) . '">' 125 .format_to_output($loop_Plugin->name); ?></a></strong> 126 <?php 127 $Table->display_col_end(); 128 129 $Table->display_col_start(); 130 echo format_to_output($loop_Plugin->short_desc); 131 /* 132 // Available events: 133 $registered_events = implode( ', ', $AvailablePlugins->get_registered_events( $loop_Plugin ) ); 134 if( empty($registered_events) ) 135 { 136 $registered_events = '-'; 137 } 138 echo '<span class="advanced_info notes"><br />'.T_('Registered events:').' '.$registered_events.'</span>'; 139 */ 140 $Table->display_col_end(); 141 142 $Table->display_col_start(); 143 $clean_version = preg_replace( array('~^(CVS\s+)?\$'.'Revision:\s*~i', '~\s*\$$~'), '', $loop_Plugin->version ); 144 145 echo format_to_output($clean_version); 146 $Table->display_col_end(); 147 148 // HELP COL: 149 $Table->display_col_start(); 150 echo action_icon( T_('Display info'), 'info', regenerate_url( 'action,plugin_class', 'action=info&plugin_class='.$loop_Plugin->classname ) ); 151 // Help icons, if available: 152 $help_icons = array(); 153 if( $help_external = $loop_Plugin->get_help_link() ) 154 { 155 $help_icons[] = $help_external; 156 } 157 if( $help_internal = $loop_Plugin->get_help_link('$readme') ) 158 { 159 $help_icons[] = $help_internal; 160 } 161 if( ! empty($help_icons) ) 162 { 163 echo ' '.implode( ' ', $help_icons ); 164 } 165 $Table->display_col_end(); 166 167 $Table->display_col_start(); 168 $registrations = $admin_Plugins->count_regs($loop_Plugin->classname); 169 170 if( $current_User->check_perm( 'options', 'edit', false ) 171 && ( ! isset( $loop_Plugin->number_of_installs ) 172 || $registrations < $loop_Plugin->number_of_installs ) ) 173 { // number of installations are not limited or not reached yet and user has "edit options" perms 174 ?> 175 [<a href="admin.php?ctrl=plugins&action=install&plugin=<?php echo rawurlencode($loop_Plugin->classname) ?>"><?php 176 echo T_('Install'); 177 if( $registrations ) 178 { // This plugin is already installed 179 echo ' #'.($registrations+1); 180 } 181 ?></a>] 182 <?php 183 } 184 $Table->display_col_end(); 185 186 $Table->display_line_end(); 187 188 flush(); 189 // free memory: 190 $AvailablePlugins->unregister($loop_Plugin); 191 } 192 193 // BODY END: 194 $Table->display_body_end(); 195 196 197 $Table->display_list_end(); 198 199 /* 200 * $Log: _plugin_list_available.view.php,v $ 201 * Revision 1.1 2007/06/25 11:00:54 fplanque 202 * MODULES (refactored MVC) 203 * 204 * Revision 1.12 2007/04/26 00:11:12 fplanque 205 * (c) 2007 206 * 207 * Revision 1.11 2007/01/23 22:23:04 fplanque 208 * FIXED (!!!) disappearing help window! 209 * 210 * Revision 1.10 2007/01/14 08:21:01 blueyed 211 * Optimized "info", "disp_help" and "disp_help_plain" actions by refering to them through classname, which makes Plugins::discover() unnecessary 212 * 213 * Revision 1.9 2007/01/13 22:38:13 fplanque 214 * normalized 215 * 216 * Revision 1.8 2007/01/11 02:25:06 fplanque 217 * refactoring of Table displays 218 * body / line / col / fadeout 219 * 220 * Revision 1.7 2007/01/09 22:42:23 fplanque 221 * tfoot 222 * 223 * Revision 1.6 2007/01/09 00:49:04 blueyed 224 * todo 225 * 226 * Revision 1.5 2007/01/09 00:29:52 blueyed 227 * Fixed HTML: wrong "</foot></tfoot>" 228 * 229 * Revision 1.4 2007/01/08 23:44:19 fplanque 230 * inserted Table widget 231 * WARNING: this has nothing to do with ComponentWidgets... 232 * (except that I'm gonna need the Table Widget when handling the ComponentWidgets :> 233 * 234 * Revision 1.3 2007/01/07 18:42:35 fplanque 235 * cleaned up reload/refresh icons & links 236 * 237 * Revision 1.2 2006/12/20 23:46:01 blueyed 238 * Part of last change to _set_plugins.form.php has been lost while splitting 239 * 240 * Revision 1.1 2006/12/20 23:07:23 blueyed 241 * Moved list of available plugins to separate sub-screen/form 242 * 243 */ 244 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Thu Nov 29 23:58:50 2007 | par Balluche grâce à PHPXref 0.7 |
|