Development

Changeset 1339

You must first sign up to be able to contribute.

Changeset 1339

Show
Ignore:
Timestamp:
05/10/06 22:16:37 (3 years ago)
Author:
fabien
Message:

fixed default sorting in admin generator (closes #324)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/data/generator/sfPropelAdmin/default/template/actions/actions.class.php

    r1338 r1339  
    239239      $this->getUser()->setAttribute('type', $this->getRequestParameter('type', 'asc'), 'sf_admin/<?php echo $this->getSingularName() ?>/sort'); 
    240240    } 
     241 
     242    if (!$this->getUser()->getAttribute('sort', null, 'sf_admin/order/sort')) 
     243    { 
     244<?php if ($sort = $this->getParameterValue('list.sort')): ?> 
     245<?php if (is_array($sort)): ?> 
     246      $this->getUser()->setAttribute('sort', '<?php echo $sort[0] ?>', 'sf_admin/order/sort'); 
     247      $this->getUser()->setAttribute('type', '<?php echo $sort[1] ?>', 'sf_admin/order/sort'); 
     248<?php else: ?> 
     249      $this->getUser()->setAttribute('sort', '<?php echo $sort ?>', 'sf_admin/order/sort'); 
     250      $this->getUser()->setAttribute('type', 'asc', 'sf_admin/order/sort'); 
     251<?php endif; ?> 
     252<?php endif; ?> 
     253    } 
    241254  } 
    242255