Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Loop in the controller
- foreach($objects as $o){
- $rows .= '<tr>';
- // Checkbox
- $rows .= '<td>' . form_label(form_checkbox('action_to[]', $o->id)) . '</td>';
- // Field values
- foreach($fields as $field){
- $rows .= '<td>' . $o->{$field} . '</td>';
- }
- // Add buttons
- $rows .= '<td class="align-center">';
- $rows .= '<div class="actions">';
- // Edit button
- if(!in_array($o->id, $noactions['edit'])){
- $rows .= anchor(
- 'admin/'.$this->module.'/edit/' . $o->id,
- sprite(
- 'pencil',
- array('title' => ucfirst(sprintf(lang('edit'),lang($this->module . '.s'))))
- ),
- 'class="button edit"'
- );
- }
- // Delete button
- if(!in_array($o->id, $noactions['delete'])){
- $rows .= anchor(
- 'admin/'.$this->module.'/delete/' . $o->id,
- sprite(
- 'delete',
- array('title' => ucfirst(sprintf($this->lang->line('delete'),$this->lang->line($this->module . '.s'))))
- ),
- array(
- 'onclick' => 'javascript:return confirm(\''.ucfirst(sprintf($this->lang->line('delete_confirm'),$this->lang->line($this->module . '.s'))).'\')')
- );
- }
- $rows .= '</div></td></tr>';
- }
- $this->template->set_partial('list','admin/list',array('list_header' => $header, 'list_rows' => $rows));
- $this->template->build('admin/list_wrapper');
- }else{
- $this->template->build('admin/list_nodata');
- }
- // the view showing the list
- <thead>
- <tr>
- <th width="15"><?php echo form_checkbox(array('name' => 'action_to_all', 'id' => 'checkall', 'class' => 'checkbox')); ?></th>
- <?php echo $list_header; ?>
- <th width="50"></th>
- </tr>
- </thead>
- <tbody>
- <?php echo $list_rows; ?>
- </tbody>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment