[ Index ] |
|
Code source de b2evolution 2.1.0-beta |
1 <?php 2 /** 3 * This file implements the UI view for the Available widgets. 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 * 10 * @license http://b2evolution.net/about/license.html GNU General Public License (GPL) 11 * 12 * @package admin 13 * 14 * @version $Id: _widget_list_available.view.php,v 1.4 2007/09/28 02:17:48 fplanque Exp $ 15 */ 16 if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' ); 17 18 global $container; 19 20 echo '<h2><span class="right_icons">'.action_icon( T_('Cancel!'), 'close', regenerate_url( 'container' ) ).'</span>' 21 .sprintf(T_('Widgets available for insertion into «%s»'), $container ).'</h2>'; 22 23 echo '<ul>'; 24 25 $core_componentwidget_defs = array( 26 '*'.T_('Blog list'), 27 'colls_list_public', 28 'colls_list_owner', 29 '*'.T_('Blog header'), 30 'coll_logo', 31 'coll_title', 32 'coll_tagline', 33 '*'.T_('Blog contents'), 34 'coll_page_list', 35 'coll_post_list', 36 'coll_category_list', 37 '*'.T_('Meta contents'), 38 'coll_longdesc', 39 'free_html', 40 '*'.T_('Tools'), 41 'coll_common_links', 42 'coll_search_form', 43 'coll_xml_feeds', 44 'menu_link', 45 'user_tools', 46 '*'.T_('Other contents'), 47 'linkblog', 48 ); 49 $i = 0; 50 foreach( $core_componentwidget_defs as $code ) 51 { 52 $i++; 53 if( $code[0] == '*' ) 54 { // group 55 if( $i > 1 ) 56 { 57 echo '</ul></li>'; 58 } 59 echo '<li><strong>'.substr( $code, 1 ).':</strong><ul>'; 60 } 61 else 62 { 63 load_class( 'widgets/widgets/_'.$code.'.widget.php' ); 64 $classname = $code.'_Widget'; 65 $ComponentWidget = & new $classname( NULL, 'core', $code ); 66 67 echo '<li>'; 68 echo '<a href="'.regenerate_url( '', 'action=create&type=core&code='.$ComponentWidget->code ).'" title="'.T_('Add this widget to the container').'">'; 69 echo get_icon( 'new' ).$ComponentWidget->get_name(); 70 echo '</a> <span class="notes">'.$ComponentWidget->get_desc().'</span>'; 71 echo '</li>'; 72 } 73 } 74 75 76 // Now, let's try to get the Plugins that implement a skintag... 77 // TODO: at some point we may merge them with the above, but alphabetical order probably isn't the best solution 78 79 /** 80 * @var Plugins 81 */ 82 global $Plugins; 83 84 $Plugin_array = $Plugins->get_list_by_event( 'SkinTag' ); 85 // Remove the plugins, which have no code, because this gets used to install them: 86 foreach( $Plugin_array as $k => $v ) 87 { 88 if( empty($v->code) ) 89 { 90 unset($Plugin_array[$k]); 91 } 92 } 93 if( ! empty($Plugin_array) ) 94 { // We have some plugins 95 96 echo '</ul></li>'; 97 echo '<li><strong>'.T_('Plugins').':</strong><ul>'; 98 99 foreach( $Plugin_array as $ID => $Plugin ) 100 { 101 echo '<li>'; 102 echo '<a href="'.regenerate_url( '', 'action=create&type=plugin&code='.$Plugin->code ).'" title="'.T_('Add this widget to the container').'">'; 103 echo get_icon( 'new' ).$Plugin->name; 104 echo '</a> <span class="notes">'.$Plugin->short_desc.'</span>'; 105 echo '</li>'; 106 } 107 } 108 echo '</ul></li></ul>'; 109 110 111 /* 112 * $Log: _widget_list_available.view.php,v $ 113 * Revision 1.4 2007/09/28 02:17:48 fplanque 114 * Menu widgets 115 * 116 * Revision 1.3 2007/08/21 22:28:29 blueyed 117 * Do not display plugins which then fail to install in the widgets list 118 * 119 * Revision 1.2 2007/07/01 03:55:05 fplanque 120 * category plugin replaced by widget 121 * 122 * Revision 1.1 2007/06/25 11:02:01 fplanque 123 * MODULES (refactored MVC) 124 * 125 * Revision 1.10 2007/06/21 00:44:36 fplanque 126 * linkblog now a widget 127 * 128 * Revision 1.9 2007/06/20 13:19:29 fplanque 129 * Free html widget 130 * 131 * Revision 1.8 2007/06/20 01:12:49 fplanque 132 * groups 133 * 134 * Revision 1.7 2007/06/18 21:25:48 fplanque 135 * one class per core widget 136 * 137 * Revision 1.6 2007/04/26 00:11:05 fplanque 138 * (c) 2007 139 * 140 * Revision 1.5 2007/01/14 01:32:11 fplanque 141 * more widgets supported! :) 142 * 143 * Revision 1.4 2007/01/12 21:53:12 blueyed 144 * Probably fixed Plugins::get_list_by_* methods: the returned references were always the one to the last Plugin 145 * 146 * Revision 1.3 2007/01/12 21:38:42 blueyed 147 * doc 148 * 149 * Revision 1.2 2007/01/12 05:17:15 fplanque 150 * $Plugins->get_list_by_event() returns crap :(( 151 * 152 * Revision 1.1 2007/01/08 21:55:42 fplanque 153 * very rough widget handling 154 */ 155 ?>
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 |
![]() |