Changeset 14543
- Timestamp:
- 01/21/08 18:21:43 (11 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom.admin.user/handler/list.php
r14385 r14543 2 2 /** 3 3 * @package midcom.admin.user 4 * @author The Midgard Project, http://www.midgard-project.org 4 * @author The Midgard Project, http://www.midgard-project.org 5 5 * @version $Id: viewer.php 3975 2006-09-06 17:36:03Z bergie $ 6 6 * @copyright The Midgard Project, http://www.midgard-project.org … … 10 10 /** 11 11 * Style editor class for listing style elements 12 * 12 * 13 13 * @package midcom.admin.user 14 14 */ … … 19 19 /** 20 20 * Simple constructor 21 * 21 * 22 22 * @access public 23 23 */ … … 43 43 ) 44 44 ); 45 45 46 46 $_MIDCOM->add_jsfile(MIDCOM_STATIC_URL . '/jQuery/jquery.tablesorter.js'); 47 $_MIDCOM->add_jsfile(MIDCOM_STATIC_URL . '/midcom.admin.user/jquery.tablesorter.widget.column_highlight.js');48 47 $_MIDCOM->add_jsfile(MIDCOM_STATIC_URL . '/midcom.admin.user/jquery.midcom_admin_user.js'); 49 48 … … 52 51 } 53 52 54 53 55 54 function _update_breadcrumb() 56 55 { … … 99 98 midgard_admin_asgard_plugin::get_common_toolbar($data); 100 99 } 101 100 102 101 /** 103 102 * Handler method for listing style elements for the currently used component topic … … 110 109 */ 111 110 function _handler_list($handler_id, $args, &$data) 112 { 111 { 113 112 114 113 // See what fields we want to use in the search 115 114 $data['search_fields'] = $this->_config->get('search_fields'); 116 115 $data['list_fields'] = $this->_config->get('list_fields'); 117 116 118 117 // Set the passwords elsewhere, but check the request first 119 118 if ( isset($_POST['midcom_admin_user_action']) … … 128 127 { 129 128 $get = implode('&midcom_admin_user[]=', $_POST['midcom_admin_user']); 130 129 131 130 $_MIDCOM->relocate("__mfa/asgard_midcom.admin.user/password/batch/?midcom_admin_user[]={$get}"); 132 131 // This will exit 133 132 } 134 133 } 135 134 136 135 if ( isset($_POST['midcom_admin_user']) 137 136 && is_array($_POST['midcom_admin_user']) … … 141 140 { 142 141 $person = new midcom_db_person($person_id); 143 142 144 143 switch ($_POST['midcom_admin_user_action']) 145 144 { … … 157 156 } 158 157 break; 159 158 160 159 case 'groupadd': 161 160 if (isset($_POST['midcom_admin_user_group'])) … … 173 172 } 174 173 } 175 174 176 175 if (isset($_REQUEST['midcom_admin_user_search'])) 177 176 { … … 186 185 $qb->add_order('lastname'); 187 186 $qb->add_order('firstname'); 188 187 189 188 $this->_persons = $qb->execute(); 190 189 } … … 193 192 // List all persons if there are less than N of them 194 193 $qb = midcom_db_person::new_query_builder(); 195 194 196 195 if ($qb->count_unchecked() < $this->_config->get('list_without_search')) 197 196 { 198 197 $qb->add_order('lastname'); 199 198 $qb->add_order('firstname'); 200 199 201 200 $this->_persons = $qb->execute(); 202 201 } 203 202 } 204 203 205 204 $data['groups'] = array 206 205 ( … … 216 215 } 217 216 } 218 217 219 218 $this->_update_breadcrumb(); 220 219 $this->_prepare_toolbar($data); 221 $_MIDCOM->set_pagetitle($data['view_title']); 220 $_MIDCOM->set_pagetitle($data['view_title']); 222 221 223 222 return true; 224 223 } 225 224 226 225 /** 227 226 * Show list of the style elements for the currently edited topic component 228 * 227 * 229 228 * @access private 230 229 * @param string $handler_id Name of the used handler … … 235 234 midgard_admin_asgard_plugin::asgard_header(); 236 235 $data['config'] =& $this->_config; 237 236 238 237 $data['persons'] =& $this->_persons; 239 238 midcom_show_style('midcom-admin-user-personlist-header'); 240 239 241 240 $data['even'] = false; 242 241 foreach ($data['persons'] as $person) … … 253 252 } 254 253 } 255 254 256 255 midcom_show_style('midcom-admin-user-personlist-footer'); 257 256 midgard_admin_asgard_plugin::asgard_footer(); 258 257 259 258 } 260 259 } trunk/midcom/midcom.admin.user/style/midcom-admin-user-personlist-footer.php
r13661 r14543 68 68 $j(active).css({display: 'none'}); 69 69 } 70 70 71 71 $j(this).attr('value'); 72 72 switch ($j(this).attr('value')) … … 74 74 case 'passwords': 75 75 active = '#midcom_admin_user_action_passwords'; 76 76 77 77 if (document.getElementById('midcom_admin_user_action_passwords')) 78 78 { … … 80 80 break; 81 81 } 82 82 83 83 $j('<div></div>') 84 84 .attr('id', 'midcom_admin_user_action_passwords') 85 85 .appendTo('#midcom_admin_user_batch_process'); 86 86 87 87 // Load the form for outputting the style 88 88 $j('#midcom_admin_user_action_passwords').load('&(prefix);__mfa/asgard_midcom.admin.user/password/batch/?ajax×tamp=<?php echo time(); ?>'); 89 89 90 90 $j('#midcom_admin_user_batch_process').submit(function() 91 91 { … … 94 94 }); 95 95 break; 96 96 97 97 case 'groupadd': 98 98 $j('#midcom_admin_user_group').css({display: 'inline'}); 99 99 active = '#midcom_admin_user_group'; 100 100 break; 101 101 102 102 default: 103 103 active = null; 104 104 105 105 // Return the original submit functionality 106 106 $j('#midcom_admin_user_batch_process').submit(function() … … 108 108 var action = '&(prefix);__mfa/asgard_midcom.admin.user/'; 109 109 $j(this).attr('action', action); 110 110 111 111 return true; 112 112 }); … … 116 116 { 117 117 headers: {0: {sorter: false}}, 118 widgets: [' column_highlight'],118 widgets: ['zebra'], 119 119 sortList: [[2,0]] 120 120 });
