[ Index ] |
|
Code source de b2evolution 2.1.0-beta |
1 <?php 2 /** 3 * This file implements the riight sidebar for the post browsing screen. 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_sidebar.view.php,v 1.8 2007/10/08 08:32:00 fplanque Exp $ 19 */ 20 if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' ); 21 22 /** 23 * @var AdminUI 24 */ 25 global $AdminUI; 26 /** 27 * @var Blog 28 */ 29 global $Blog; 30 /** 31 * @var Plugins 32 */ 33 global $Plugins; 34 35 global $tab, $show_past, $show_future, $show_statuses, $s, $sentence, $exact, $author, $assgn, $status; 36 37 /** 38 * @vat ItemList 39 */ 40 global $ItemList; 41 42 load_funcs( 'skins/_skin.funcs.php' ); 43 44 $Widget = & new Widget(); 45 $template = $AdminUI->get_template( 'side_item' ); 46 47 $Widget->title = $Blog->dget( 'name', 'htmlbody' ); 48 echo $Widget->replace_vars( $template['block_start'] ); 49 50 // CALENDAR: 51 // Call the Calendar plugin: 52 $Plugins->call_by_code( 'evo_Calr', array( // Params follow: 53 'block_start'=>'', 54 'block_end'=>'', 55 'title'=>'', // No title. 56 'link_type'=>'context', // Preserve page context 57 ) ); 58 59 echo $template['block_end']; 60 61 $Widget = & new Widget(); 62 $Widget->title = T_('Filters'); 63 if( $ItemList->is_filtered() ) 64 { // List is filtered, offer option to reset filters: 65 $Widget->global_icon( T_('Reset all filters!'), 'reset_filters', '?ctrl=items&blog='.$Blog->ID.'&filter=reset', T_('Reset filters'), 4, 4 ); 66 } 67 echo $Widget->replace_vars( $template['block_start'] ); 68 69 $Form = & new Form( NULL, 'resetform', 'get', 'none' ); 70 71 $Form->begin_form( '' ); 72 73 $Form->hidden_ctrl(); 74 $Form->submit( array( 'submit', T_('Search'), 'search', '', 'float:right' ) ); 75 76 $Form->hidden( 'tab', $tab ); 77 $Form->hidden( 'blog', $Blog->ID ); 78 79 echo '<fieldset>'; 80 echo '<legend>'.T_('Posts to show').'</legend>'; 81 ?> 82 <div> 83 84 <input type="checkbox" name="show_past" value="1" id="ts_min" class="checkbox" <?php if( $show_past ) echo 'checked="checked" '?> /> 85 <label for="ts_min"><?php echo T_('Past') ?></label><br /> 86 87 <input type="checkbox" name="show_future" value="1" id="ts_max" class="checkbox" <?php if( $show_future ) echo 'checked="checked" '?> /> 88 <label for="ts_max"><?php echo T_('Future') ?></label> 89 90 </div> 91 92 <div> 93 94 <input type="checkbox" name="show_statuses[]" value="published" id="sh_published" class="checkbox" <?php if( in_array( "published", $show_statuses ) ) echo 'checked="checked" '?> /> 95 <label for="sh_published"><?php echo T_('Published') ?> <span class="notes">(<?php echo T_('Public') ?>)</span></label><br /> 96 97 <input type="checkbox" name="show_statuses[]" value="protected" id="sh_protected" class="checkbox" <?php if( in_array( "protected", $show_statuses ) ) echo 'checked="checked" '?> /> 98 <label for="sh_protected"><?php echo T_('Protected') ?> <span class="notes">(<?php echo T_('Members only') ?>)</span></label><br /> 99 100 <input type="checkbox" name="show_statuses[]" value="private" id="sh_private" class="checkbox" <?php if( in_array( "private", $show_statuses ) ) echo 'checked="checked" '?> /> 101 <label for="sh_private"><?php echo T_('Private') ?> <span class="notes">(<?php echo T_('You only') ?>)</span></label><br /> 102 103 <input type="checkbox" name="show_statuses[]" value="draft" id="sh_draft" class="checkbox" <?php if( in_array( "draft", $show_statuses ) ) echo 'checked="checked" '?> /> 104 <label for="sh_draft"><?php echo T_('Draft') ?> <span class="notes">(<?php echo T_('Not published!') ?>)</span></label><br /> 105 106 <input type="checkbox" name="show_statuses[]" value="deprecated" id="sh_deprecated" class="checkbox" <?php if( in_array( "deprecated", $show_statuses ) ) echo 'checked="checked" '?> /> 107 <label for="sh_deprecated"><?php echo T_('Deprecated') ?> <span class="notes">(<?php echo T_('Not published!') ?>)</span></label><br /> 108 109 <input type="checkbox" name="show_statuses[]" value="redirected" id="sh_redirected" class="checkbox" <?php if( in_array( "redirected", $show_statuses ) ) echo 'checked="checked" '?> /> 110 <label for="sh_deprecated"><?php echo T_('Redirected') ?></label><br /> 111 112 </div> 113 114 <?php 115 echo '</fieldset>'; 116 117 118 echo '<fieldset>'; 119 echo '<legend>'.T_('Title / Text contains').'</legend>'; 120 121 echo $Form->inputstart; 122 ?> 123 <div><input type="text" name="s" size="20" value="<?php echo htmlspecialchars($s) ?>" class="SearchField" /></div> 124 <?php 125 echo $Form->inputend; 126 // echo T_('Words').' : '; 127 ?> 128 <div class="tile"> 129 <input type="radio" name="sentence" value="AND" id="sentAND" class="radio" <?php if( $sentence=='AND' ) echo 'checked="checked" '?> /> 130 <label for="sentAND"><?php echo T_('AND') ?></label> 131 </div> 132 <div class="tile"> 133 <input type="radio" name="sentence" value="OR" id="sentOR" class="radio" <?php if( $sentence=='OR' ) echo 'checked="checked" '?> /> 134 <label for="sentOR"><?php echo T_('OR') ?></label> 135 </div> 136 <div class="tile"> 137 <input type="radio" name="sentence" value="sentence" id="sentence" class="radio" <?php if( $sentence=='sentence' ) echo 'checked="checked" '?> /> 138 <label for="sentence"><?php echo T_('Entire phrase') ?></label> 139 </div> 140 <div class="tile"> 141 <input type="checkbox" name="exact" value="1" id="exact" class="checkbox" <?php if( $exact ) echo 'checked="checked" '?> /> 142 <label for="exact"><?php echo T_('Exact match') ?></label> 143 </div> 144 145 <?php 146 echo '</fieldset>'; 147 148 149 /* 150 * Assignees: 151 * TODO: allow multiple selection 152 */ 153 echo '<fieldset>'; 154 echo '<legend>'.T_('Assignees').'</legend>'; 155 // Load current blog members into cache: 156 $UserCache = & get_Cache( 'UserCache' ); 157 $UserCache->load_blogmembers( $Blog->ID ); 158 if( count($UserCache->cache) ) 159 { 160 echo '<ul>'; 161 162 echo '<li><input type="radio" name="assgn" value="-" class="radio"'; 163 if( '-' == $assgn ) echo ' checked="checked"'; 164 echo ' /> <a href="'.regenerate_url( 'assgn', 'assgn=-' ).'">'.T_('Not assigned').'</a></li>'; 165 166 foreach( $UserCache->cache as $loop_Obj ) 167 { 168 echo '<li><input type="radio" name="assgn" value="'.$loop_Obj->ID.'" class="radio"'; 169 if( $loop_Obj->ID == $assgn ) echo ' checked="checked"'; 170 echo ' /> <a href="'.regenerate_url( 'assgn', 'assgn='.$loop_Obj->ID ).'">'; 171 $loop_Obj->preferred_name(); 172 echo '</a></li>'; 173 } 174 echo '</ul>'; 175 } 176 echo '</fieldset>'; 177 178 179 /* 180 * Authors: 181 * TODO: allow multiple selection 182 */ 183 echo '<fieldset>'; 184 echo '<legend>'.T_('Authors').'</legend>'; 185 // Load current blog members into cache: 186 $UserCache->load_blogmembers( $Blog->ID ); 187 if( count($UserCache->cache) ) 188 { 189 echo '<ul>'; 190 foreach( $UserCache->cache as $loop_Obj ) 191 { 192 echo '<li><input type="radio" name="author" value="'.$loop_Obj->ID.'" class="radio"'; 193 if( $loop_Obj->ID == $author ) echo ' checked="checked"'; 194 echo ' /> <a href="'.regenerate_url( 'author', 'author='.$loop_Obj->ID ).'">'; 195 $loop_Obj->preferred_name(); 196 echo '</a></li>'; 197 } 198 echo '</ul>'; 199 } 200 echo '</fieldset>'; 201 202 203 /* 204 * Statuses 205 * TODO: allow multiple selection 206 */ 207 $ItemStatusCache = & get_Cache( 'ItemStatusCache' ); 208 $ItemStatusCache->load_all(); // TODO: load for current blog only 209 if( count($ItemStatusCache->cache) ) 210 { // We have satuses: 211 echo '<fieldset>'; 212 echo '<legend>'.T_('Statuses').'</legend>'; 213 echo '<ul>'; 214 215 echo '<li><input type="radio" name="status" value="-" class="radio"'; 216 if( '-' == $status ) echo ' checked="checked"'; 217 echo ' /> <a href="'.regenerate_url( 'status', 'status=-' ).'">'.T_('Without status').'</a></li>'; 218 219 foreach( $ItemStatusCache->cache as $loop_Obj ) 220 { 221 echo '<li><input type="radio" name="status" value="'.$loop_Obj->ID.'" class="radio"'; 222 if( $loop_Obj->ID == $status ) echo ' checked="checked"'; 223 echo ' /> <a href="'.regenerate_url( 'status', 'status='.$loop_Obj->ID ).'">'; 224 $loop_Obj->disp('name'); 225 echo '</a></li>'; 226 } 227 echo '</ul>'; 228 echo '</fieldset>'; 229 } 230 231 // --------------------------------- START OF CATEGORY LIST -------------------------------- 232 skin_widget( array( 233 // CODE for the widget: 234 'widget' => 'coll_category_list', 235 // Optional display params 236 'block_start' => '<fieldset>', 237 'block_end' => '</fieldset>', 238 'block_title_start' => '<legend>', 239 'block_title_end' => '</legend>', 240 'link_type' => 'context', 241 'use_form' => 1, 242 ) ); 243 // ---------------------------------- END OF CATEGORY LIST --------------------------------- 244 245 246 // ARCHIVES: 247 // Call the Archives plugin: 248 $Plugins->call_by_code( 'evo_Arch', array( // Parameters follow: 249 'block_start'=>'<fieldset>', 250 'block_end'=>"</fieldset>\n", 251 'title'=>'<legend>'.T_('Archives')."</legend>\n", 252 'link_type'=>'context', // Preserve page context 253 'form'=>true, // add form fields (radio buttons) 254 'limit'=>'', // No limit 255 'more_link'=>'', // No more link 256 ) ); 257 258 259 $Form->submit( array( 'submit', T_('Search'), 'search' ) ); 260 261 if( $ItemList->is_filtered() ) 262 { 263 // TODO: style this better: 264 echo ' <a href="?ctrl=items&blog='.$Blog->ID.'&filter=reset">'.T_('Reset all filters!').'</a>'; 265 } 266 267 $Form->end_form(); 268 269 echo $template['block_end']; 270 271 /* 272 * $Log: _item_list_sidebar.view.php,v $ 273 * Revision 1.8 2007/10/08 08:32:00 fplanque 274 * nicer forms 275 * 276 * Revision 1.7 2007/09/26 20:26:36 fplanque 277 * improved ItemList filters 278 * 279 * Revision 1.6 2007/09/22 19:23:56 fplanque 280 * various fixes & enhancements 281 * 282 * Revision 1.5 2007/09/07 21:11:10 fplanque 283 * superstylin' (not even close) 284 * 285 * Revision 1.4 2007/09/03 16:44:28 fplanque 286 * chicago admin skin 287 * 288 * Revision 1.3 2007/07/01 15:12:28 fplanque 289 * simplified 'use_form' 290 * 291 * Revision 1.2 2007/07/01 03:55:04 fplanque 292 * category plugin replaced by widget 293 * 294 * Revision 1.1 2007/06/25 11:00:30 fplanque 295 * MODULES (refactored MVC) 296 * 297 * Revision 1.14 2007/06/11 01:55:02 fplanque 298 * minor 299 * 300 * Revision 1.13 2007/04/26 00:11:06 fplanque 301 * (c) 2007 302 * 303 * Revision 1.12 2007/03/11 23:57:06 fplanque 304 * item editing: allow setting to 'redirected' status 305 * 306 * Revision 1.11 2006/12/12 02:53:57 fplanque 307 * Activated new item/comments controllers + new editing navigation 308 * Some things are unfinished yet. Other things may need more testing. 309 * 310 * Revision 1.10 2006/11/19 03:50:29 fplanque 311 * cleaned up CSS 312 * 313 * Revision 1.8 2006/11/16 23:48:56 blueyed 314 * Use div.line instead of span.line as element wrapper for XHTML validity 315 */ 316 ?>
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 |
![]() |