Hello, I’m Julian

Symfony 1.0 Admin List: Highlight last edited entry


To highlight the last created or edited entry in a Admin-Generator-List copy the _list.php file from cache to your /apps/[APPNAME]/modules[MODULENAME]/templates directory and modify the code:

    ...
    <?php $i = 1; foreach ($pager->getResults() as $mymodel): $odd = fmod(++$i, 2) ?>
      < tr class="sf_admin_row_<?php echo $odd ?><?php if($sf_request->getParameter("id",0)==$mymodel->getId()) echo " rowsel"; ?>" >
      <?php include_partial('list_td_tabular', array('mymodel' => $mymodel)) ?>
      <?php include_partial('list_td_actions', array('mymodel' => $mymodel)) ?>
      < /tr >
    <?php endforeach; ?>
    ...

Add a stylesheet like this:

    \#sf_admin_container .sf_admin_list .rowsel td {  
      border-bottom:1px solid #DDDDDD;  
      border-right:1px solid #DDDDDD;  
      padding:3px;  
      background-color: #DDDDEE !important;  
    }  

Done!

Date: Tue, 19 May 2009 9:48:00
Author: Julian Stricker

PREVIOUS NEXT

Blog Comments powered by Disqus.