I noticed that when creating a custom action you can not define the buttons CSS only the <i> class. What would be nice (especially for the bootstrap template) is to be able to tell the buttom to be green, blue, red, ect. Not the default gray.
I've done this in my local copy. though I've made several alterations unique to my installation to fit my needs. So basically what I did was change the list_tbody.php file to create the actions URLS like this:
<?php if (!empty($row->action_urls)) { if(!empty($row->action_urls)){ foreach($row->action_urls as $action_unique_id => $action_url){ $action = $actions[$action_unique_id]; $button_css = "btn-default"; $icon_css = $action->css_class; if (is_array($action->css_class)) { $button_css = $action->css_class['button']; $icon_css = $action->css_class['icon']; } ?> <a href="<?php echo $action_url; ?>" class="btn <?php echo $button_css; ?>" target="<?php echo $action->url_target; ?>"> <i class="fa <?php echo $icon_css; ?>"></i> <?php echo $action->label?> </a> <?php } } } ?>
So when i call add_action, i do so like this:
$crud->add_action("View", '', '', array('icon' => 'fa-eye', 'button' => 'btn-primary'));