Development

#6731: _list_th_tabular.php

You must first sign up to be able to contribute.

Ticket #6731: _list_th_tabular.php

File _list_th_tabular.php, 1.4 kB (added by caponica, 8 months ago)

New version of _list_th_tabular.php to allow user-defined sorting

Line 
1 <?php foreach ($this->configuration->getValue('list.display') as $name => $field): ?>
2 [?php slot('sf_admin.current_header') ?]
3 <th class="sf_admin_<?php echo strtolower($field->getType()) ?> sf_admin_list_th_<?php echo $name ?>">
4 <?php $sort_field = $field->getConfig('sort_field', $name, true) ?>
5 <?php if ($field->isReal() || $field->getConfig('sort_field', false)): ?>
6   [?php if ('<?php echo $sort_field ?>' == $sort[0]): ?]
7     [?php echo link_to(__('<?php echo $field->getConfig('label', '', true) ?>', array(), '<?php echo $this->getI18nCatalogue() ?>'), '@<?php echo $this->getUrlForAction('list') ?>?sort=<?php echo $sort_field ?>&sort_type='.($sort[1] == 'asc' ? 'desc' : 'asc')) ?]
8     [?php echo image_tag(sfConfig::get('sf_admin_module_web_dir').'/images/'.$sort[1].'.png', array('alt' => __($sort[1], array(), 'sf_admin'), 'title' => __($sort[1], array(), 'sf_admin'))) ?]
9   [?php else: ?]
10     [?php echo link_to(__('<?php echo $field->getConfig('label', '', true) ?>', array(), '<?php echo $this->getI18nCatalogue() ?>'), '@<?php echo $this->getUrlForAction('list') ?>?sort=<?php echo $sort_field ?>&sort_type=asc') ?]
11   [?php endif; ?]
12 <?php else: ?>
13   [?php echo __('<?php echo $field->getConfig('label', '', true) ?>', array(), '<?php echo $this->getI18nCatalogue() ?>') ?]
14 <?php endif; ?>
15 </th>
16 [?php end_slot(); ?]
17 <?php echo $this->addCredentialCondition("[?php include_slot('sf_admin.current_header') ?]", $field->getConfig()) ?>
18 <?php endforeach; ?>
19

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.