Changeset 14543

Show
Ignore:
Timestamp:
01/21/08 18:21:43 (11 months ago)
Author:
flack
Message:

use tablesorter's built-in striping mechanism

(this also has the advantage that striping is still correct after changing sort order)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.admin.user/handler/list.php

    r14385 r14543  
    22/** 
    33 * @package midcom.admin.user 
    4  * @author The Midgard Project, http://www.midgard-project.org  
     4 * @author The Midgard Project, http://www.midgard-project.org 
    55 * @version $Id: viewer.php 3975 2006-09-06 17:36:03Z bergie $ 
    66 * @copyright The Midgard Project, http://www.midgard-project.org 
     
    1010/** 
    1111 * Style editor class for listing style elements 
    12  *  
     12 * 
    1313 * @package midcom.admin.user 
    1414 */ 
     
    1919    /** 
    2020     * Simple constructor 
    21      *  
     21     * 
    2222     * @access public 
    2323     */ 
     
    4343            ) 
    4444        ); 
    45          
     45 
    4646        $_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'); 
    4847        $_MIDCOM->add_jsfile(MIDCOM_STATIC_URL . '/midcom.admin.user/jquery.midcom_admin_user.js'); 
    4948 
     
    5251    } 
    5352 
    54      
     53 
    5554    function _update_breadcrumb() 
    5655    { 
     
    9998        midgard_admin_asgard_plugin::get_common_toolbar($data); 
    10099    } 
    101      
     100 
    102101    /** 
    103102     * Handler method for listing style elements for the currently used component topic 
     
    110109     */ 
    111110    function _handler_list($handler_id, $args, &$data) 
    112     {    
     111    { 
    113112 
    114113        // See what fields we want to use in the search 
    115114        $data['search_fields'] = $this->_config->get('search_fields'); 
    116115        $data['list_fields'] = $this->_config->get('list_fields'); 
    117          
     116 
    118117        // Set the passwords elsewhere, but check the request first 
    119118        if (   isset($_POST['midcom_admin_user_action']) 
     
    128127            { 
    129128                $get = implode('&midcom_admin_user[]=', $_POST['midcom_admin_user']); 
    130                  
     129 
    131130                $_MIDCOM->relocate("__mfa/asgard_midcom.admin.user/password/batch/?midcom_admin_user[]={$get}"); 
    132131                // This will exit 
    133132            } 
    134133        } 
    135          
     134 
    136135        if (   isset($_POST['midcom_admin_user']) 
    137136            && is_array($_POST['midcom_admin_user']) 
     
    141140            { 
    142141                $person = new midcom_db_person($person_id); 
    143                  
     142 
    144143                switch ($_POST['midcom_admin_user_action']) 
    145144                { 
     
    157156                        } 
    158157                        break; 
    159                          
     158 
    160159                    case 'groupadd': 
    161160                        if (isset($_POST['midcom_admin_user_group'])) 
     
    173172            } 
    174173        } 
    175          
     174 
    176175        if (isset($_REQUEST['midcom_admin_user_search'])) 
    177176        { 
     
    186185            $qb->add_order('lastname'); 
    187186            $qb->add_order('firstname'); 
    188              
     187 
    189188            $this->_persons = $qb->execute(); 
    190189        } 
     
    193192            // List all persons if there are less than N of them 
    194193            $qb = midcom_db_person::new_query_builder(); 
    195              
     194 
    196195            if ($qb->count_unchecked() < $this->_config->get('list_without_search')) 
    197196            { 
    198197                $qb->add_order('lastname'); 
    199198                $qb->add_order('firstname'); 
    200              
     199 
    201200                $this->_persons = $qb->execute(); 
    202201            } 
    203202        } 
    204          
     203 
    205204        $data['groups'] = array 
    206205        ( 
     
    216215            } 
    217216        } 
    218          
     217 
    219218        $this->_update_breadcrumb(); 
    220219        $this->_prepare_toolbar($data); 
    221         $_MIDCOM->set_pagetitle($data['view_title']);         
     220        $_MIDCOM->set_pagetitle($data['view_title']); 
    222221 
    223222        return true; 
    224223    } 
    225      
     224 
    226225    /** 
    227226     * Show list of the style elements for the currently edited topic component 
    228      *  
     227     * 
    229228     * @access private 
    230229     * @param string $handler_id Name of the used handler 
     
    235234        midgard_admin_asgard_plugin::asgard_header(); 
    236235        $data['config'] =& $this->_config; 
    237          
     236 
    238237        $data['persons'] =& $this->_persons; 
    239238        midcom_show_style('midcom-admin-user-personlist-header'); 
    240          
     239 
    241240        $data['even'] = false; 
    242241        foreach ($data['persons'] as $person) 
     
    253252            } 
    254253        } 
    255          
     254 
    256255        midcom_show_style('midcom-admin-user-personlist-footer'); 
    257256        midgard_admin_asgard_plugin::asgard_footer(); 
    258          
     257 
    259258    } 
    260259} 
  • trunk/midcom/midcom.admin.user/style/midcom-admin-user-personlist-footer.php

    r13661 r14543  
    6868                    $j(active).css({display: 'none'}); 
    6969                } 
    70                  
     70 
    7171                $j(this).attr('value'); 
    7272                switch ($j(this).attr('value')) 
     
    7474                    case 'passwords': 
    7575                        active = '#midcom_admin_user_action_passwords'; 
    76                          
     76 
    7777                        if (document.getElementById('midcom_admin_user_action_passwords')) 
    7878                        { 
     
    8080                            break; 
    8181                        } 
    82                          
     82 
    8383                        $j('<div></div>') 
    8484                            .attr('id', 'midcom_admin_user_action_passwords') 
    8585                            .appendTo('#midcom_admin_user_batch_process'); 
    86                          
     86 
    8787                        // Load the form for outputting the style 
    8888                        $j('#midcom_admin_user_action_passwords').load('&(prefix);__mfa/asgard_midcom.admin.user/password/batch/?ajax&timestamp=<?php echo time(); ?>'); 
    89                          
     89 
    9090                        $j('#midcom_admin_user_batch_process').submit(function() 
    9191                        { 
     
    9494                        }); 
    9595                        break; 
    96                      
     96 
    9797                    case 'groupadd': 
    9898                        $j('#midcom_admin_user_group').css({display: 'inline'}); 
    9999                        active = '#midcom_admin_user_group'; 
    100100                        break; 
    101                      
     101 
    102102                    default: 
    103103                        active = null; 
    104                          
     104 
    105105                        // Return the original submit functionality 
    106106                        $j('#midcom_admin_user_batch_process').submit(function() 
     
    108108                            var action = '&(prefix);__mfa/asgard_midcom.admin.user/'; 
    109109                            $j(this).attr('action', action); 
    110                              
     110 
    111111                            return true; 
    112112                        }); 
     
    116116            { 
    117117                headers: {0: {sorter: false}}, 
    118                 widgets: ['column_highlight'], 
     118                widgets: ['zebra'], 
    119119                sortList: [[2,0]] 
    120120            });